how can i detect if a group of mobs are dead

Started by ilikepotatos_ on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how can i detect if a group of mobs are dead

i want to make a system similar to raids in the vanilla game where a group of mobs is spawned, you have to kill all thoose mobs. and after they are all dead more mobs will spawn

thing is i cant seem to figure out how to do this, i tried checking mobs of a certain type existed in a cube around the area of the raid but couldnt get it set up properly because i have to check every few seconds untill all mobs are killed, and i couldnt figure out how to check without re-running the entire script

Joined Apr 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Another probably…
Mon, 02/02/2026 - 20:57

Another probably overcomplicated way (although choosing between me and the guy who literally made this modding tool seems pretty easy XD) is what I just dubbed a few second ago, IEHBR (pronounced I-ber) Invisible Enitity Hoard Battle Procedure. So here is the gist. your custom entities (if you have custom entities) are set to damage an invisible entity that spawns with them by x damage when one of them dies. Not only would this allow you to have a health bar for the hoard battle, you could also just do "when [invisible entity] dies, spawn next wave" and you could have a different invisible entity with each wave to very health and the intensity of the next wave.