Class ServerLifecycleEvents

java.lang.Object
net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents

public final class ServerLifecycleEvents
extends Object
  • Field Details

    • SERVER_STARTING

      public static final Event<ServerLifecycleEvents.ServerStarting> SERVER_STARTING
      Called when a Minecraft server is starting.

      This occurs before the player manager and any worlds are loaded.

    • SERVER_STARTED

      public static final Event<ServerLifecycleEvents.ServerStarted> SERVER_STARTED
      Called when a Minecraft server has started and is about to tick for the first time.

      At this stage, all worlds are live.

    • SERVER_STOPPING

      public static final Event<ServerLifecycleEvents.ServerStopping> SERVER_STOPPING
      Called when a Minecraft server has started shutting down. This occurs before the server's network channel is closed and before any players are disconnected.

      For example, an integrated server will begin stopping, but it's client may continue to run.

      All worlds are still present and can be modified.

    • SERVER_STOPPED

      public static final Event<ServerLifecycleEvents.ServerStopped> SERVER_STOPPED
      Called when a Minecraft server has stopped. All worlds have been closed and all (block)entities and players have been unloaded.

      For example, an integrated server will begin stopping, but it's client may continue to run. Meanwhile for a dedicated server, this will be the last event called.

    • START_DATA_PACK_RELOAD

      public static final Event<ServerLifecycleEvents.StartDataPackReload> START_DATA_PACK_RELOAD
      Called before a Minecraft server reloads data packs.
    • END_DATA_PACK_RELOAD

      public static final Event<ServerLifecycleEvents.EndDataPackReload> END_DATA_PACK_RELOAD
      Called after a Minecraft server has reloaded data packs.

      If reloading data packs was unsuccessful, the current data packs will be kept.