1

Setting scoreboard trick?

hokage3211's Avatar hokage321112/23/14 11:07 pm
1 emeralds 492 7
12/26/2014 9:09 am
Jmal116's Avatar Jmal116
So, if you make a scoreboard objective that is a dummy objective, the number for all mobs is not set, not even to 0, so therefor any commands to add or remove wouldn't work. Does anyone know a way to set a mob's objective to 0, if a number has NOT been set for the mob? This way you don't disturb the scores of other mobs previously set? I think if this get's figured out then it might be usefull to run on any adventure map that spawns mobs as they go?
Posted by hokage3211's Avatar
hokage3211
Level 49 : Master Engineer
39

Create an account or sign in to comment.

7

1
12/26/2014 9:09 am
Level 33 : Artisan Engineer
Jmal116
Jmal116's Avatar
I'm glad to be able to help After all, sometimes like this I actually learn something new myself.
1
12/25/2014 8:39 pm
Level 49 : Master Engineer
hokage3211
hokage3211's Avatar
Jmal116I just had a thought. Why not just run the command /scoreboard players add @e *objective* 0 on a fill clock? This wouldn't interfere with any existing scores, and it would cause any and all mobs to be tracked on the scoreboard.


Thank you so much for that, that actually solved it, very good idea! And nice to see you actively patrol the forums to help people.
1
12/25/2014 5:06 pm
Level 33 : Artisan Engineer
Jmal116
Jmal116's Avatar
hokage3211
While that does work, adding is a very finicky thing because doing that will add and if you want to test for one score, it will become finicky. Every way I try to think it might work, it doesn't in the end because I would need to say "add one IF it is less than this number, and there technically is no number so it will never set it, and I know that last part will work, I'm just challenging myself to make a better way.

I just had a thought. Why not just run the command /scoreboard players add @e *objective* 0 on a fill clock? This wouldn't interfere with any existing scores, and it would cause any and all mobs to be tracked on the scoreboard.
1
12/24/2014 1:19 pm
Level 2 : Apprentice Crafter
maxawsomemods
maxawsomemods's Avatar
this should work /scoreboard @e [/kill]
1
12/24/2014 12:46 pm
Level 33 : Artisan Engineer
Jmal116
Jmal116's Avatar
Actually, the add, set, and remove commands all work even if a score for that player is not tracked. For instance, if you run the command /scoreboard players add @a *objective 1 and you don't have a score on that objective, then you will still get a score of 1.

If you want to use the operations (+=, -=, etc.) then you will have to set a score of 0 so that the entity is tracked, but this can be done simply by running the command /scoreboard players set @e *objective* 0 on the entity as soon as it spawns.
1
12/24/2014 12:49 am
Level 55 : Grandmaster Dragon
Skitto493
Skitto493's Avatar
/scoreboard players set @e[score_X=0] X 0

Maybe that would work. Interesting problem I've never encountered before.

Another solution - Instead of looking for mobs with a scoreboard of 0, search for mobs with a value greater than 0.
1
12/24/2014 5:42 pm
Level 49 : Master Engineer
hokage3211
hokage3211's Avatar
That doesn't work

Jmal116Actually, the add, set, and remove commands all work even if a score for that player is not tracked. For instance, if you run the command /scoreboard players add @a *objective 1 and you don't have a score on that objective, then you will still get a score of 1.

If you want to use the operations (+=, -=, etc.) then you will have to set a score of 0 so that the entity is tracked, but this can be done simply by running the command /scoreboard players set @e *objective* 0 on the entity as soon as it spawns.


While that does work, adding is a very finicky thing because doing that will add and if you want to test for one score, it will become finicky. Every way I try to think it might work, it doesn't in the end because I would need to say "add one IF it is less than this number, and there technically is no number so it will never set it, and I know that last part will work, I'm just challenging myself to make a better way.

maxawsomemodsthis should work /scoreboard @e [/kill]


I'm not even sure what you are trying to do with that, that's not even a thing?
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome