Skip to main content
JPPrison fires a BalanceChangeEvent before every economy balance write. You can listen to this event to react to transactions, log them, or cancel them entirely.

BalanceChangeEvent

Register a standard Bukkit @EventHandler in any plugin that depends on JPPrison:

Available Methods


TransactionCause

Every BalanceChangeEvent carries a TransactionCause that tells you exactly why the balance is changing. Use it to selectively react to or block specific sources.

Cancelling Transactions

Calling event.setCancelled(true) prevents the balance change entirely. The player receives no currency for that transaction and no error is shown to them by default.
Cancelling events from API_GIVE will also cancel calls made by JPPrisonAPI.tryPurchase(). Make sure your cancellation logic does not unintentionally block legitimate shop purchases made through the API.