1
Setting scoreboard trick?
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?
Create an account or sign in to comment.
7
1
I'm glad to be able to help After all, sometimes like this I actually learn something new myself.
1
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
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
this should work /scoreboard @e [/kill]
1
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.
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
/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.
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
That doesn't work
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'm not even sure what you are trying to do with that, that's not even a thing?
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?