EventFilter

interface EventFilter<E : Event, H>

A filter for a specific type of event.

This is useful for creating nodes that only listen to a specific type of event, and can be used to filter out events that are not of the specific type required.

You can also filter out events based on the contents of the event itself. For example, you could create a filter that only allows player events where the player is in creative mode.

Parameters

E

the type of events allowed by the filter

H

the type of handler object to filter on, e.g. a player for a player event

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open fun castHandler(event: Any): H?

Casts the given event to the type of event this filter accepts, then gets the handler object from the event.

Link copied to clipboard
abstract fun getHandler(event: E): H?

Gets the handler object from the given event, if available.

Properties

Link copied to clipboard
abstract val eventType: Class<E>

The type of event to filter for.

Link copied to clipboard
abstract val handlerType: Class<H>?

The type of handler object to filter from the event.