Package dev.polv.taleapi.event.server
Interface ServerPostTickCallback
- 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 end of each server tick, after tick processing completes.
This event fires at the end of each server tick (typically 20 times per second), providing the current tick number. Use this for tasks that need to run after the main tick logic executes, such as cleanup, synchronization, or deferred updates.
This event is NOT cancellable. The server tick has already completed when this event fires.
Example Usage
ServerPostTickCallback.EVENT.register((server, tick) -> {
// Run every second (20 ticks) after tick processing
if (tick % 20 == 0) {
flushPendingChanges();
}
});
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 TypeMethodDescriptionvoidonPostTick(TaleServer server, long tick) Called at the end of each server tick, after tick processing completes.
-
Field Details
-
EVENT
The event instance. Use this to register listeners and fire the event.
-
-
Method Details
-
onPostTick
Called at the end of each server tick, after tick processing completes.- Parameters:
server- the server instancetick- the current tick number (starts at 0, increments each tick)
-