Developers
View the Developer API for Pouches.
PouchRedeemEvent
This event is fired when the player tries to redeem a pouch by right-clicking it. This event is only fired on a successful fire, meaning not in a blacklisted region or world.
@EventHandler
public void onPouchRedeem(PouchRedeemEvent e) {
// Player redeeming the pouch.
Player player = e.getPlayer();
// The pouch object (one being redeemed).
Pouch pouch = e.getPouch();
// The randomly generated amount.
Long amount = e.getAmount();
// The itemstack for the pouch.
ItemStack pouchItem = e.getItem();
// The slot this pouch is being redeemed in.
// Applies only to mc version 1.9+.
PouchSlot slot = e.getSlot();
// Is the event cancelled? Returns boolean.
e.isCancelled();
// Should we cancel the event?
e.setCancelled(boolean);
}
Last updated