Teleporting a Mob from Player Distance
Hello! I've been grinding out a datapack, and I cannot figure it out for the life of me. I want to teleport a mob (baby zombies which already have tags) to the player (me) as a result of me being far from them (16+ blocks).
For context: The full datapack basically spawns baby zombies that are tagged "mob_marker" and when you kill them, they spawn another baby zombie at the same location with tags such as "marker_netherite", "marker_iron", and "marker_diamond". The goal would be to have this baby zombies be able to tp near you (but not on top of you).
I was thinking that putting something like this in the tick file would work: execute as @e[type=zombie,nbt={IsBaby:1b},tag=marker_netherite] at @s if entity @p[distance=16..] run execute at @p run tp @s ^ ^1 ^3
However, I think distance calculation is probably more complicated since that command doesn't work.
Any and all help welcome!