2

Redstone Trouble

DragonBlaze__'s Avatar DragonBlaze__2/17/18 9:18 am
2 emeralds 162 4
2/17/2018 12:44 pm
ShelLuser's Avatar ShelLuser
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?
Posted by DragonBlaze__'s Avatar
DragonBlaze__
Level 3 : Apprentice Explorer
5

Create an account or sign in to comment.

4

1
02/17/2018 9:34 am
Level 3 : Apprentice Explorer
DragonBlaze__
DragonBlaze__'s Avatar
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
02/17/2018 12:44 pmhistory
Level 57 : Grandmaster Engineer
ShelLuser
ShelLuser's Avatar
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.
2
02/17/2018 12:16 pmhistory
Level 2 : Apprentice Architect
Th4tM0nk3y
Th4tM0nk3y's Avatar
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
02/17/2018 9:26 am
Level 57 : Grandmaster Engineer
ShelLuser
ShelLuser's Avatar
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.
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome