Wizards of Lua

The Art of Spell Crafting


UseItemStopEvent - When an Entity Stops Using an Item

The UseItemStopEvent class is fired when a Mob or Player stops using an Item without finishing it. Currently the only vanilla item that is affected by canceling this event is the bow. If this event is canceled the bow does not shoot an arrow.

Example

Print a message when the player stops eating a golden apple.

Events.on('UseItemStopEvent'):call(function(event)
  if event.item.id == 'golden_apple' then
    print('Are you not hungry?')
  end
end)

The UseItemStopEvent class is a subtype of the UseItemEvent class and inherits all its properties and functions.