Enum Difficulty

java.lang.Object
java.lang.Enum<Difficulty>
net.minecraft.world.Difficulty
All Implemented Interfaces:
Serializable, Comparable<Difficulty>, java.lang.constant.Constable

public enum Difficulty
extends Enum<Difficulty>
  • Enum Constant Details

  • Field Details

    • BY_NAME

      private static final Difficulty[] BY_NAME
    • id

      private final int id
    • name

      private final String name
  • Constructor Details

    • Difficulty

      private Difficulty​(int id, String name)
  • Method Details

    • values

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

      public static Difficulty valueOf​(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null
    • getId

      public int getId()
    • getTranslatableName

      public Text getTranslatableName()
    • byOrdinal

      public static Difficulty byOrdinal​(int ordinal)
    • byName

      @Nullable public static Difficulty byName​(String name)
    • getName

      public String getName()
    • cycle

      @Environment(CLIENT) public Difficulty cycle()