Anyways, are you actually targetting a block that a player cannot stand on? Cuz it's easier to give a solution when I know the scenario.
Also, a few things:
1. Is this singleplayer or multiplayer?
2.If you want people to get scores when not in range, something like this looks more logical: /execute as @a unless entity @s[x=4,y=43,z=-7,dx=0,dy=0,dz=1.3] run scoreboard players add @s test2 1
I have this sign on the wall that says, r-click to start. So when players are near it AND facing north, they'll be able to r-click. I didn't include the facing directions, but they are in the actual command that I'm going to use.
I have this sign on the wall that says, r-click to start. So when players are near it AND facing north, they'll be able to r-click. I didn't include the facing directions, but they are in the actual command that I'm going to use.
So... I'll just ignore your original question and do what you say here.
execute as @a[x=4.5,y=43,z=-7.5,distance=..1,y_rotation=-100..100] at @s if block ~ ~1 ~ minecraft:wall_sign run scoreboard players add @s test2 1
Is this what you wanted? To include the case of somebody sticking to the sign and go to the very edge of the block, I personally tested the angle to ensure nobody's exploiting the code. 100..-100 is for the edge of the sign facing south (player facing north).
And yes. In your case, you don't rly need the volume. Cuz the fact that you're testing for a sign means that it's already a 1-block volume detection.
Oh the sign isn't an actual sign. It's going to be a model, so I do need the volume.
Sorry it took so much time.
/execute as @a[x=3.5,y=70,z=-8.5,dx=0.2,dz=0.2] if entity @s[x=4.3,y=70,z=-7.7,dy=0] run scoreboard players add @s test2 1
If you can stand on the block at 4.5 70 -7.5, that's the block I'm targeting.
Why is this so complicated? In short, dx,dy,dz sucks. I have to merge 2 regions to get the desired result.
Sadly, because of this, you need an extra command to add the score when somebody is NOT standing inside the block. Cuz if I change to /execute unless, it won't work.
Example command:
/execute as @a[x=3.5,y=70,z=-8.5,dx=0.2,dz=0.2] if entity @s[x=4.3,y=70,z=-7.7,dy=0] run tag @s add inside
/execute as @a[tag=!inside] run scoreboard players add @s test2 1
Ok I just want to know if these commands are safe for multiplayer:
First Command:
execute as @a if entity @s[x=4,y=43,z=-7,dx=0,dy=0,dz=1.3,y_rotation=150..-150] run replaceitem entity @s weapon.offhand minecraft:carrot_on_a_stick{display:{Name:"{\"text\":\"r-click\"}"}} 1
Second Command:
execute as @a unless entity @s[x=4,y=43,z=-7,dx=0,dy=0,dz=1.3,y_rotation=150..-150] run clear @s minecraft:carrot_on_a_stick{display:{Name:"{\"text\":\"r-click\"}"}} 1
Ok I just want to know if these commands are safe for multiplayer:
First Command:
execute as @a if entity @s[x=4,y=43,z=-7,dx=0,dy=0,dz=1.3,y_rotation=150..-150] run replaceitem entity @s weapon.offhand minecraft:carrot_on_a_stick{display:{Name:"{\"text\":\"r-click\"}"}} 1
Second Command:
execute as @a unless entity @s[x=4,y=43,z=-7,dx=0,dy=0,dz=1.3,y_rotation=150..-150] run clear @s minecraft:carrot_on_a_stick{display:{Name:"{\"text\":\"r-click\"}"}} 1
The solution is probably right in front of my face, but I'll post on here anyways.
I want to increase a score if the player is not in within this 'dz' value. I know how to do it with radius, but not sure with volume.
What's the range of z you need to detect?
From z:-7 to z:-6.7? Or z:-7 to z:-8.3?
From z:-7 to z:-6.7
Sorry, I mean z:-5.7.
Anyways, are you actually targetting a block that a player cannot stand on? Cuz it's easier to give a solution when I know the scenario.
Also, a few things:
1. Is this singleplayer or multiplayer?
2.If you want people to get scores when not in range, something like this looks more logical:
/execute as @a unless entity @s[x=4,y=43,z=-7,dx=0,dy=0,dz=1.3] run scoreboard players add @s test2 1
I totally forgot about 'unless'. Yes I'm targeting a block that players cannot stand on. And yes this is for multiplayer.
So the command you provided is more logical for multiplayer?
My command provided is close. Is that block unique in your map? (i.e. is there only 1 special block (e.g. diamond block) in the map?)
I have this sign on the wall that says, r-click to start. So when players are near it AND facing north, they'll be able to r-click. I didn't include the facing directions, but they are in the actual command that I'm going to use.
So... I'll just ignore your original question and do what you say here.
execute as @a[x=4.5,y=43,z=-7.5,distance=..1,y_rotation=-100..100] at @s if block ~ ~1 ~ minecraft:wall_sign run scoreboard players add @s test2 1
Is this what you wanted? To include the case of somebody sticking to the sign and go to the very edge of the block, I personally tested the angle to ensure nobody's exploiting the code. 100..-100 is for the edge of the sign facing south (player facing north).
And yes. In your case, you don't rly need the volume. Cuz the fact that you're testing for a sign means that it's already a 1-block volume detection.
Oh the sign isn't an actual sign. It's going to be a model, so I do need the volume.
Sorry it took so much time.
/execute as @a[x=3.5,y=70,z=-8.5,dx=0.2,dz=0.2] if entity @s[x=4.3,y=70,z=-7.7,dy=0] run scoreboard players add @s test2 1
If you can stand on the block at 4.5 70 -7.5, that's the block I'm targeting.
Why is this so complicated? In short, dx,dy,dz sucks. I have to merge 2 regions to get the desired result.
Sadly, because of this, you need an extra command to add the score when somebody is NOT standing inside the block. Cuz if I change to /execute unless, it won't work.
Example command:
/execute as @a[x=3.5,y=70,z=-8.5,dx=0.2,dz=0.2] if entity @s[x=4.3,y=70,z=-7.7,dy=0] run tag @s add inside
/execute as @a[tag=!inside] run scoreboard players add @s test2 1
/tag @a remove inside
Ok I just want to know if these commands are safe for multiplayer:
First Command:
Second Command:
It's safe.
Awesome. Thanks for the help.