0

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
  • 2
    I'm curious what the application of this would be. Why not just use a command to teleport you instead of the extra ender pearl? It's an interesting idea.
    – Regnegade
    Sep 2, 2021 at 14:37
  • It's because I'm trying to find a way to prevent unloaded stasis chambers, actually. I thought that if a player throws enough pearls, it might cap out and prevent more from working. I want to use command blocks because of the cooldown when a user throws a pearl.
    – Slushie
    Sep 2, 2021 at 14:43

1 Answer 1

1

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
  • But will the pearl teleport you when it lands?
    – Slushie
    Sep 4, 2021 at 21:27
  • @HyperEdge Yes, it did.
    – ginkgo
    Sep 5, 2021 at 11:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .