Package de.jvstvshd.necrify.api.event
Class NecrifyEvent
java.lang.Object
de.jvstvshd.necrify.api.event.NecrifyEvent
- Direct Known Subclasses:
NecrifyStateEvent,PunishmentLogEvent,UserEvent
Represents an event that can be dispatched by the
EventDispatcher.
All events must extend this class.- Since:
- 1.2.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidcancel()Cancels the event.@NotNull StringgetName()Gets the name of this event.Gets the origin of this event.setOrigin(EventOrigin origin) Sets the origin of this event.
-
Constructor Details
-
NecrifyEvent
Creates a new event with the given name. The name should be unique and describe the event.- Parameters:
name- the name of the event.
-
-
Method Details
-
getName
Gets the name of this event. The name should be unique and describe the event.- Returns:
- the name of this event.
-
cancel
public final void cancel()Cancels the event. This will prevent the event from being executed further. -
getOrigin
Gets the origin of this event.- Returns:
- the origin of this event.
-
setOrigin
Sets the origin of this event.- Parameters:
origin- the origin of this event.- Returns:
- this event.
-