Interface IDeathMessageProvider
public interface IDeathMessageProvider
An
This allows providing custom death messages based on the available parameters, instead of the hard-coded vanilla defaults.
IDeathMessageProvider
is used by custom DeathMessageType
instances.This allows providing custom death messages based on the available parameters, instead of the hard-coded vanilla defaults.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final IDeathMessageProvider
Default death message provider used by the vanillaDeathMessageType
s. -
Method Summary
Modifier and TypeMethodDescriptiongetDeathMessage
(LivingEntity entity, CombatEntry lastEntry, @Nullable CombatEntry mostSignificantFall) Computes the death message from the available context.
This method is not invoked if there are no available combat entries, since the damage source would not be available.
-
Field Details
-
DEFAULT
Default death message provider used by the vanillaDeathMessageType
s.
-
-
Method Details
-
getDeathMessage
Component getDeathMessage(LivingEntity entity, CombatEntry lastEntry, @Nullable @Nullable CombatEntry mostSignificantFall) Computes the death message from the available context.
This method is not invoked if there are no available combat entries, since the damage source would not be available.- Parameters:
entity
- The entity being killed.lastEntry
- The last entry from the entity'sCombatTracker
mostSignificantFall
- The most significant fall inflicted to the entity, fromCombatTracker.getMostSignificantFall()
.- Returns:
- The death message for the slain entity.
-