I am working on a datapack with custom items, one of which summons aggressive wolves to fight for the player. The summoning works without problems but I cannot get the wolves to be aggressive towards enemies.
The function I am using to set aggro is as foll
execute as @e[tag=hunt] run data modify entity @s AngryAt set from entity @e[type=!wolf,type=!player,sort=nearest,distance=..50,limit=1] UUID
This command works fine when run from a commandblock ingame but does not work when run from a function. I should note that the function file itself runs fine (i.e., substituting the command with something like 'say doot' works fine) so it is not a tick issue.
Does anyone know how to fix this?