How can I play a message if a command block isn't activated?
I am making a class system and I want a message to be played when the class fails to be unlocked (a command block wasn't activated after a specific input). After the sequence plays, I want to use a /say command to tell the player that the class wasn't unlocked.
Best Answer
It requires a redstone signal but I have commands for it. Just levels though I'm still getting scoreboard. You need 2 different command blocks at the front before any others (Only if you make it cost an amount)
Command 1: /tellraw @p[lm=(Level Required *Or Higher*)]
Command 2: /tellraw @p[l=(Level if too high)]
Pictures about "How can I play a message if a command block isn't activated?"



How do you wait for a command block to activate?
You may find that the commands you are trying to have the command block execute are not working. This may be due to the certain limitations the block has on what commands it can run successfully. Command Blocks will execute commands with an OP level 2 permissions.How do you make a command block welcome message?
Steps to Use a Command BlockHow To Make Command Blocks Say Custom Words [On Screen AND in Chat!]
More answers regarding how can I play a message if a command block isn't activated?
Answer 2
OK, lets say you press a button to get the class. The button powers some restone. One branch leads to the command block, that gives you, say, an iron chestplate, if you have over 5 levels of xp:/give @p minecraft:iron_chestplate[lm=5] Now, the second branch takes away the xp:/xp -5l[lm=5] Now, put a comporator facing out of the command block that gives you the chest plate. The comporator powers more redstone. Now, lets visit the third branch of restone. It leads to a command block that tells you it wasn't a succes:/tellraw @p text:"" You did not have enough xp. Make sure that this third branch has, say, 3 reapeters at full ticks. Now, lets visit the first and second line. They don't have any restone repeaters. They lead to a piston that somehow disrupts the third restone wire(I will leave that up to you, so it is of conveniance) You must time it so if the person has enough xp, the wire leading from the kit command blocks will push a piston or whatever, disrupting the restone signal, then the other restone signal comes through, going for the /tellraw command block, hits the piston, is stopped, and then the piston retracts. I know this will work, but all the text way be a bit scatterbrained! I hope this works for you!
Answer 3
If you have a comparator outputting from said command block if will toggle on or off, depending on if the command block outputted sucessfully.If that is connected to a block with a redstone torch on it, then it will invert the signal. This signal can be sent to another command block that can display your message.
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Matthias Groeneveld, Kelly, Tatiana Syrikova, Matthias Groeneveld
