Mojira Archive
MC-269233

Pillagers without a crossbow target the entity they want to attack, even though it doesn't impact their behavior in any discernible manner.

When a pillager lacks a crossbow, it becomes unable to attack entities. However, it continues to target entities it wants to attack, leading to unnecessary calculations that impact performance. To reproduce this issue, download the provided datapack and execute the command

/execute as @e at @s on target run function snapshots:raycast_particles/3

in a repeating command block. Then spawn a pillager and remove its crossbow using the command

/item replace entity @e[type=minecraft:pillager,limit=1,sort=nearest] weapon.mainhand with air

. In survival mode or by spawning villagers, the pillager will still target them or you, as indicated by the emitted particles. The datapack command draws a line of particles between an entity and its target to visualize this behavior. Relates to MC-139433 and MC-163960.

Unresolved

No User

oowooglac

2024-03-09, 02:30 PM

2024-04-09, 12:04 PM

1

1

Confirmed

Data Packs

1.20.4, 24w10a, 24w11a

-