1
Execute for players at y-dy (SOLVED)
So I'm trying to execute a tp command when a player falls below y5 and above y0, but all the other inquiries I've seen online are outdated and I'm not great at getting execute commands to work properly, rip. Any suggestions?
note: I'm using a command block to run the command
note: I'm using a command block to run the command
Create an account or sign in to comment.
6
2
You do something like:
execute at @a as @p[y=0,distance=..5] run CMD
execute at @a as @p[y=0,distance=..5] run CMD
1
works! ty :)
1
the selector should be about this:
execute as @e[type=player,y=0..5] at @s run #command that shall be executed
execute as @e[type=player,y=0..5] at @s run #command that shall be executed
1
y=0..5 gives invalid doubles error, the rest works apart from that though
1
I made something similar, but i used a workaround:
scoreboard players set @s y_pos 0
execute store result score @s y_pos run data get entity @s Pos[1]
execute if score @s y_pos matches 0..5 run #whatever you want to run
this should work definetl.y
scoreboard players set @s y_pos 0
execute store result score @s y_pos run data get entity @s Pos[1]
execute if score @s y_pos matches 0..5 run #whatever you want to run
this should work definetl.y
1
how did you set this up? I can't seem to get it to work either :/