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.

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

    Modifier and Type
    Method
    Description
    void
    onPreTick(TaleServer server, long tick)
    Called at the start of each server tick, before tick processing begins.
  • Field Details

  • Method Details

    • onPreTick

      void onPreTick(TaleServer server, long tick)
      Called at the start of each server tick, before tick processing begins.
      Parameters:
      server - the server instance
      tick - the current tick number (starts at 0, increments each tick)