Class PlayerArmorStandManipulateEvent

All Implemented Interfaces:
Cancellable

public class PlayerArmorStandManipulateEvent extends PlayerInteractEntityEvent
Called when a player interacts with an armor stand and will either swap, retrieve or place an item.
  • Constructor Details

  • Method Details

    • getPlayerItem

      @NotNull public ItemStack getPlayerItem()
      Returns the item held by the player.

      If this item is empty and the armor stand item is also empty, there will be no transaction between the player and the armor stand. If the player's item is empty but the armor stand item is not, the player's item will be placed on the armor stand. If both items are not empty, the items will be swapped.

      In the case that this event is cancelled, the original items will remain the same.

      Returns:
      the item held by the player.
    • getArmorStandItem

      @NotNull public ItemStack getArmorStandItem()
      Returns the item held by the armor stand.

      If this item is empty and the player's item is also empty, there will be no transaction between the player and the armor stand. If the player's item is empty but the armor stand item is not, then the player will obtain the armor stand item. In the case that the player's item is not empty but the armor stand item is empty, the player's item will be placed on the armor stand. If both items are not empty, the items will be swapped.

      In the case that the event is cancelled the original items will remain the same.

      Returns:
      the item held by the armor stand.
    • getSlot

      @NotNull public EquipmentSlot getSlot()
      Returns the raw item slot of the armor stand in this event.
      Returns:
      the index of the item obtained or placed of the armor stand.
    • getHand

      @NotNull public EquipmentSlot getHand()
      The hand used to perform this interaction.

      Note that this is not the hand of the armor stand that was changed, but rather the hand used by the player to swap items with the armor stand.

      Overrides:
      getHand in class PlayerInteractEntityEvent
      Returns:
      the hand used to interact
    • getRightClicked

      @NotNull public ArmorStand getRightClicked()
      Description copied from class: PlayerInteractEntityEvent
      Gets the entity that was right-clicked by the player.
      Overrides:
      getRightClicked in class PlayerInteractEntityEvent
      Returns:
      entity right clicked by player
    • getHandlers

      @NotNull public HandlerList getHandlers()
      Overrides:
      getHandlers in class PlayerInteractEntityEvent
    • getHandlerList

      @NotNull public static HandlerList getHandlerList()