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

    • PlayerArmorStandManipulateEvent

      @Internal public PlayerArmorStandManipulateEvent(@NotNull @NotNull Player player, @NotNull @NotNull ArmorStand clickedEntity, @NotNull @NotNull ItemStack playerItem, @NotNull @NotNull ItemStack armorStandItem, @NotNull @NotNull EquipmentSlot slot, @NotNull @NotNull EquipmentSlot hand)
    • PlayerArmorStandManipulateEvent

      @Deprecated(since="1.19.2", forRemoval=true) public PlayerArmorStandManipulateEvent(@NotNull @NotNull Player player, @NotNull @NotNull ArmorStand clickedEntity, @NotNull @NotNull ItemStack playerItem, @NotNull @NotNull ItemStack armorStandItem, @NotNull @NotNull EquipmentSlot slot)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • getPlayerItem

      @NotNull public @NotNull 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 @NotNull 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 @NotNull 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 @NotNull 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 @NotNull 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 @NotNull HandlerList getHandlers()
      Overrides:
      getHandlers in class PlayerInteractEntityEvent
    • getHandlerList

      @NotNull public static @NotNull HandlerList getHandlerList()