From b348bd293e672ae7eb954648bdfb19048193e8fd Mon Sep 17 00:00:00 2001 From: Ic3Tank <61137113+IceTank@users.noreply.github.com> Date: Sun, 15 Mar 2026 02:52:44 +0100 Subject: [PATCH 1/4] Add Target Named Entities to targeting setting --- src/main/kotlin/com/lambda/config/groups/Targeting.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/kotlin/com/lambda/config/groups/Targeting.kt b/src/main/kotlin/com/lambda/config/groups/Targeting.kt index 7163303e8..c155ab9d5 100644 --- a/src/main/kotlin/com/lambda/config/groups/Targeting.kt +++ b/src/main/kotlin/com/lambda/config/groups/Targeting.kt @@ -103,6 +103,11 @@ abstract class Targeting( */ val priority by c.setting("${prefix}Priority", Priority.Distance, visibility = visibility).group(*baseGroup).index() + /** + * Whether to target named entities (e.g., players with custom names). Configurable with default set to `true`. + */ + val targetNamed by c.setting("${prefix}Target Named Entities", false, visibility = visibility).group(*baseGroup).index() + /** * Validates whether a given entity is targetable for combat based on the field of view limit and other settings. * @@ -114,6 +119,7 @@ abstract class Targeting( if (fov < 180 && player.rotation dist player.eyePos.rotationTo(entity.pos) > fov) return false if (entity.uuid in illegalTargets) return false if (entity.isDead) return false + if (entity.hasCustomName() && !targetNamed) return false return super.validate(player, entity) } From 1e48948d6966bd3cb9879c9383214102f9e2ad58 Mon Sep 17 00:00:00 2001 From: Ic3Tank <61137113+IceTank@users.noreply.github.com> Date: Wed, 18 Mar 2026 14:18:02 +0100 Subject: [PATCH 2/4] Only apply named setting to none player like entities --- src/main/kotlin/com/lambda/config/groups/Targeting.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/lambda/config/groups/Targeting.kt b/src/main/kotlin/com/lambda/config/groups/Targeting.kt index c155ab9d5..197904a44 100644 --- a/src/main/kotlin/com/lambda/config/groups/Targeting.kt +++ b/src/main/kotlin/com/lambda/config/groups/Targeting.kt @@ -36,6 +36,8 @@ import net.minecraft.client.network.ClientPlayerEntity import net.minecraft.client.network.OtherClientPlayerEntity import net.minecraft.client.toast.SystemToast.hide import net.minecraft.entity.LivingEntity +import net.minecraft.entity.PlayerLikeEntity +import net.minecraft.entity.player.PlayerEntity import java.util.* /** @@ -119,7 +121,7 @@ abstract class Targeting( if (fov < 180 && player.rotation dist player.eyePos.rotationTo(entity.pos) > fov) return false if (entity.uuid in illegalTargets) return false if (entity.isDead) return false - if (entity.hasCustomName() && !targetNamed) return false + if (entity.hasCustomName() && entity !is PlayerLikeEntity && !targetNamed) return false return super.validate(player, entity) } From 20abcba9f8e05e13bd2559170134b5dca10c40c2 Mon Sep 17 00:00:00 2001 From: IceTank <61137113+IceTank@users.noreply.github.com> Date: Sun, 29 Mar 2026 22:47:31 +0200 Subject: [PATCH 3/4] Update comment for targetNamed setting description --- src/main/kotlin/com/lambda/config/groups/Targeting.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/lambda/config/groups/Targeting.kt b/src/main/kotlin/com/lambda/config/groups/Targeting.kt index 197904a44..e806c2a84 100644 --- a/src/main/kotlin/com/lambda/config/groups/Targeting.kt +++ b/src/main/kotlin/com/lambda/config/groups/Targeting.kt @@ -106,7 +106,7 @@ abstract class Targeting( val priority by c.setting("${prefix}Priority", Priority.Distance, visibility = visibility).group(*baseGroup).index() /** - * Whether to target named entities (e.g., players with custom names). Configurable with default set to `true`. + * Whether to target named entities that are not players. Configurable with default set to `true`. */ val targetNamed by c.setting("${prefix}Target Named Entities", false, visibility = visibility).group(*baseGroup).index() From a668fe9a359e44745a29489e0fad94d0b76d5c9d Mon Sep 17 00:00:00 2001 From: beanbag44 <107891830+beanbag44@users.noreply.github.com> Date: Mon, 6 Apr 2026 03:30:34 +0100 Subject: [PATCH 4/4] fixes --- src/main/kotlin/com/lambda/config/groups/Targeting.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/kotlin/com/lambda/config/groups/Targeting.kt b/src/main/kotlin/com/lambda/config/groups/Targeting.kt index aa26101db..734969c32 100644 --- a/src/main/kotlin/com/lambda/config/groups/Targeting.kt +++ b/src/main/kotlin/com/lambda/config/groups/Targeting.kt @@ -35,7 +35,6 @@ import net.minecraft.client.network.OtherClientPlayerEntity import net.minecraft.entity.Entity import net.minecraft.entity.LivingEntity import net.minecraft.entity.PlayerLikeEntity -import net.minecraft.entity.player.PlayerEntity import java.util.* /** @@ -46,7 +45,7 @@ import java.util.* * are targetable, the range of targeting, and various other conditions for targeting. * * @param c The [Configurable] instance used to get and set configuration options for targeting. - * @param vis The predicate used to determine whether the targeting settings are visible and active. + * @param visibility The predicate used to determine whether the targeting settings are visible and active. * @param defaultRange The default range within which entities can be targeted. * @param maxRange The maximum range within which entities can be targeted. */ @@ -118,7 +117,6 @@ abstract class Targeting( override fun validate(player: ClientPlayerEntity, entity: Entity): Boolean { if (fov < 180 && player.rotation dist player.eyePos.rotationTo(entity.pos) > fov) return false if (entity.uuid in illegalTargets) return false - if (entity.isDead) return false if (entity.hasCustomName() && entity !is PlayerLikeEntity && !targetNamed) return false if ((entity as? LivingEntity)?.isDead == true) return false return super.validate(player, entity)