Class PlayerUIElementDropItemEvent

java.lang.Object
net.risingworld.api.events.Event
net.risingworld.api.events.player.PlayerEvent
net.risingworld.api.events.player.ui.PlayerUIElementDropItemEvent

public final class PlayerUIElementDropItemEvent extends PlayerEvent
Called when an item in inventory is dragged & dropped on a UIElement. This does only work if UIElement.setDroppable(boolean) was set to true (and the element is pickable). The item always returns to its source slot, it's up to you to handle the drop (e.g by removing the item from the inventory).
  • Method Details

    • getUIElement

      public UIElement getUIElement()
      Gets the UI element the item was dropped on with the cursor.
      Returns:
      the UI element the item was dropped on.
    • getItem

      public Item getItem()
      Gets the item that was dropped on the UI element.
      Returns:
      the dropped item.
    • getInventorySlot

      public int getInventorySlot()
      Gets the source slot of the item before it was dragged.
      Returns:
      the item source slot in inventory.
    • getInventorySlotType

      public Inventory.SlotType getInventorySlotType()
      Gets the source slot type (e.g quickslot, equipment etc) of the item before it was dragged.
      Returns:
      the source inventory slot type.