This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
The situation is an amusement park ride.
I have a tall tower
in the center of it is the Command Block
The Command block is at y=74
The minecart with player will be falling 4 blocks away from the CB.
Currently THIS works:
execute as @e if entity @e[limit=1,sort=nearest,type=minecart,x=116,y=74,z=-130,distance=..1] run...
But, it detects both an empty minecart & a player in it.
I am ok with it detecting either player or no player.
The problem...
I need the CB to detect any cart falling 4 blocks away from it.
The working command will only detect a cart falling in that exact spot.
What am I doing wrong?!
Answered my own question For anyone needing this:
execute as @e if entity @e[limit=1,sort=nearest,type=minecart,x=113,y=74,z=-131,dx=10,dy=1,dz=10] run ...
To explain:
limit=1,sort=nearest,type=minecart
looks for a minecart
x=113,y=74,z=-131
starts looking at those coordinates
dx=10,dy=1,dz=10
The important part.
Looks for the minecart, from the prior coordinates, towards Positive X, Positive Z, and only 1 Up from Y
So, it is searching in a 1 block high, 10 x 10 square area.
The situation is an amusement park ride.
I have a tall tower
in the center of it is the Command Block
The Command block is at y=74
The minecart with player will be falling 4 blocks away from the CB.
Currently THIS works:
execute as @e if entity @e[limit=1,sort=nearest,type=minecart,x=116,y=74,z=-130,distance=..1] run...
But, it detects both an empty minecart & a player in it.
I am ok with it detecting either player or no player.
The problem...
I need the CB to detect any cart falling 4 blocks away from it.
The working command will only detect a cart falling in that exact spot.
What am I doing wrong?!
Answered my own question
For anyone needing this:
execute as @e if entity @e[limit=1,sort=nearest,type=minecart,x=113,y=74,z=-131,dx=10,dy=1,dz=10] run ...
To explain:
limit=1,sort=nearest,type=minecart
looks for a minecart
x=113,y=74,z=-131
starts looking at those coordinates
dx=10,dy=1,dz=10
The important part.
Looks for the minecart, from the prior coordinates, towards Positive X, Positive Z, and only 1 Up from Y
So, it is searching in a 1 block high, 10 x 10 square area.