ansh.70

Make a gacha plugin that will let players do a gacha every 1 hours using /SummonGachaNpc the op player can summon the gacha npc where he's standing the gacha should give player 1 random 24 ores and using /resetGachaTimer the op player can reset timer of a specific player

Kodari AI
KodariJan 13 at 5:35 pm

I’ll create a gacha plugin with NPC interaction and timed rewards.

GachaNpc
A gacha system plugin featuring an interactive NPC that distributes random ores to players every hour. Operators can summon the gacha NPC at their location and manage player cooldown timers. The system includes 24 different ore types, automatic cooldown tracking, and persistent data storage to ensure timers survive server restarts.
Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
6 293
src/main/java/com/gachanpc/GachaNpc.java
package com.gachanpc;

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

@Getter
public class GachaNpc extends JavaPlugin {
    
    private CooldownManager cooldownManager;
    private NpcManager npcManager;
    private ConfigManager configManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.configManager = new ConfigManager(this);
        this.cooldownManager = new CooldownManager(this);
        this.npcManager = new NpcManager(this);
        
        getCommand("SummonGachaNpc").setExecutor(new SummonNpcCommand(this));
        getCommand("resetGachaTimer").setExecutor(new ResetTimerCommand(this));
        
        getLogger().info("GachaNpc has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (npcManager != null) {
            npcManager.removeNpc();
        }
        if (cooldownManager != null) {
            cooldownManager.saveCooldowns();
        }
        getLogger().info("GachaNpc has been disabled!");
    }
}