on Left Click
Executed when the player left-clicked with this item outside an inventory
The code block will receive a PlayerInteractEvent which is validated to have a valid item and a valid click.
Keep in mind, this function only works in the same runtime as the item was generated. If the server is restarted, this will not trigger on the item. To still trigger the action, please use the addBehavior function.
Parameters
action
code block which is executed