Class ServerTickEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.tick.ServerTickEvent
Direct Known Subclasses:
ServerTickEvent.Post, ServerTickEvent.Pre

public abstract class ServerTickEvent extends net.neoforged.bus.api.Event
Base class of the two server tick events.
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    ServerTickEvent.Post is fired once per server tick, after the server performs work for the current tick.
    static class 
    ServerTickEvent.Pre is fired once per server tick, before the server performs work for the current tick.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final BooleanSupplier
     
    private final net.minecraft.server.MinecraftServer
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    ServerTickEvent(BooleanSupplier hasTime, net.minecraft.server.MinecraftServer server)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.server.MinecraftServer
    Returns the server instance.
    boolean
    Returns true if the server has enough time to perform any additional tasks (usually IO related) during the current tick, otherwise false.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • hasTime

      private final BooleanSupplier hasTime
    • server

      private final net.minecraft.server.MinecraftServer server
  • Constructor Details

    • ServerTickEvent

      protected ServerTickEvent(BooleanSupplier hasTime, net.minecraft.server.MinecraftServer server)
  • Method Details

    • hasTime

      public boolean hasTime()
      Returns true if the server has enough time to perform any additional tasks (usually IO related) during the current tick, otherwise false.
      Returns:
      true if the server has enough time to perform any additional tasks (usually IO related) during the current tick, otherwise false
    • getServer

      public net.minecraft.server.MinecraftServer getServer()
      Returns the server instance.
      Returns:
      the server instance