1

Testfor command blocks

SpartanPride7 2/20/18 11:04 am
306
2/25/2018 6:43 pm
Hey, I have a question about testfor command blocks.


I currently have one that detects players in a certain scoreboard group. If the testfor is true, I want it to say a certain message that I already have planned out, and if the testfor is false I would like it to say a different msg.


How would I go about making it so it can say two different messages based on it being true or false?

Thanks
Posted by
SpartanPride7
Level 1 : New Miner
2

  Have something to say?

JoinSign in

7

SpartanPride7
02/25/2018 6:43 pm
Level 1 : New Miner
If anyone knows an answer, let me know!
1
SpartanPride7
02/21/2018 6:03 pm
Level 1 : New Miner
Anyone able to help?
1
SpartanPride7
02/21/2018 12:01 pm
Level 1 : New Miner
history
It seems I should provide a little more information :). Here is the commands I need to be hooked up on a true/false basis:

/testfor @a[score_PlayerHelper_min=1]

if the test for is true, I need this command block to run:
/tellraw @a[r=30] ["",{"text":"Server: ","color":"gold","bold":true},{"text":"If you need help getting started, ","color":"gray","bold":false},{"selector":"@ascore_PlayerHelper_min=1]","color":"gold"},{"text":" is a player helper. I will let them know you need some help getting started!","color":"gray"}]

and if it is false, this command blocks needs to run:
/tellraw @p ["",{"text":"Server: ","color":"gold","bold":true},{"text":"There are no player helpers online at the moment :(. Try to see if ","color":"gray","bold":false},{"text":"/warp helphub or /faq","color":"gold"},{"text":"can answer your questions! :D","color":"gray"}]

[p]So, now I just need one of the two messages to run if the testfor is true or false.[/p]
1
ShelLuser
02/20/2018 3:29 pm
Level 61 : High Grandmaster System
You can negate tests with =!

So: /tell @a[team=!red] Let's destroy those red teamers!

This would sent out a message to all players except those within the red team.
1
SpartanPride7
02/20/2018 2:22 pm
Level 1 : New Miner
Yes, that is exactly what I want it to do; different messages based on true or false. I'm not sure how to do two different outputs, can you possibly show me?
1
BartTheBart
02/20/2018 12:43 pm
Level 9 : Apprentice System
Depends if you want it to be multiplayer compatible.
if you do then try something like this:
/tell @a[score_example_min=1] hello there friend, this is an example massage.
1
Isz
02/20/2018 11:38 am
Level 48 : Master Architect
you could have two outputs and invert one of them. But this all depends on how these messages will be displayed. Is it just saying it once in chat when it detects a player then as soon as it detects no players it says the other message just once?
1

Welcome