Skip to content

Event ​

com.jsmacrosce.jsmacros.core.event.Event

Declares an event type's registry metadata: its current name, aliases, dispatch flags, and optional filterer class. This describes the annotated runtime class, not an event instance.

js
const Event = Java.type("com.jsmacrosce.jsmacros.core.event.Event");  
const Tick = Java.type("com.jsmacrosce.jsmacros.client.api.event.impl.world.EventTick");  
const metadata = Tick.class.getAnnotation(Event.class);  
Chat.log(metadata.value() + " (old name: " + metadata.oldName() + ")");

Methods ​

cancellable ​

cancellable(): boolean#
Declares the event's cancellable metadata flag. Defaults to false. Registration also marks such an event joinable; subclasses may define effective cancellability independently.
Returns: true if the event is declared cancellable

filterer ​

filterer(): Class<? extends EventFilterer>#
Declares the filterer class to register for this event, if any.
Returns: the filterer class, or EventFilterer.class when none is declared

joinable ​

joinable(): boolean#
Declares whether the event is joinable; defaults to false. Cancellable events are treated as joinable too.
Returns: true if the event is declared joinable

oldName ​

oldName(): String#
Returns an explicitly declared legacy alias; the registry also records the annotated class's simple name as an alias.
Returns: the old-name alias, or an empty string if none was declared

value ​

value(): String#
Returns the declared current event name used during registration.
Returns: the declared event name