Class SessionDefineCustomWaypointsEvent

java.lang.Object
org.geysermc.geyser.api.event.connection.ConnectionEvent
org.geysermc.geyser.api.event.connection.SessionDefineCustomWaypointsEvent
All Implemented Interfaces:
org.geysermc.event.Event

@NonExtendable public abstract class SessionDefineCustomWaypointsEvent extends ConnectionEvent
Called once for every GeyserConnection to register custom waypoint styles. Custom waypoint styles must be registered through this event.

CustomWaypointStyles may be registered multiple times for different Java Edition waypoint style Identifiers, however, each Java Edition waypoint style may only have one CustomWaypointStyle.

Since:
2.11.0
See Also:
  • Constructor Details

    • SessionDefineCustomWaypointsEvent

      @Internal public SessionDefineCustomWaypointsEvent(GeyserConnection connection)
  • Method Details

    • customWaypointStyles

      public abstract Map<Identifier,CustomWaypointStyle> customWaypointStyles()
      Returns a map of all the currently registered custom waypoint styles for this GeyserConnection.
      Returns:
      an unmodifiable map of all currently registered custom waypoint styles
      Since:
      2.11.0
    • register

      public abstract void register(Identifier identifier, CustomWaypointStyle style)
      Registers a CustomWaypointStyle for this GeyserConnection, for the given Java Edition waypoint style identifier.

      The given CustomWaypointStyle will be used for every waypoint that uses the given identifier as waypoint style. Vanilla waypoint styles, like minecraft:default, may be overridden.

      When a waypoint style is already registered for the given identifier, this method will fail without throwing an exception, but an error will be logged.

      Parameters:
      identifier - the identifier of the waypoint style on Java Edition
      style - the CustomWaypointStyle
      Throws:
      CustomWaypointStyleRegisterException - when an error occurred while registering the custom waypoint style
      Since:
      2.11.0