Is there a way to make an action trigger on an enemy's death?

Let's say I have an enemy that's prone to exploding. When he reaches 0 HP, but before he fades from the battle field, I want him to use his special skill "Explode" which damages the player's party.

Is there a way to accomplish this without resorting to plugins?

Alternatively, is there already a plugin for this? (Remember this needs to be on a per-enemy basis)
There totally is a way to do this for events, but it isn't defined in the enemies tab in the database.

If you go into the database and check out the troop tab, you can set a battle event to fire once a specific enemy's HP goes to 0%. However, if you set this up for each enemy and you kill the last enemy in the troop, the event associated with that enemy will not fire.

Also, if you want to do this for an attack like I described above, it seems that you're out of luck and need a plugin. Enemies will not act when reduced to 0 HP.
For the last enemy problem, see if this helps: End Phse Triggers


You should be able to just insert that into your project and your events will automatically work even if it's the last enemy.


Note that "last enemy" doesn't mean when there's only one left. If you have 6 of these exploding enemies, if you kill them all at the same time, none of them will explode.
For the last enemy problem, see if this helps: End Phse Triggers

You should be able to just insert that into your project and your events will automatically work even if it's the last enemy.

Note that "last enemy" doesn't mean when there's only one left. If you have 6 of these exploding enemies, if you kill them all at the same time, none of them will explode.
That does solve it, thanks! I was just coming back here to post that Yanfly's Battle Engine Core fixes that bug as well, but it's nice to have it in a plugin that doesn't change a whole bunch of other stuff as well.

It looks like I still can't force an enemy at 0 HP to attack (looks like the enemy dies and is removed before the event forcing it to attack can run), but at least I can run events!

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-way-to-make-an-action-trigger-on-an-enemys-death.48908/