Skip to content

PlayerDropSelectedItemEvent

Triggered when a player drops the selected item. This event provides access to the player and the selected item being dropped. This event can be canceled.

Example

spell:intercept("PlayerDropSelectedItemEvent", function(evt)
  ---@cast evt PlayerDropSelectedItemEvent
  if evt.item.type.id == "diamond_sword" then
    return false
  end
end)
while true do sleep(10) end

Fields

entireStack: boolean — Read-Only

Indicates if the entire stack will be dropped of just one single item.

item: Item — Read-Only

A reference to the item that is about to be dropped. In an event queue it is a copy, as the event has already happened there.

name: string — Read-Only

The name of the event.

player: Player — Read-Only

A reference to the player who is dropping the item.