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.
Thank you for your report!
After consideration, the issue is being closed as Won't Fix.
Please note that this is not the same as Working as Intended, as this bug report correctly describes behavior in the game that might not be the intended or desirable behavior, but it will not be fixed right now. Sometimes, this is because the issue reported is minor and/or impossible to change without large architectural changes to the code base.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki