Skip to main content

ChangingItem

Gets called when the player is changing their held item.

Start a script section

!-- OnEvent ChangingItem
-- require @evPlayer *evOldItem *evNewItem $evIsAllowed

# Add your instructions here
  • Group: PlayerEvents
  • Cancellable: Yes
  • Event data: PlayerChangingItemEventArgs

Injected variables

VariableTypeDescription
@evPlayerplayer valueGets the player who is changing item.
*evOldItemreference to Item objectGets the old item.
*evNewItemreference to Item objectGets the new item that is being equipped. Item is null if player is equipping nothing.
$evIsAllowedbool valueWhether the event is allowed to run.