Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

How can I detect the death of a mob in Minecraft version 1.16?

Writer Matthew Harrington

In Minecraft, I am making a custom adventure map and there is an Evoker bossfight named "Lunatic Cultist". I wanted to check when it died, but none of the tutorials I found actually worked (probably because they are outdated).

How can I check when the Lunatic Cultist dies?

2 Answers

Give your boss a custom loot table, using the DeathLootTable NBT tag, that drops a special item (potentially with custom NBT tags, like lore, so that it cannot be counterfeited). Then make the next part of your map contingent on the player surrendering that item (use an item sorter to check that they have in fact surrendered the correct item).

I don't remember if the deaths scoreboard works for entities other than players. If it does work try that. If that doesn't work try using

execute as @e[boss selector goes her] at @s store result score 'i forgot the syntax for store in execute' run tp @s ~ ~ ~ 

and if the score is = 0 then the boss is dead. The following video shows you how to count entities. His method may be better.

I hope this helps.