Skip to main content

onDestroy

This event is triggered when an entity is destroyed.

Parameters

NameTypeDescription
entityEntityManagerThe entity that was destroyed.

Example

engine.players.events.on('onDestroy', player => {
console.log('A player has been destroyed with id: ' + player.id);
});

Available on: Client Server