Package dev.polv.taleapi.event.server
Interface ServerPreTickCallback
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Called at the start of each server tick, before tick processing begins.
This event fires at the beginning of each server tick (typically 20 times per second), providing the current tick number. Use this for tasks that need to run before the main tick logic executes, such as input processing or state preparation.
This event is NOT cancellable. The server tick will always proceed regardless of listener behavior.
Example Usage
ServerPreTickCallback.EVENT.register((server, tick) -> {
// Prepare state before tick processing
processQueuedInputs();
});
Performance Considerations
Since this event fires frequently, keep listener logic lightweight. Avoid heavy computations or blocking operations in tick handlers.
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidonPreTick(TaleServer server, long tick) Called at the start of each server tick, before tick processing begins.
-
Field Details
-
EVENT
The event instance. Use this to register listeners and fire the event.
-
-
Method Details
-
onPreTick
Called at the start of each server tick, before tick processing begins.- Parameters:
server- the server instancetick- the current tick number (starts at 0, increments each tick)
-