1

Make entities teleport you with a command

Turicagamer 8/3/19 11:08 pm
224
8/5/2019 5:08 am
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
Level 1 : New Miner
0

  Have something to say?

JoinSign in

4

HoboMaggot
08/04/2019 3:32 am
Level 55 : Grandmaster Blob
/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
Turicagamer
08/04/2019 5:26 am
Level 1 : New Miner
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)
1
HoboMaggot
08/04/2019 6:44 am
Level 55 : Grandmaster Blob
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 ~
2
Turicagamer
08/05/2019 5:08 am
Level 1 : New Miner
It works! Thanks a lot :)
1

Welcome