| Name | block tries to dispense item |
| Event Lines | <block> tries to dispense <item> |
| Triggers | before a block dispenses an item.
This event fires before the dispenser fully processes a drop, allowing access to the dispensing slot and cancellation of sound effects. |
| Generated Examples | on oak_fence tries to dispense item:
after block tries to dispense light_blue_dye: |
| Contexts | <context.location> returns the LocationTag of the dispenser.
<context.item> returns the ItemTag of the item about to be dispensed.
<context.slot> returns a ElementTag(Number) of the slot that will be dispensed from.
|
| Cancellable | True - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false' |
| Has Location | True - This adds the switches 'in:<area>', 'location_flagged:<flag>', ... |
| Group | Block |
| Source | https://github.com/DenizenScript/Denizen/blob/dev/paper/src/main/java/com/denizenscript/denizen/paper/events/BlockPreDispenseScriptEvent.java#L14 |