owcakkk

Code a smp plugin, when you kill someone it drops a special item called "money", it will have a value of 1CZK

Kodari AI
KodariMar 4 at 3:34 pm 3,553 (v2)

I’ll create an SMP plugin that drops a special “money” item worth 1CZK when a player kills another player.

SMPMoney
An SMP plugin that creates a player-driven economy by dropping special money items when players kill each other. Each kill drops a "money" item worth 1CZK (Czech koruna). The money items are customizable with configurable materials, names, and lore. Includes validation to prevent item duplication and supports multiple drops per kill. Perfect for survival multiplayer servers wanting a PvP-based economy system.

Now I’ll create the plugin files:

Plugin created successfully! When a player kills another player, it will drop special “money” items worth 1CZK at the victim’s location. The money item is fully configurable in config.yml (material, name, lore, amount per kill).

owcakkk

add a feature that when you kill someone it automatically shows in your actionbar your money and it will update each time you kill someone. Do it like a money-steal (similar to lifesteal), add also a command to show the money of exact players: /money (player), each player starts with 50CZK (add a feature to change that in config)

Kodari AI
KodariMar 4 at 4:09 pm 13,362 (v2)

I’ll add the money-steal feature with actionbar display and a money command. Let me first check the existing structure.

I’ll implement the money-steal feature with actionbar display, starting balance, and money command.

Plan:

  • Add player money balance system with data persistence

  • Modify death listener to steal money and show actionbar

  • Add /money <player> command

  • Add config options for starting money (50 CZK default) and steal amount

  • Players who join for the first time get starting money

All files created. The plugin now features money-steal with actionbar display, starting balance of 50 CZK (configurable), and /money <player> command to check balances.

owcakkk

add a feature that it will display your current money in actionbar all the time

Kodari AI
KodariMar 4 at 4:17 pm 9,634 (v2)

I’ll add a feature to continuously display the player’s money in the actionbar. Let me first check the existing code structure.

Now I’ll create an ActionbarManager to continuously display money in the actionbar.

Actionbar money display feature added. The actionbar will continuously show each player’s current money balance, updating every second with the message format from config.yml.

owcakkk

edit the plugin to this functionality: when you kill someone it will drop a money item, you can use the item to right click and you can obtain the money. dont add the feature to automatically add on kill

Kodari AI
KodariMar 4 at 4:22 pm 13,097 (v2)

I’ll modify the plugin to drop a money item on kill that can be right-clicked to claim the money.

Now I’ll modify the plugin to drop money items on kill that must be right-clicked to claim:

Plugin modified successfully. Now when a player kills another player, a money item drops. The killer (or anyone) can right-click the money item to claim the currency value.

owcakkk

add a money steal feature on kill, and add a command to reset the players balance to starting balance

Kodari AI
KodariMar 4 at 4:31 pm 10,892 (v2)

I’ll add a money steal feature on kill and a command to reset player balances. Let me first check the existing code structure.

Now I’ll add the money steal feature on kill and a reset command.

Plan:

  1. Update PlayerDeathListener to steal money from victim and give to killer

  2. Add reset subcommand to MoneyCommand with permission check

  3. Add config option to enable/disable money steal

Money steal feature and reset command added. Players now lose money on death (transferred to killer), and admins can use /money reset <player> to reset balances to starting amount. The feature can be toggled in config with money-steal-enabled.

owcakkk

remove the feature to automaticly add balance on kill, just do with the item to claim it only

Kodari AI
KodariMar 4 at 4:39 pm 7,126 (v2)

I’ll read the relevant files to understand the current implementation and remove the automatic balance addition on kill.

I’ll remove the automatic balance addition on kill, keeping only the money item drop that players must pick up to claim.

Removed automatic balance addition on kill. Now money is only obtained by picking up the dropped money item.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
12 564
src/main/java/com/smpmoney/SMPMoney.java
package com.smpmoney;

import com.smpmoney.command.MoneyCommand;
import com.smpmoney.listener.MoneyItemListener;
import com.smpmoney.listener.PlayerDeathListener;
import com.smpmoney.listener.PlayerJoinListener;
import com.smpmoney.manager.ActionbarManager;
import com.smpmoney.manager.ConfigManager;
import com.smpmoney.manager.MoneyManager;
import com.smpmoney.manager.PlayerDataManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class SMPMoney extends JavaPlugin {
    
    private ConfigManager configManager;
    private MoneyManager moneyManager;
    private PlayerDataManager playerDataManager;
    private ActionbarManager actionbarManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.configManager = new ConfigManager(this);
        this.moneyManager = new MoneyManager(this);
        this.playerDataManager = new PlayerDataManager(this);
        this.actionbarManager = new ActionbarManager(this);
        
        getServer().getPluginManager().registerEvents(new PlayerDeathListener(this), this);
        getServer().getPluginManager().registerEvents(new PlayerJoinListener(this), this);
        getServer().getPluginManager().registerEvents(new MoneyItemListener(this), this);
        
        getCommand("money").setExecutor(new MoneyCommand(this));
        
        getLogger().info("SMPMoney has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (actionbarManager != null) {
            actionbarManager.stop();
        }
        if (playerDataManager != null) {
            playerDataManager.saveAll();
        }
        getLogger().info("SMPMoney has been disabled!");
    }
}