0

My 1.12 solution can be found here. When trying to update command blocks to 1.13, I have the following:

scoreboard objectives add invert dummy

(run at start) then:

scoreboard players set FakePlayer invert 1

(impulse unconditional repeat) chained into:

execute at @e[tag=summoned] run scoreboard players reset FakePlayer invert

(chain unconditional repeat) chained into:

execute if score FakePlayer invert = 1 invert run say "All summoned animals are dead!"

This should reset FakePlayers score continuously until all entities with tag "summoned" are dead, then it should run the final condition. This does not happen, and I can't see why.

1 Answer 1

2

There's a much easier way to do this in 1.13, thanks to the unless execute subcommand. The following should work:

execute unless entity @e[tag=summoned] run say "All summoned animals are dead!"

For performance, including a limit=1 will let it stop searching as soon as it finds one entity that matches:

execute unless entity @e[tag=summoned,limit=1] run say "All summoned animals are dead!"
2
  • unless doesn't already stop if it finds one entity? What's the reason for that? Just a missing feature? Jul 20, 2018 at 6:38
  • Because a repeat command block re-runs the command every tick, regardless of previous results I think.
    – Mark Deven
    Mar 19, 2020 at 16:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .