public enum Difficulty extends Enum<Difficulty>
Modifier and Type | Field and Description |
---|---|
private static Difficulty[] |
BY_NAME |
private int |
id |
private String |
name |
Modifier and Type | Method and Description |
---|---|
static Difficulty |
byName(String name) |
static Difficulty |
byOrdinal(int ordinal) |
Difficulty |
cycle() |
int |
getId() |
String |
getName() |
Text |
getTranslatableName() |
static Difficulty |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Difficulty[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Difficulty PEACEFUL
public static final Difficulty EASY
public static final Difficulty NORMAL
public static final Difficulty HARD
private static final Difficulty[] BY_NAME
private final int id
private final String name
public static Difficulty[] values()
for (Difficulty c : Difficulty.values()) System.out.println(c);
public static Difficulty valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int getId()
public Text getTranslatableName()
public static Difficulty byOrdinal(int ordinal)
@Nullable public static Difficulty byName(String name)
public String getName()
@Environment(value=CLIENT) public Difficulty cycle()