1
Make entities teleport you with a command
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 :)
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 :)
Create an account or sign in to comment.
4
1
/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.
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
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
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
It works! Thanks a lot :)