home Forumsplay_arrow Minecraft fiber_manual_record Help


How to use "/testfor" to detect an object score?

1 emerald1 reply49 views
created 06/13/2018 6:55 am by ItzWingWing04199
last reply 06/13/2018 8:31 am
Recently, I want to make a scoreboard timer. But at the part of detecting score, it did anything. I type it like this:

/testfor @e[score_MMTimer=0,score_MMTimer_min=0,r=50]

(There is a invisible armor stand for the detecting command.)

Than, the output came out nothing. Can someone teach me how to do it?
Posted by avatar
Level 1 : New Miner

1 reply

06/13/2018 8:31 am
Level 4 Apprentice Engineer
Here's what I think your problem is. However, I don't have enough information to be sure.

I think your problem might be that you named your armor stand and then tried changing it's score by it's name instead of it's entity selector. Here's the issue with that though: the score wouldn't belong to the armor stand. It would belong to the player with the username you are trying to use, even if they have never joined the world and/or don't even exist. You should instead be using these "dummy players" without related armor stands.

That spoiler should explain what your problem is, but even if I guessed wrong on that then this should help you.

-First of all, the "testfor" command is not the proper way to detect scoreboard scores. Instead, you can use the command "/scoreboard players test <target> <objective> <min> <max>" to test within a range. Example: /scoreboard players test @p points 1 5 determines whether the player running it has between 1 and 5 points.

-Second, as mentioned in the spoiler, you do not need physical entities for scoreboard dummies, unless you need the physical location of the dummy to be able to move. Since you rarely need that, go ahead and use nonexistent players as scoreboard dummies.

commands for a timer, click to reveal
Here's the commands for a 30 second timer that uses the scoreboard objective "timer" and the dummy player "timerdummy":

/scoreboard player set timerdummy timer 600

/scoreboard players remove timerdummy timer 1
/scoreboard players test timerdummy timer 0 0
/say timer is up (conditional command block)




© 2010 - 2018