Started by
yoyo_yoko
on
Topic category: Help with Minecraft modding (Java Edition)
I have this enchantment in a mod I'm working on that on a keybind press, it will teleport the player to the nearest entity in a radius of the enchantment level + 2 (the enchantment level max is 3). I don't have a lot of ideas but one I had was to check for the nearest entity data block, storing the x y and z coordinates then moving the player there (but changing the coordinates slightly to make the player appear behind the entity). The issue is, when I check for the nearest entity, it always returns the player. Can I make it not do this, besides avoiding player entites completely? (I still want this to work on other players)
Try a procedure what executes: "/execute as @p run tp @s @e[type=!player, r=(local:TravelRaidius), x=~, y=~, z=~]"
I'm gonna assume I need to make a variable for it, probably the same name and a number variable? Sorry I just got to this lol
But also, isn't it not possible to tp to @e? I'm doing this on 1.20.1 Forge if that helps.