execute store result score #TAGGED nb_tagged_tmp run execute if entity @e[tag=your_tag]
execute if score #TAGGED nb_tagged_tmp < #TAGGED nb_tagged run say "tagged dead"
scoreboard players operation #TAGGED nb_tagged = #TAGGED nb_tagged_tmp
The first command count how many entity has the tag "your_tag" and store it in nb_tagged_tmp score
Then it compares it with nb_tagged score, which is how many tagged entity you had one tick earlier. If the score is lower, then you have a dead tagged entity
and finally you put nb_tagged_tmp in nb_tagged for the next tick.
First command block in repeat always active unconditional and the rest in chain unconditional always active.
Hey everyone! i'm trying to figure out a way to detect if an enemy with a tag is dead and add 1 to a scoreboard.
If there is more than 1, you cannot.
You would have to use a passenger on the tagged mob and as the passenger detect if the mob it is on is missing to call it dead
The first command count how many entity has the tag "your_tag" and store it in nb_tagged_tmp score
Then it compares it with nb_tagged score, which is how many tagged entity you had one tick earlier. If the score is lower, then you have a dead tagged entity
and finally you put nb_tagged_tmp in nb_tagged for the next tick.
First command block in repeat always active unconditional and the rest in chain unconditional always active.
you have to create the scoreboard with :
I like trains... OF CHAIN COMMAND BLOCKS !
yeah that's fine, i was creating a sort of event where only one boss spawns from it at a time
i'm doing this in a datapack