Enum Class DamageEffects

java.lang.Object
java.lang.Enum<DamageEffects>
net.minecraft.world.damagesource.DamageEffects
All Implemented Interfaces:
Serializable, Comparable<DamageEffects>, Constable, StringRepresentable, IExtensibleEnum

public enum DamageEffects extends Enum<DamageEffects> implements StringRepresentable, IExtensibleEnum
  • Enum Constant Details Link icon

  • Field Details Link icon

  • Constructor Details Link icon

  • Method Details Link icon

    • values Link icon

      public static DamageEffects[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf Link icon

      public static DamageEffects valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getSerializedName Link icon

      public String getSerializedName()
      Specified by:
      getSerializedName in interface StringRepresentable
    • sound Link icon

      public SoundEvent sound()
    • create Link icon

      public static DamageEffects create(String name, String id, Supplier<SoundEvent> sound)
      Creates a new DamageEffects with the specified ID and sound.
      Example usage:
       public static final DamageEffects ELECTRIFYING = DamageEffects.create("MYMOD_ELECTRIFYING", "mymod:electrifying", MySounds.ELECTRIFYING);
       
      Parameters:
      name - The true enum name. Prefix this with your modid.
      id - The serialized name. Prefix this with your modid and `:`
      sound - The sound event that will play when a damage type with this effect deals damage to a player.
      Returns:
      A newly created DamageEffects. Store this result in a static final field.