枚举类 DeathMessageType

java.lang.Object
java.lang.Enum<DeathMessageType>
net.minecraft.world.damagesource.DeathMessageType
所有已实现的接口:
Serializable, Comparable<DeathMessageType>, Constable, StringRepresentable, net.neoforged.fml.common.asm.enumextension.IExtensibleEnum

public enum DeathMessageType extends Enum<DeathMessageType> implements StringRepresentable, net.neoforged.fml.common.asm.enumextension.IExtensibleEnum
  • 枚举常量详细资料

  • 字段详细资料

  • 构造器详细资料

    • DeathMessageType

      private DeathMessageType(String p_270201_)
    • DeathMessageType

      private DeathMessageType(String id, IDeathMessageProvider msgFunction)
      Creates a new DeathMessageType with the specified ID and death message provider. Store the created enum in a static final field.

      Use an enumextender.json to link to your EnumProxy in order to create new entries for this enum.

      Example usage:

      public static final EnumProxy<DeathMessageType> CUSTOM_FUNCTION = new EnumProxy<>(
                  DeathMessageType.class,
                  "mymod:custom",
                  MyDeathMessageTypes.CUSTOM_MESSAGE_PROVIDER::value);
      
      参数:
      id - The serialized name. Prefix this with your modid and `:`
      msgFunction - The provider to use for determine when to display the message.
      API Note:
      This method must be called as early as possible, as if CODEC is resolved before this is called, it will be unusable.
  • 方法详细资料

    • values

      public static DeathMessageType[] values()
      返回包含该枚举类的常量的数组, 顺序与声明这些常量的顺序相同
      返回:
      包含该枚举类的常量的数组,顺序与声明这些常量的顺序相同
    • valueOf

      public static DeathMessageType valueOf(String name)
      返回带有指定名称的该类的枚举常量。 字符串必须与用于声明该类的枚举常量的 标识符完全匹配。(不允许有多余 的空格字符。)
      参数:
      name - 要返回的枚举常量的名称。
      返回:
      返回带有指定名称的枚举常量
      抛出:
      IllegalArgumentException - 如果该枚举类没有带有指定名称的常量
      NullPointerException - 如果参数为空值
    • getSerializedName

      public String getSerializedName()
      指定者:
      getSerializedName 在接口中 StringRepresentable
    • getMessageFunction

      public IDeathMessageProvider getMessageFunction()
      The death message function is used when an entity dies to a damage type with this death message type.
      返回:
      The IDeathMessageProvider associated with this death message type.
    • getExtensionInfo

      public static net.neoforged.fml.common.asm.enumextension.ExtensionInfo getExtensionInfo()