custom mobs help
so ive made a goblin mob using a armor stand that tps to the nearest husk with goblin tag
execute as @e[type=husk,tag=goblin] at @s unless entity @e[type=armor_stand,distance=..1,tag=goblin] run summon armor_stand ~ ~ ~ {Small:1b,Marker:1b,Invisible:1b,Tags:["goblin"],equipment:{head:{id:"minecraft:dirt",count:1,components:{"minecraft:item_model":"template:goblin_still"}}}}
execute as @e[type=husk,tag=goblin] at @s if entity @e[type=armor_stand,distance=..1,tag=goblin] run tp @e[type=armor_stand,distance=..1,tag=goblin,sort=nearest] @s
execute as @e[type=armor_stand,tag=goblin] at @s unless entity @e[type=husk,tag=goblin,distance=..1] run kill @s
this works fine with 1mob but when the mobs are within 1 block from eachother they glitch... does anyone have a fix?