Ноу Нейм

Write a plugin that adds the "/bonus" command, which will allow a player to receive a certain number of coins corresponding to their privilege. The cooldown for the command is 24 hours. To use this command, the player must have played for 1 hour on the server. The number of coins and the cooldown related to the privilege can be configured in the plugin’s config file. Create a command that reloads the plugin. Also, make it possible to configure the interline messages that the player will receive when entering this command. 26.2 paper

Kodari AI
KodariOct 11 at 8:36 pm 1
PrivilegeBonusCoins
Adds a /bonus command granting coins based on player privilege with a configurable 24-hour cooldown. Requires 1 hour of playtime before use. Config file allows adjusting coin amounts, cooldown duration, and all player-facing messages. Includes a /bonusreload command to reload configuration without restarting the server. Built for Paper 26.2, storing playtime and last claim timestamps persistently.
  1. Create the Paper 26.2 Gradle project and plugin descriptor.

  2. Add /bonus claims with privilege-based coin amounts/cooldowns, one-hour playtime eligibility, and persistent balances/cooldowns.

  3. Add /bonus reload and /bonusreload, with configurable player messages.

Created BonusCoins for Paper 26.2. /bonus awards the player’s configured privilege bonus after at least one hour of playtime; /bonus reload and /bonusreload reload the configuration. Privilege permissions, coin amounts, cooldowns, and player messages are configurable in config.yml.

Coin balances and claim timestamps are saved in player-data.yml. Coins are tracked by this plugin; they are not connected to an external economy plugin.

Ноу Нейм

Make it so that the plugin provides currency for the vault (essentials) plugin. Add a command that will reset the cooldown for the bonus for the player.

Kodari AI
KodariOct 11 at 8:52 pm 1
  1. Connect bonus rewards to the Vault economy provider.

  2. Add a command to reset a player’s bonus cooldown.

  1. Bonus claims now deposit coins into the Vault economy, so they appear in balances managed by EssentialsX. Vault and a Vault-compatible economy provider must be installed.

  2. Added /bonus reset <player> to clear that player’s cooldown. It requires bonus.admin; the success and error messages are configurable.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
settings.gradle
Code
8 346
src/main/java/com/kodari/bonus/BonusPlugin.java
package com.kodari.bonus;

import net.milkbowl.vault.economy.Economy;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;

public final class BonusPlugin extends JavaPlugin {
    private BonusDataStore dataStore;
    private Economy economy;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        RegisteredServiceProvider<Economy> economyProvider = getServer().getServicesManager().getRegistration(Economy.class);
        if (economyProvider == null || economyProvider.getProvider() == null) {
            getLogger().severe("No Vault economy provider found. Install an economy plugin such as EssentialsX and restart.");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }
        economy = economyProvider.getProvider();
        dataStore = new BonusDataStore(this);

        BonusCommand bonusCommand = new BonusCommand(this, dataStore, economy);
        PluginCommand bonus = getCommand("bonus");
        PluginCommand reload = getCommand("bonusreload");
        if (bonus == null || reload == null) {
            getLogger().severe("Commands are missing from plugin.yml; disabling plugin.");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }

        bonus.setExecutor(bonusCommand);
        reload.setExecutor(bonusCommand);
    }

    @Override
    public void onDisable() {
        if (dataStore != null) {
            dataStore.save();
        }
    }
}