needs3x

"Create a plugin named BountySystem. This plugin should allow only OP players to place bounties on other players using a command like /bounty <player> <amount>. When a bounty is placed, the target player’s name should display with ‘[BOUNTY]’ next to it, and a title announcement should appear.

The player with an active bounty should have their coordinates (X, Y, Z) shown in a boss bar to all players, and these coordinates should update every 1 hour.

There should be a command /endbounty <player> that can only be used by OP players to remove an active bounty.

When the bounty target is killed:

Firework effects should play A message should be broadcast: “Bounty hunted by ” The bounty reward should be given to the player who killed the target

Kodari AI
KodariApr 3 at 12:08 pm 12,826 (v2)

I’ll create a bounty hunting plugin with OP-only commands, boss bar coordinate tracking, and automatic reward distribution.

BountySystem
A bounty hunting plugin that allows OP players to place bounties on targets. Features include bounty name tags, boss bar coordinate tracking that updates hourly, title announcements, automated reward distribution on kill, and firework effects. Integrates with Vault for economy handling and provides full bounty management commands for server operators.

All files created successfully! The BountySystem plugin features:

  • OP-only bounty placement via /bounty <player> <amount> with economy integration

  • Automatic name tagging with red [BOUNTY] prefix in tab list and chat

  • Boss bar coordinate tracking that updates every hour and shows to all players

  • Title announcements when bounties are placed

  • Kill detection with firework effects, broadcast messages, and automatic reward distribution

  • Bounty removal via /endbounty <player> command

  • Data persistence across server restarts

  • Configurable messages and boss bar settings

The plugin requires Vault and automatically handles online/offline bounty targets, prevents self-bounties, and cleans up boss bars when bounties expire.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
10 699
src/main/java/com/bountysystem/BountySystem.java
package com.bountysystem;

import com.bountysystem.command.BountyCommand;
import com.bountysystem.command.EndBountyCommand;
import com.bountysystem.listener.BountyListener;
import com.bountysystem.manager.BossBarManager;
import com.bountysystem.manager.BountyManager;
import lombok.Getter;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class BountySystem extends JavaPlugin {

    private Economy economy;
    private BountyManager bountyManager;
    private BossBarManager bossBarManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        if (!setupEconomy()) {
            getLogger().severe("Vault not found! Disabling plugin...");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }

        bountyManager = new BountyManager(this);
        bossBarManager = new BossBarManager(this);

        getCommand("bounty").setExecutor(new BountyCommand(this));
        getCommand("endbounty").setExecutor(new EndBountyCommand(this));

        Bukkit.getPluginManager().registerEvents(new BountyListener(this), this);

        bountyManager.loadBounties();
        bossBarManager.startUpdateTask();

        getLogger().info("BountySystem has been enabled!");
    }

    @Override
    public void onDisable() {
        if (bossBarManager != null) {
            bossBarManager.stopUpdateTask();
            bossBarManager.removeAllBossBars();
        }
        if (bountyManager != null) {
            bountyManager.saveBounties();
        }
        getLogger().info("BountySystem has been disabled!");
    }

    private boolean setupEconomy() {
        if (getServer().getPluginManager().getPlugin("Vault") == null) {
            return false;
        }
        RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
        if (rsp == null) {
            return false;
        }
        economy = rsp.getProvider();
        return economy != null;
    }
}