Class PlayerChangedMainHandEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
org.bukkit.event.player.PlayerChangedMainHandEvent

@Obsolete public class PlayerChangedMainHandEvent extends PlayerEvent
Called when a player changes their main hand in the client settings.
API Note:
Obsolete and replaced by PlayerClientOptionsChangeEvent.
  • Constructor Details

    • PlayerChangedMainHandEvent

      @Internal public PlayerChangedMainHandEvent(@NotNull @NotNull Player player, @NotNull @NotNull MainHand newMainHand)
  • Method Details

    • getMainHand

      @NotNull @Deprecated(since="1.21.4", forRemoval=true) public @NotNull MainHand getMainHand()
      Deprecated, for removal: This API element is subject to removal in a future version.
      has never been functional since its implementation and simply returns the old main hand. The method is left in this broken state to not break compatibility with plugins that relied on this fact. Use getNewMainHand() instead or migrate to PlayerClientOptionsChangeEvent.getMainHand().
      Gets the new main hand of the player. The old hand is still momentarily available via HumanEntity.getMainHand().
      Returns:
      the new MainHand of the player
    • getNewMainHand

      @NotNull public @NotNull MainHand getNewMainHand()
      Gets the new main hand of the player.
      Returns:
      the new MainHand of the player
    • setNewMainHand

      public void setNewMainHand(@NotNull @NotNull MainHand mainHand)
      플레이어의 주로 사용하는 손을 변경합니다.
      Parameters:
      mainHand - 주로 사용하는 손
    • getHandlers

      @NotNull public @NotNull HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      @NotNull public static @NotNull HandlerList getHandlerList()