So I want to use command blocks to summon an ender pearl in a stasis chamber that will teleport me when I activate it. Thing is, I can't figure out how to make the pearl teleport me.

On reddit, I found a comment saying that this script:data modify entity @e[type=ender_pearl,limit=1,sort=nearest] Owner set from entity @s UUID

would make the pearl teleport you. I tried it, and it doesn't do anything. Is what I'm trying to achieve even possible?

2

1 Answer

Your command worked for me.

After summoning the ender pearl, when you run the /data command, make sure it is selecting the nearest ender pearl. You can check if it's Owner tag matches yours by using /data get entity @e[type=minecraft:ender_pearl,limit=1,sort=nearest] Owner and /data get entity @s UUID


If you are summoning many ender pearls in a small area, it might be that you are selecting the wrong one. You can use:

execute as @e[type=ender_pearl,distance=..5] run data modify entity @s Owner set from entity @p UUID

This will make all ender pearls within a 5 block spherical radius of the execution point set their Owner to the nearest player's UUID.

2