Class ServerEvents

java.lang.Object
icu.suc.mc.serverevents.ServerEvents

public final class ServerEvents extends Object
  • Method Details

    • register

      @SafeVarargs public static <T> void register(@NotNull @NotNull Object listener, net.fabricmc.fabric.api.event.Event<? extends T> @NotNull ... events)
      Registers the given listener to one or more events using the default phase.

      The listener object must implement the interface or class represented by each event's type parameter T. Passing an incompatible object will throw a ClassCastException at runtime.

      This variant uses Event.DEFAULT_PHASE as the registration phase.

      Type Parameters:
      T - the type of the event listener; each event expects this type
      Parameters:
      listener - the object to register; must implement each event's type parameter T
      events - the events to register to
    • register

      @SafeVarargs public static <T> void register(@NotNull @NotNull net.minecraft.resources.Identifier phase, @NotNull @NotNull Object listener, net.fabricmc.fabric.api.event.Event<? extends T> @NotNull ... events)
      Registers the given listener to one or more events with a specified phase.

      The listener object must implement the interface or class represented by each event's type parameter T. Passing an incompatible object will throw a ClassCastException at runtime.

      Type Parameters:
      T - the type of the event listener; each event expects this type
      Parameters:
      phase - the registration phase to use
      listener - the object to register; must implement each event's type parameter T
      events - the events to register to