Package ch.njol.skript.lang
Class SelfRegisteringSkriptEvent
java.lang.Object
ch.njol.skript.lang.SkriptEvent
ch.njol.skript.lang.SelfRegisteringSkriptEvent
- All Implemented Interfaces:
Debuggable
,SyntaxElement
- Direct Known Subclasses:
EvtAtTime
,EvtChat
,EvtExperienceSpawn
,EvtMoveOn
,EvtPeriodical
,EvtRegionBorder
,EvtScript
,EvtSkript
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
afterParse(Config config)
This method is called when this event is parsed.boolean
check(org.bukkit.event.Event e)
Checks whether the given Event applies, e.g.boolean
abstract void
This method is called after the whole trigger is loaded for events that fire themselves.abstract void
unregister(Trigger t)
This method is called to unregister this event registered throughregister(Trigger)
.abstract void
This method is called to unregister all events registered throughregister(Trigger)
.Methods inherited from class ch.njol.skript.lang.SkriptEvent
getEventClasses, getEventPriority, init, init, shouldLoadEvent, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.njol.skript.lang.Debuggable
toString
Methods inherited from interface ch.njol.skript.lang.SyntaxElement
getParser
-
Constructor Details
-
SelfRegisteringSkriptEvent
public SelfRegisteringSkriptEvent()
-
-
Method Details
-
register
This method is called after the whole trigger is loaded for events that fire themselves.- Parameters:
t
- the trigger to register to this event
-
unregister
This method is called to unregister this event registered throughregister(Trigger)
.- Parameters:
t
- the same trigger which was registered for this event
-
unregisterAll
public abstract void unregisterAll()This method is called to unregister all events registered throughregister(Trigger)
. This is called on all registered events, thus it can also only unregister the event it is called on. -
check
public final boolean check(org.bukkit.event.Event e)Description copied from class:SkriptEvent
Checks whether the given Event applies, e.g. the leftclick event is only part of the PlayerInteractEvent, and this checks whether the player leftclicked or not. This method will only be called for events this SkriptEvent is registered for.- Specified by:
check
in classSkriptEvent
- Returns:
- true if this is SkriptEvent is represented by the Bukkit Event or false if not
-
afterParse
This method is called when this event is parsed. Overriding this is optional, and usually not needed.- Parameters:
config
- Script that is being parsed
-
isEventPrioritySupported
public boolean isEventPrioritySupported()- Overrides:
isEventPrioritySupported
in classSkriptEvent
- Returns:
- whether this SkriptEvent supports event priorities
-