events

ZelBounty fires custom events that you can listen to for custom logic. All events are cancellable.

Event Package

All events are located in com.kammoun.api.events.

Available Events

BountyAddEvent

Fired when a bounty is added to a player.

public class BountyAddEvent extends Event implements Cancellable {
    Player getPlayer();      // Player adding the bounty
    Player getTarget();      // Player receiving the bounty
    double getAmount();      // Amount being added
    void setAmount(double);  // Modify the amount
    boolean isAdmin();       // True if added by admin command
    boolean isCancelled();
    void setCancelled(boolean);
}

Example:


BountyRemoveEvent

Fired when a bounty is removed from a player.

Example:


BountyResetEvent

Fired when a player's bounty is reset to 0.

Example:


BountyClaimEvent

Fired when a bounty is claimed (target is killed).

Example:

Registering Listeners

Register your event listeners like any other Bukkit event:

Event Priority

Use standard Bukkit event priorities:

Cancelling Events

When you cancel an event:

  • BountyAddEvent: Bounty is not added, money is not deducted

  • BountyRemoveEvent: Bounty is not removed

  • BountyResetEvent: Bounty is not reset

  • BountyClaimEvent: Reward is not given, bounty remains active

Complete Example Plugin