Is there an easy way to set a score only for mobs that do not have that score initialized yet?
Say I wanted to give every mob of some type a score of 20 for "Points", but to only set it if the mob hasn't had it set yet.
Since I can't use @e[score_Points=0] as the target selector (the score "Points" doesn't exist for the uninitialized mobs), I was hoping something like @e[score_Points=null] existed for these situations.
The Meaning of Life, the Universe, and Everything.
Join Date:
9/17/2015
Posts:
475
Member Details
I would recommend to use tags in this case. If it has to be a score, you could probably set the score of mobs, who don't have a specific tag, to 20 and in the same tick add the tag to them.
/scoreboard players set @e[type=Zombie,tag=!processed] Points 20
/scoreboard players tag @e[type=Zombie,tag=!processed] add processed
Is there an easy way to set a score only for mobs that do not have that score initialized yet?
Say I wanted to give every mob of some type a score of 20 for "Points", but to only set it if the mob hasn't had it set yet.
Since I can't use @e[score_Points=0] as the target selector (the score "Points" doesn't exist for the uninitialized mobs), I was hoping something like @e[score_Points=null] existed for these situations.
Thoughts?
I would recommend to use tags in this case. If it has to be a score, you could probably set the score of mobs, who don't have a specific tag, to 20 and in the same tick add the tag to them.
My projects: https://blockbench.net/hub
Those are both really good ideas, thanks!