on Mob Killed

Run some code when a certain kind of creature is killed.

mobs.onMobKilled(CHICKEN, () => {

});

Parameters

  • mob: the type of creature
  • handler: the code you want to run when a creature you chose in mob is killed

Example

Display a warning message when a chicken dies.

mobs.onMobKilled(CHICKEN, () => {
    player.say("Be nice to the chickens! Baaack!")
})

See also

||mobs:kill||