mojira.dev
MC-305378

Skeletons no longer charge their bows if their CustomName is continuously changed

Skeletons interrupt the loading of their bows when their CustomName is changed using the /data command.

I noticed this behavior after programming a datapack where a mob's current health is displayed as hearts in the CustomName. To make this possible, the CustomName is set every tick. As a result, skeletons will follow a player but won't attack them with their bows.

I also reproduced this with a simple setup (see the YouTube video or the Video attached). I used the command execute as @e[type=minecraft:skeleton] run data merge entity @s {CustomNameVisible:1b,CustomName:"indic-1"} (with indic-2) to repeatedly switch the CustomName of skeletons back and forth. It can be observed that the skeletons interrupt the loading of their bows every time the CustomName is changed. I then activated a repeating command block that permanently (every tick) changes the skeletons' custom names using the command execute as @e[type=minecraft:skeleton] run data modify entity @s CustomName set from entity @s Health. This results in the same behavior I observed with the data pack.

This behavior affects not only skeletons, but also Strays and Parched.

YouTube Link: https://youtu.be/3qp_bWV6R6I or Video attached.

Environment

Java Edition
Minecraft Launcher
Version: 1.21.11

Linked issues

Attachments

Comments 6

Here is an excerpt from my datapack code, which adjusts the CustomName every tick, based on their health.

execute if score @s mh.mobhealth matches 1 run data merge entity @s {CustomName:[{"atlas":"minecraft:gui","sprite":"hud/heart/half"}]}
execute if score @s mh.mobhealth matches 2 run data merge entity @s {CustomName:[{"atlas":"minecraft:gui","sprite":"hud/heart/full"}]}
execute if score @s mh.mobhealth matches 3 run data merge entity @s {CustomName:[{"atlas":"minecraft:gui","sprite":"hud/heart/full"},{"atlas":"minecraft:gui","sprite":"hud/heart/half"}]}

Please attach the world/strucure file and datapack so this can be more easily reproduced

This is the world in which I reproduced the behavior. The data pack is also present and just needs to be activated.

[media]

This also applies to Breezes, which neither jump away nor attack the player. Tested in recent Version.

Wardens also behave strangely if their custom name is permanently changed. For example, they no longer attack players properly, and they also seem unable to correctly identify the source of sounds.

marbrueck

(Unassigned)

Confirmed

Platform

Low

Commands, Data Packs, Entities

1.21.11

Retrieved