Skip to main content
 Warning: Unmaintained Version
Version: 0.4.2

EventEntry

The EventEntry is used as a starting point for any sequence. It can have external event listeners listening to events and trigger based on that.

Usage

@Entry("example_event", "An example event entry.", Colors.YELLOW, Icons.CIRCLE)
class ExampleEventEntry(
override val id: String,
override val name: String,
override val triggers: List<String> = emptyList(),
): EventEntry

// Must be scoped to be public
@EntryListener(ExampleEventEntry::class)
fun onEvent(event: SomeBukkitEvent, query: Query<ExampleEventEntry>) {
// Do something
val entries = query.find() // Find all the entries of this type, for more information see the Query section
// Do something with the entries, for example trigger them
entries triggerAllFor event.player
}

If the function is not scoped to be public, it will not be registered as a listener. The function will automatically be registered as a listener for the event by Typewriter and be called when the Bukkit event is trigger. An optional Query parameter can be added to easily fetch all the different event entries.