G

Develop a BountySystem plugin for Paper/Bukkit that is fully compatible with Cardboard on Fabric, supporting modded entities like Create mod contraptions without direct interaction. The plugin should allow for persistent bounty values per player, with configurable percentage adjustments on kills (5% of the victim's bounty transferred to the killer and deducted from the victim). Implement commands for bounty management, including /bounty set, /bounty add, /bounty remove, /bounty reset, /bounty check, and /bounty top, and ensure player bounties are displayed above their heads in green text, formatted with commas and the currency symbol ฿. Ensure all data is saved across server restarts and avoid using NMS or modifying non-player entities.

Kodari AI
KodariJun 9 at 1:40 pm 16
BountySystem
A fully persistent bounty tracking plugin for Paper/Bukkit, compatible with Cardboard on Fabric. Each player has a bounty displayed above their head as a green hologram (฿ symbol, comma-formatted). On kill, 5% of the victim's bounty transfers to the killer. Includes /bounty set, add, remove, reset, check, and top commands. Data persists across restarts via YAML. No NMS usage — safe for modded environments.

Class plan:

  • BountyPlugin — main class, wires everything together

  • BountyManager — data map, persistence, hologram (armor stand) lifecycle, kill processing

  • BountyListener — PlayerDeathEvent (kill transfer), PlayerJoinEvent/PlayerQuitEvent (hologram spawn/remove)

  • BountyCommand — all subcommands + tab completion


What was built:

File
Purpose
BountyPlugin
Bootstraps manager, listener, command; saves on shutdown
BountyManager
YAML persistence, all bounty math, armor-stand holograms updated every 2 ticks
BountyListener
PlayerDeathEvent
→ kill transfer + chat notify; join/quit → hologram spawn/remove
BountyCommand
All 6 subcommands with tab completion and permission guards
config.yml
Configurable percentage, currency symbol, top-limit

Cardboard / modded compatibility notes:

  • Zero NMS — all armor stand control uses the Bukkit ArmorStand API

  • PlayerDeathEvent.getEntity().getKiller() returns null for non-player kills (Create contraptions, mobs, fall damage, etc.) — those code paths are simply skipped, no modded entity interaction needed

  • Holograms are vanilla armor stands; Fabric/Cardboard handles them natively

Kodari can make mistakes. Review important code before using.
Files
src
Code
6 553
src/main/java/com/kodari/bountysystem/BountyPlugin.java
package com.kodari.bountysystem;

import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

public class BountyPlugin extends JavaPlugin {

    @Getter private BountyManager bountyManager;

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

        bountyManager = new BountyManager(this);
        bountyManager.load();
        bountyManager.startHologramTask();

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

        BountyCommand cmd = new BountyCommand(this);
        getCommand("bounty").setExecutor(cmd);
        getCommand("bounty").setTabCompleter(cmd);

        getLogger().info("BountySystem enabled.");
    }

    @Override
    public void onDisable() {
        bountyManager.save();
        bountyManager.removeAllHolograms();
        getLogger().info("BountySystem disabled.");
    }
}