I cannot set a wolf to be angry using commands. I have tried this two ways, using a function and with typed commands.
To reproduce, summon a wolf, probably inside a pen so it can’t run away.
Create a function with the contents:
execute as @e[type=wolf] run data modify entity @s angry_at set from entity @p UUID
execute as @e[type=wolf] run data modify entity @s anger_end_time set value 1000000execute as @e[type=wolf] run data modify entity @s angry_at set from entity @p UUID
execute as @e[type=wolf] run data modify entity @s anger_end_time set value 1000000Then invoke the function. The wolf does not become angry (it doesn’t change to the angry texture, nor (afaict) act in an angry way.
I have tried typing these from the command line and had the same (lack of) result.
Speculation about the problem (I’m probably wrong): I’m thinking this is because neither angry_at nor anger_and_time are valid without the other, so when I set (say) angry_at, the system notes that the end time does not have a positive value and so ignores the command. I obviously could be wrong about this.
Comments 3
I am in creative mode. But this also fails for me for non-player entities. For example, if I summon a nearby parched (also in a pen), and run
/data modify entity@n[type=wolf] angry_at set from entity @n[type=parched]/data modify entity@n[type=wolf] angry_at set from entity @n[type=parched]the wolf also fails to get angry. However, if I run get the parched’s UUID and put it into a merge command so I set both at once, as in:
/data merge entity 163ac043-3b47-44be-b643-88aaff94cd0e {angry_at: [I; 577786577, 605832062, -1989529972, 1018961742], anger_end_time: 0}/data merge entity 163ac043-3b47-44be-b643-88aaff94cd0e {angry_at: [I; 577786577, 605832062, -1989529972, 1018961742], anger_end_time: 0}this works. Which seems more evidence that the problem is that setting the values in different commands doesn’t work. (FWIW, this isn’t a solution because in a function I won’t know the UUID of the entity get angry at in advance, so the only direct way to do this is to use “/data modify … set from …”, which has to be in a separate command.)
Wolves attack skeleton-type mobs including parched all by themselves, so I have no clue why you don’t observe the wolf attacking.
When I correct the spacing of your command, add the omitted UUID, and change to a different mob that wolves don’t automatically attack, it also works fine for me.
/data modify entity @n[type=wolf] angry_at set from entity @n[type=husk] UUID
Can't reproduce. Make sure you're not in creative mode