bounty api

The BountyAPI provides methods to manage bounties programmatically.

Getting the API

ZelBountyAPI api = Bukkit.getServicesManager().load(ZelBountyAPI.class);
BountyAPI bountyAPI = api.getBountyAPI();

Methods

addBounty

Add bounty to a player.

CompletableFuture<Double> addBounty(UUID target, UUID adder, double amount)
    throws BountyException;

Parameters:

  • target - UUID of the player receiving the bounty

  • adder - UUID of the player adding the bounty (can be null for system)

  • amount - Amount to add

Returns: CompletableFuture<Double> - New total bounty amount

Example:


removeBounty

Remove bounty from a player.

Parameters:

  • target - UUID of the player losing bounty

  • remover - UUID of the player removing bounty (can be null)

  • amount - Amount to remove

Returns: CompletableFuture<Double> - New total bounty amount

Example:


resetBounty

Reset a player's bounty to 0.

Parameters:

  • target - UUID of the player to reset

  • resetter - UUID of the player performing reset (can be null)

Example:


claimBounty

Claim a bounty (typically called when a player is killed).

Parameters:

  • target - UUID of the player whose bounty is being claimed

  • claimer - UUID of the player claiming the bounty

Returns: CompletableFuture<Double> - Amount claimed

Example:


getBounty

Get the current bounty amount for a player.

Parameters:

  • target - UUID of the player

Returns: Current bounty amount (0.0 if none)

Example:


getBountyData

Get full bounty data for a player.

Parameters:

  • target - UUID of the player

Returns: IBountyData object or null if not found

IBountyData Interface:

Example:


getTopBounties

Get a list of players with the highest bounties.

Parameters:

  • limit - Maximum number of results

Returns: List of IBountyData sorted by bounty amount (descending)

Example:


getHistory

Get bounty history for a player.

Parameters:

  • target - UUID of the player

  • limit - Maximum number of results

Returns: List of IHistoryEntry objects

IHistoryEntry Interface:

BountyAction Enum:

Example:


hasBounty

Check if a player has an active bounty.

Parameters:

  • target - UUID of the player

Returns: true if player has bounty > 0

Example:

Complete Example