public static interface DestructEntityEvent.Death extends DestructEntityEvent, TargetLivingEvent, Cancellable
DestructEntityEventwhere the removal of the
TargetLivingEvent.getTargetEntity(), is due to it losing its health.
Note that cancelling this event will have the implication that the entity will have restored health and not enter a "death" state to play a dying animation, drop items, and drop experience. It is highly encouraged to keep the cancellation of this event at a mimium as in modded environments, cancelling this event may have other implications that mods may not consider and cause bugs.
|Modifier and Type||Method and Description|
Returns whether the inventory is kept after death.
getChannel, getOriginalChannel, setChannel
clearMessage, getFormatter, getMessage, getOriginalMessage, isMessageCancelled, setMessage, setMessage, setMessage, setMessageCancelled
void setKeepInventory(boolean keepInventory)
DefaultGameRules.KEEP_INVENTORYgamerule to this entity alone.
This only works for players
keepInventory- Whether to keep the inventory on death
By default this is the same as the