Although after some trouble I had I noticed a mistake. The opposite diagonal corner (dx, dy, dz) doesn't use the world coords but the distance it has in number of blocks from the corner of origin (x, y, z). So, if the opposite corner is 8 blocks from the «x», then «dx» is 8 or -8.
I've been trying to figure out how to use this in command blocks. and im very frustrated at how little or how unusable the information is online. does this work still? does it work in a command block on JAVA? do i include the "x=" notation? or do i just put the coords? and does *anyone anywhere* have a stinkin tutorial to learn to use the coding language used in the command blocks. the wiki is useless. i could see that list with /help. it offers no help on how to actually use the commands.
if i name my command "awesomecommand1" how do i define the command? do i do it in those quotes where it says "command" ? or can i line up another command block to trigger if a player is in this area? im so lost. I wont it to do 2 things, trigger a chain of command blocks, AND post in chat a dialogue preferably in another color.
I've been trying to figure out how to use this in command blocks. and im very frustrated at how little or how unusable the information is online. does this work still? does it work in a command block on JAVA? do i include the "x=" notation? or do i just put the coords? and does *anyone anywhere* have a stinkin tutorial to learn to use the coding language used in the command blocks. the wiki is useless. i could see that list with /help. it offers no help on how to actually use the commands.
It still works on a cmd block.
x is the current x coord you're at; dx is the distance you want to check from the x coord in that specific plane. So the radius of the selection in the x plane would be x + dx, and vice versa for others
If you dont know all of the commands, you can use a instead. Like all other programming language documentation, it can be pretty rough if you dont know what you're looking for.
if i name my command "awesomecommand1" how do i define the command? do i do it in those quotes where it says "command" ? or can i line up another command block to trigger if a player is in this area? im so lost. I wont it to do 2 things, trigger a chain of command blocks, AND post in chat a dialogue preferably in another color.
You cant name your commands wdym by that? Are you talking about functions?
You use predefined functions (/give, /summon etc) to do stuff in minecraft.
Each command block can only have 1 function/command in it
If you want to know which player has left the area, you can add a tag to all players who are in the area, and check every tick if they still are in :
add tag if player is in the area :
/tag @a[x=10,y=10,z=60,dx=20,dy=20,dz=70] add in_area
detect if the player has left the area :
/execute as @a[tag=in_area] unless entity @s[x=10,y=10,z=60,dx=20,dy=20,dz=70] run say "not in area"
and don't forget to detag players who are not in the area :
/execute as @a[tag=in_area] unless entity @s[x=10,y=10,z=60,dx=20,dy=20,dz=70] run tag @s remove in_area
I want to know how to detect when a player enters into an area like the purple zone in the attached image.
Get the coords from one bottom-corner (x,y,z) and from the diagonal opposite corner (dx,dy,dz) and use
/execute if @p[x=10,y=10,z=60,dx=20,dy=20,dz=70] run "command"
>> Link to Curseforge <<
Thanks! It helped. <3
Although after some trouble I had I noticed a mistake. The opposite diagonal corner (dx, dy, dz) doesn't use the world coords but the distance it has in number of blocks from the corner of origin (x, y, z). So, if the opposite corner is 8 blocks from the «x», then «dx» is 8 or -8.
I've been trying to figure out how to use this in command blocks. and im very frustrated at how little or how unusable the information is online. does this work still? does it work in a command block on JAVA? do i include the "x=" notation? or do i just put the coords? and does *anyone anywhere* have a stinkin tutorial to learn to use the coding language used in the command blocks. the wiki is useless. i could see that list with /help. it offers no help on how to actually use the commands.
if i name my command "awesomecommand1" how do i define the command? do i do it in those quotes where it says "command" ? or can i line up another command block to trigger if a player is in this area? im so lost. I wont it to do 2 things, trigger a chain of command blocks, AND post in chat a dialogue preferably in another color.
It still works on a cmd block.
x is the current x coord you're at; dx is the distance you want to check from the x coord in that specific plane. So the radius of the selection in the x plane would be x + dx, and vice versa for others
If you dont know all of the commands, you can use a instead. Like all other programming language documentation, it can be pretty rough if you dont know what you're looking for.
You cant name your commands wdym by that? Are you talking about functions?
You use predefined functions (/give, /summon etc) to do stuff in minecraft.
Each command block can only have 1 function/command in it
thank you so much! i've figured out so much trying to set this up...
can i ask an additional question?
is there a way to reverse this? to detect when players have LEFT an area?
If you want to know which player has left the area, you can add a tag to all players who are in the area, and check every tick if they still are in :
I like trains... OF CHAIN COMMAND BLOCKS !
thanks so much for the help!