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.

@FunctionalInterface public interface ServerPostTickCallback
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
    Modifier and Type
    Field
    Description
    The event instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onPostTick(TaleServer server, long tick)
    Called at the end of each server tick, after tick processing completes.
  • Field Details

  • Method Details

    • onPostTick

      void onPostTick(TaleServer server, long tick)
      Called at the end of each server tick, after tick processing completes.
      Parameters:
      server - the server instance
      tick - the current tick number (starts at 0, increments each tick)