EntityPreprocessor

fun interface EntityPreprocessor(source)

An entity preprocessor, which extracts information from an entity for further processing by filters. This class provides Interaction.data (converts an entity to an object, where properties of the entity are stored, which will be processed by filters supporting it).

Each entity can have one preprocessor registered with registerPreprocessor.

If a GUI screen is open, the preprocessor of the interacted entity runs each tick, so process should execute quickly.

The result class of process should override the Object.equals method, because filters will only be evaluated, if the preprocessor returns a different object, because the entity was changed (for example, moved to a different biome).

Functions

Link copied to clipboard
abstract fun process(entity: Entity): Any?

Creates an interaction data based on a block entity.