Package org.bukkit.event.player
Class PlayerArmorStandManipulateEvent
- java.lang.Object
-
- org.bukkit.event.Event
-
- org.bukkit.event.player.PlayerEvent
-
- org.bukkit.event.player.PlayerInteractEntityEvent
-
- org.bukkit.event.player.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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
-
Field Summary
-
Fields inherited from class org.bukkit.event.player.PlayerInteractEntityEvent
clickedEntity
-
Fields inherited from class org.bukkit.event.player.PlayerEvent
player
-
-
Constructor Summary
Constructors Constructor Description PlayerArmorStandManipulateEvent(@NotNull Player who, @NotNull ArmorStand clickedEntity, @NotNull ItemStack playerItem, @NotNull ItemStack armorStandItem, @NotNull EquipmentSlot slot)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull ItemStack
getArmorStandItem()
Returns the item held by the armor stand.static @NotNull HandlerList
getHandlerList()
@NotNull HandlerList
getHandlers()
@NotNull ItemStack
getPlayerItem()
Returns the item held by the player.@NotNull ArmorStand
getRightClicked()
Gets the entity that was right-clicked by the player.@NotNull EquipmentSlot
getSlot()
Returns the raw item slot of the armor stand in this event.-
Methods inherited from class org.bukkit.event.player.PlayerInteractEntityEvent
getHand, isCancelled, setCancelled
-
Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayer
-
Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
-
-
-
Constructor Detail
-
PlayerArmorStandManipulateEvent
public PlayerArmorStandManipulateEvent(@NotNull @NotNull Player who, @NotNull @NotNull ArmorStand clickedEntity, @NotNull @NotNull ItemStack playerItem, @NotNull @NotNull ItemStack armorStandItem, @NotNull @NotNull EquipmentSlot slot)
-
-
Method Detail
-
getPlayerItem
@NotNull public @NotNull ItemStack getPlayerItem()
Returns the item held by the player. If this Item is null and the armor stand Item is also null, there will be no transaction between the player and the armor stand. If the Player's item is null, 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 null, but the armor stand item is null, the players item will be placed on the armor stand. If both items are not null, 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 player.
-
getArmorStandItem
@NotNull public @NotNull ItemStack getArmorStandItem()
Returns the item held by the armor stand. If this Item is null and the player's Item is also null, there will be no transaction between the player and the armor stand. If the Player's item is null, 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 null, but the armor stand item is null, the players item will be placed on the armor stand. If both items are not null, 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.
-
getRightClicked
@NotNull public @NotNull ArmorStand getRightClicked()
Description copied from class:PlayerInteractEntityEvent
Gets the entity that was right-clicked by the player.- Overrides:
getRightClicked
in classPlayerInteractEntityEvent
- Returns:
- entity right clicked by player
-
getHandlers
@NotNull public @NotNull HandlerList getHandlers()
- Overrides:
getHandlers
in classPlayerInteractEntityEvent
-
getHandlerList
@NotNull public static @NotNull HandlerList getHandlerList()
-
-