Enum Class EventResult
- All Implemented Interfaces:
Serializable, Comparable<EventResult>, Constable, net.minecraft.util.StringRepresentable
Represents a result of an event that controls execution of some action.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E>Nested classes/interfaces inherited from interface net.minecraft.util.StringRepresentable
net.minecraft.util.StringRepresentable.EnumCodec<E>, net.minecraft.util.StringRepresentable.StringRepresentableCodec<S> -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsFields inherited from interface net.minecraft.util.StringRepresentable
PRE_BUILT_MAP_THRESHOLD -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whatever action should be allowed.booleanallowAction(boolean passResult) Checks whatever action should be allowed, with custom return value forPASS.Value of this enum as string.static EventResultReturns the enum constant of this class with the specified name.static EventResult[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ALLOW
Prevents further event handling, while allowing related action. -
PASS
Continues execution of further events. In case of being returned by a final callback, it might either act the same as ALLOW or execute additional logic to determine the outcome. -
DENY
Prevents further event handling, while also preventing related action.
-
-
Field Details
-
CODEC
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
allowAction
public boolean allowAction()Checks whatever action should be allowed.- Returns:
- true if it's allowed, otherwise false.
-
allowAction
public boolean allowAction(boolean passResult) Checks whatever action should be allowed, with custom return value forPASS.- Returns:
- true if it's allowed, otherwise false.
-
getSerializedName
Value of this enum as string.- Specified by:
getSerializedNamein interfacenet.minecraft.util.StringRepresentable- Returns:
- lowercase name of the value.
-