This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
I was new here so don't mad at me if I've done something wrong.
So basically I was trying to make a map in 1.12.2. And I have a problem.
I tried to make a command to detect if a player is standing on a gold block and runs a command which is
/tellraw @p {"text":"Checkpoint!","color":"yellow"}
.
And I did this.
/execute @a ~ ~ ~ detect ~ ~-1 ~ gold_block 0 /tellraw @p {"text":"Checkpoint":"color":"yellow"}
I put this in a repeat command block and set it always active.
Can I do this without spamming it?
Put DoCommandBlockOutput gamerule to false. Type this command:
/gamerule docommandblockoutput false
and it'll stop spamming the message inside the chat.
I think you mean CommandBlockOutput, without the "Do"
My solution works better on a one-player map, as it will send the message to everyone even if only one player makes it to the checkpoint.
Put a Repeating command block set to Always Active and put this command:
/execute @a ~ ~ ~ testforblock ~ ~-1 ~ ~ ~-1 ~ gold_block 0
Then, put a Comparator leading away from the command block, and set an Impulse command block on the other side of the Comparator.
In the Impulse command block, put this command:
/tellraw @a {"text":"Checkpoint!","color":"yellow"}
Again, this will send a message to everyone.
I'm not 100% sure if this will work on Java, but it works on Bedrock.
In the Impulse command block, you can put:
/execute @a ~ ~ ~ detect ~ ~-1 ~ gold_block 0 /tellraw @a {"text":"@p Reached a Checkpoint!","color":"yellow"}
If I'm correct, this should display "[Player Name] Reached a Checkpoint!"
Quote from martinAJM03» My solution works better on a one-player map, as it will send the message to everyone even if only one player makes it to the checkpoint. Put a Repeating command block set to Always Active and put this command: /execute @a ~ ~ ~ testforblock ~ ~-1 ~ ~ ~-1 ~ gold_block 0 Then, put a Comparator leading away from the command block, and set an Impulse command block on the other side of the Comparator. In the Impulse command block, put this command: /tellraw @a {"text":"Checkpoint!","color":"yellow"} Again, this will send a message to everyone. I'm not 100% sure if this will work on Java, but it works on Bedrock. In the Impulse command block, you can put: /execute @a ~ ~ ~ detect ~ ~-1 ~ gold_block 0 /tellraw @a {"text":"@p Reached a Checkpoint!","color":"yellow"} If I'm correct, this should display "[Player Name] Reached a Checkpoint!"
In Java version, it won't say the player name but "@p Reached a Checkpoint!" And thank you for helping me out, I sorted it out earlier.
I was new here so don't mad at me if I've done something wrong.
So basically I was trying to make a map in 1.12.2. And I have a problem.
I tried to make a command to detect if a player is standing on a gold block and runs a command which is
.
And I did this.
I put this in a repeat command block and set it always active.
Can I do this without spamming it?
Put DoCommandBlockOutput gamerule to false. Type this command:
and it'll stop spamming the message inside the chat.
I think you mean CommandBlockOutput, without the "Do"
My solution works better on a one-player map, as it will send the message to everyone even if only one player makes it to the checkpoint.
Put a Repeating command block set to Always Active and put this command:
/execute @a ~ ~ ~ testforblock ~ ~-1 ~ ~ ~-1 ~ gold_block 0
Then, put a Comparator leading away from the command block, and set an Impulse command block on the other side of the Comparator.
In the Impulse command block, put this command:
/tellraw @a {"text":"Checkpoint!","color":"yellow"}
Again, this will send a message to everyone.
I'm not 100% sure if this will work on Java, but it works on Bedrock.
In the Impulse command block, you can put:
/execute @a ~ ~ ~ detect ~ ~-1 ~ gold_block 0 /tellraw @a {"text":"@p Reached a Checkpoint!","color":"yellow"}
If I'm correct, this should display "[Player Name] Reached a Checkpoint!"
In Java version, it won't say the player name but "@p Reached a Checkpoint!" And thank you for helping me out, I sorted it out earlier.