1

Make entities teleport you with a command

Turicagamer's Avatar Turicagamer8/3/19 11:08 pm
1 emeralds 197 4
8/5/2019 5:08 am
Turicagamer's Avatar Turicagamer
Hi, I'm trying to make it so that when I'm two blocks away from a firework it will teleport me up 1 block.

This is what I tried:
execute as (name) if entity @e[type=minecraft:firework_rocket,distance=..2] run tp (name) ~ ~1 ~

Any help would be appreciated :)
Posted by Turicagamer's Avatar
Turicagamer
Level 1 : New Miner
0

Create an account or sign in to comment.

4

1
08/04/2019 3:32 am
Level 52 : Grandmaster Blob
HoboMaggot
HoboMaggot's Avatar
/execute as @a if entity @e[type=firework_rocket,distance=..4] run tp @s ~ ~1 ~

Note its ..4 instead of ..2, since ..2 is literally the block the firework is inside of. ..1 is most likely the exact position the firework is in and ..3 is 1 block away that block.
1
08/04/2019 5:26 am
Level 1 : New Miner
Turicagamer
Turicagamer's Avatar
Thanks, but it still doesn't work, when I put the two dots on the other side (4..) it works when I'm 2 blocks away, but with the two dots in front (..4) nothing happens.


Another problem is that it teleports me 1 block above the command block rather than above myself. (It did this before too)
2
08/04/2019 6:44 am
Level 52 : Grandmaster Blob
HoboMaggot
HoboMaggot's Avatar
i forgot at @s. So the command should be /execute as @a at @s if entity @e[type=firework_rocket,distance=..4] run tp @s ~ ~1 ~
1
08/05/2019 5:08 am
Level 1 : New Miner
Turicagamer
Turicagamer's Avatar
It works! Thanks a lot :)
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome