1
Hi, i want to set a block relative to a players coordinates can you tell me if this is possible and if so how i can do it
Thanks in advance
Imad_Bush
Thanks in advance
Imad_Bush
Create an account or sign in to comment.
5
1
Just have a bunch of redstone blocks beneath the ground and whenever you do something,a bunch of command blocks place activator rails on those blocks then remove it.In that room beneath the ground,have an angry pigman with a commandblock minecart stacked on it with the /setblock command
1
Imad_bushHi, i want to set a block relative to a players coordinates can you tell me if this is possible and if so how i can do it
Thanks in advance
Imad_Bush
Alas, this is not possible. Yet. Or at least its not possible easily.
The only way to set something relative to the player is by using /tellraw, but that requires a player to click a link in the chat.
/tellraw @a {"text":"Spawn a block? ", "extra":[{"text":"[Yes]",color:"green","clickEvent":{"action":"run_command","value":"/setblock ~ ~ ~ minecraft:stone"}}]}
Copy and paste that into a command block and power it. When a player clicks [Yes] in chat, it will spawn a stone block at their feet.
See, not easy. Hopefully Mojang adds support for @p or @a as coordinates.
1
Using the ~ you can set things with coordinates relatively, maybe try
/setblock 3 @p ~0 ~-1 ~0 (this should put the block beneath you, though I haven't tested it and it might only put the block 1 below the command block location, plus I might have the syntax order the wrong way)
Also this command only exists in snapshots of 1.7 as of now
/setblock 3 @p ~0 ~-1 ~0 (this should put the block beneath you, though I haven't tested it and it might only put the block 1 below the command block location, plus I might have the syntax order the wrong way)
Also this command only exists in snapshots of 1.7 as of now
1
write /spawnpoint [playername or @] [X Y Z Coordinates]
1
Bump