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

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!"
  • unless doesn't already stop if it finds one entity? What's the reason for that? Just a missing feature? – Fabian Röling Jul 20 '18 at 6:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.