> For the complete documentation index, see [llms.txt](https://plugins-1.gitbook.io/plugins/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://plugins-1.gitbook.io/plugins/plugin/vouchers/developers.md).

# Developers

## VoucherRedeemEvent

This event is fired when the player tries to redeem a voucher by right-clicking it. This event is only fired on a successful fire, meaning not in a blacklisted region or world.

```java
@EventHandler
public void onVoucherRedeem(VoucherRedeemEvent e) {
 // Player redeeming the pouch.
 Player player = e.getPlayer();
 
 // The voucher object (one being redeemed).
 Voucher pouch = e.getVoucher();
 
 // The randomly generated amount.
 Long amount = e.getAmount();
 
 // The itemstack for the pouch.
 ItemStack voucherItem = e.getItem();
 
 // The slot this voucher is being redeemed in.
 // Applies only to mc version 1.9+.
 VoucherSlot slot = e.getSlot();
  
 // Is the event cancelled? Returns boolean.
 e.isCancelled();
 
 // Should we cancel the event?
 e.setCancelled(boolean);
}
```
