接口 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.
-
字段概要
字段修饰符和类型字段说明static final IDeathMessageProvider
Default death message provider used by the vanillaDeathMessageType
s. -
方法概要
修饰符和类型方法说明getDeathMessage
(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.
-
字段详细资料
-
DEFAULT
Default death message provider used by the vanillaDeathMessageType
s.- Implementation Note:
- Based off of the implementation in
CombatTracker.getDeathMessage()
.
-
-
方法详细资料
-
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.- 参数:
entity
- The entity being killed.lastEntry
- The last entry from the entity'sCombatTracker
mostSignificantFall
- The most significant fall inflicted to the entity, fromCombatTracker.getMostSignificantFall()
.- 返回:
- The death message for the slain entity.
-