2
Redstone Trouble
Wondering if anyone could help me with this, I’m making a map and I have some checkpoint buttons that are detected by a repeating command block hidden in the earth below. When the button is clicked the command block sets the player’s spawnpoint. The problem is the commands repeat until the button resets itself. I don’t really care about the checkpoint commands repeating, but I have a message I want to display whenever players click the button, but the message repeats too. So how can I make it so the message is only sent once and not repeated like the spawnpoint command?
Create an account or sign in to comment.
4
1
The thing is the most of the spawnpoint buttons are on platforms in the sky, and I’d rather not make the platforms bulky to accommodate for covering up unsightly command blocks, and I wasn’t sure if there was a way you could just make certain command blocks activate once.
2
Use functions, they were meant for this. You'll have 1 command block which triggers the function which in its turn will perform all the commands.
(edit)
A little more elaboration. For example:
spawnpoint @s[tag=!step1]
scoreboard players tag add @s step1
Add this to a function, then let your command block call this function. It won't matter how many times it'll be triggered because it will only run once thanks to the tag in the scoreboard.
Keep in mind you can't just use /function though. In the command block you'll need this:
/execute @p ~ ~ ~ function mystuff:spawnpoint1
This will make the player entity run the function which ensures that the whole thing works. Keep in mind that the example above assumes you've created data\functions\mystuff and added a file called spawnpoint1.mcfunction with the commands I mentioned earlier.
(edit)
A little more elaboration. For example:
spawnpoint @s[tag=!step1]
scoreboard players tag add @s step1
Add this to a function, then let your command block call this function. It won't matter how many times it'll be triggered because it will only run once thanks to the tag in the scoreboard.
Keep in mind you can't just use /function though. In the command block you'll need this:
/execute @p ~ ~ ~ function mystuff:spawnpoint1
This will make the player entity run the function which ensures that the whole thing works. Keep in mind that the example above assumes you've created data\functions\mystuff and added a file called spawnpoint1.mcfunction with the commands I mentioned earlier.
2
You can achieve this by simply putting a commandblock at every checkpoint that sets a redstone block right next to the command block to set the spawn, within the chain of displaying the message you simply remove the redstone block again and voilà :)
2
Why use a repeating command block in the first place? Just make it a default impulse one for the spawnpoint command and then add chain command blocks (chain, unconditional and always active) to perform the message.
That will ensure that this will only run once.
That will ensure that this will only run once.