Package ch.njol.skript.lang
Enum Class SkriptEvent.ListeningBehavior
- All Implemented Interfaces:
Serializable
,Comparable<SkriptEvent.ListeningBehavior>
,Constable
- Enclosing class:
SkriptEvent
The listening behavior of a Skript event. This determines whether the event should run for cancelled events, uncancelled events, or both.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionThis Skript event should run for any event, cancelled or uncancelled.This Skript event should run for any cancelled event.This Skript event should run for any uncancelled event. -
Method Summary
Modifier and TypeMethodDescriptionboolean
matches
(boolean cancelled) Checks whether this listening behavior matches the given cancelled state.Returns the enum constant of this class with the specified name.static SkriptEvent.ListeningBehavior[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UNCANCELLED
This Skript event should run for any uncancelled event. -
CANCELLED
This Skript event should run for any cancelled event. -
ANY
This Skript event should run for any event, cancelled or uncancelled.
-
-
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
-
matches
public boolean matches(boolean cancelled) Checks whether this listening behavior matches the given cancelled state.- Parameters:
cancelled
- Whether the event is cancelled.- Returns:
- Whether an event with the given cancelled state should be run for this listening behavior.
-