spyoncurse

Make a plugin with powers and gems

Kodari AI
KodariApr 16 at 8:10 am 16,383 (v2)

I’ll create a plugin with a gem currency system and special powers that players can unlock and activate.

GemPowers
A mystical powers plugin where players collect and spend gems to unlock special abilities. Features multiple gem types (ruby, sapphire, emerald, diamond), unlockable powers with unique effects, cooldown and duration management, persistent player data, and an intuitive GUI for power management. Powers can grant flight, speed, strength, invisibility, and other effects. Includes admin commands for gem management and full configuration control.

I’ll create a complete gem and power system with:

  • Multiple gem types as currency

  • Unlockable powers with gem costs

  • Power activation with cooldowns and durations

  • GUI for power management

  • Data persistence

  • Admin commands

All files created! This plugin features:

  • Multiple gem types (ruby, sapphire, emerald, diamond) as currency

  • Six unlockable powers (speed, strength, flight, invisibility, resistance, regeneration)

  • Power system with durations and cooldowns

  • Interactive GUI for managing powers with visual status indicators

  • Commands: /gems (view balance), /powers (open GUI), /gempowers (admin)

  • Admin commands for giving/taking gems and reloading config

  • Persistent data saved per player in YAML files

  • Starting gems given to new players

  • Full XSeries integration for cross-version compatibility

Players unlock powers by spending gems, then activate them with cooldowns between uses!

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
17 1,274
src/main/java/com/gempowers/GemPowers.java
package com.gempowers;

import com.gempowers.commands.GemsCommand;
import com.gempowers.commands.GemPowersCommand;
import com.gempowers.commands.PowersCommand;
import com.gempowers.listeners.PlayerJoinListener;
import com.gempowers.listeners.PlayerQuitListener;
import com.gempowers.managers.ConfigManager;
import com.gempowers.managers.GemManager;
import com.gempowers.managers.PlayerDataManager;
import com.gempowers.managers.PowerManager;
import com.gempowers.tasks.PowerTask;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class GemPowers extends JavaPlugin {

    private ConfigManager configManager;
    private PlayerDataManager playerDataManager;
    private GemManager gemManager;
    private PowerManager powerManager;
    private PowerTask powerTask;

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

        this.configManager = new ConfigManager(this);
        this.playerDataManager = new PlayerDataManager(this);
        this.gemManager = new GemManager(this);
        this.powerManager = new PowerManager(this);

        getCommand("gems").setExecutor(new GemsCommand(this));
        getCommand("powers").setExecutor(new PowersCommand(this));
        getCommand("gempowers").setExecutor(new GemPowersCommand(this));

        getServer().getPluginManager().registerEvents(new PlayerJoinListener(this), this);
        getServer().getPluginManager().registerEvents(new PlayerQuitListener(this), this);

        this.powerTask = new PowerTask(this);
        this.powerTask.runTaskTimer(this, 20L, 20L);

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

    @Override
    public void onDisable() {
        if (powerTask != null) {
            powerTask.cancel();
        }

        if (playerDataManager != null) {
            playerDataManager.saveAll();
        }

        getLogger().info("GemPowers has been disabled!");
    }
}