Class ClientInformationUpdatedEvent


public class ClientInformationUpdatedEvent extends PlayerEvent
ClientInformationUpdatedEvent is fired when a player changes server-synced client options, specifically those in ClientInformation.

This event is fired on the NeoForge.EVENT_BUS.

  • Field Details

    • oldInformation

      private final net.minecraft.server.level.ClientInformation oldInformation
    • updatedInformation

      private final net.minecraft.server.level.ClientInformation updatedInformation
  • Constructor Details

    • ClientInformationUpdatedEvent

      public ClientInformationUpdatedEvent(net.minecraft.server.level.ServerPlayer player, net.minecraft.server.level.ClientInformation oldInfo, net.minecraft.server.level.ClientInformation newInfo)
  • Method Details

    • getEntity

      public net.minecraft.server.level.ServerPlayer getEntity()
      Overrides:
      getEntity in class PlayerEvent
    • getUpdatedInformation

      public net.minecraft.server.level.ClientInformation getUpdatedInformation()
      Returns the new client info to be applied to the player. Sometimes the client resends unchanged options, so if that matters for your use case, check equality with getOldInformation().
      Returns:
      updated information
    • getOldInformation

      public net.minecraft.server.level.ClientInformation getOldInformation()
      Returns the existing client info from to the player.

      May be blank or defaulted initial data on first event call for a player instance.

      Returns:
      updated information