themonugg_og

Ability Token System — Additional Requirements

Add a custom Ability Token System to MysticGems.

Every player must receive a physical token representing their assigned ability.

Ability Token

Each ability must have its own unique token.

The token must:

  • Represent the player's current ability.
  • Have a unique display name.
  • Have a unique appearance/skin.
  • Have custom lore describing the ability and level.
  • Be visually distinguishable from normal Minecraft items.
  • Be bound to the player who owns it.

The token should preferably use a custom resource-pack/model system if supported.

If a resource pack is required, create the necessary model/item configuration and clearly explain how to install it.

---

Token Inventory Requirement

The player's ability token MUST remain in their inventory.

The player must NOT be able to:

  • Drop the token.
  • Throw the token.
  • Move it to another player's inventory.
  • Put it inside a chest.
  • Put it inside a shulker box.
  • Put it inside a hopper.
  • Give it to another player.
  • Sell or trade it.

If the player attempts to move or drop the token, cancel the action.

If the token somehow disappears due to an unexpected event, automatically restore it to the player's inventory.

Do not duplicate tokens.

Each player should have exactly one active ability token.

---

Orbiting Token Visual Effect

Even though the token remains in the player's inventory, create a visual representation of the token that continuously orbits around the player.

The token should visually rotate around the player in a circular orbit.

Requirements:

  • Smooth orbit movement.
  • Configurable orbit radius.
  • Configurable orbit height.
  • Configurable orbit speed.
  • Smooth rotation.
  • No excessive entity spawning.
  • Avoid creating unnecessary lag.
  • Automatically remove the visual token when the player leaves.
  • Automatically recreate it when the player joins.
  • Remove all visual entities when the plugin is disabled.

Example configuration:

ability-token: enabled: true

orbit: radius: 1.25 height: 1.2 speed: 1.5

prevent-drop: true prevent-storage: true auto-restore: true

---

Token Appearance / Skin

Every ability must have a unique token appearance.

For example:

  • GGs OGs → Legendary golden token
  • Fire ability → Burning red/orange token
  • Ice ability → Frozen blue token
  • Lightning ability → Electric purple/yellow token
  • Shadow ability → Dark shadow token
  • Guardian ability → Defensive crystal token

The token appearance must match the ability theme.

For the GGs OGs ability specifically, create a special legendary token skin that looks more powerful than the other tokens.

---

Token Level Appearance

The token should visually change depending on the ability level.

Level 1

Basic ability token appearance.

Level 2

Enhanced appearance with additional particles/effects.

Level 3

Legendary appearance with stronger particles, glow, and visual effects.

When the player reaches a new level, automatically update the token's appearance.

---

Token Interaction

The token itself should NOT be required to be held in the player's hand to use the ability.

The player should be able to activate their ability using the previously defined activation method while the token remains in their inventory.

The orbiting visual token is purely a visual representation and must not interfere with normal gameplay.

---

Performance Requirements

The orbit system must be optimized.

Do NOT spawn hundreds of entities.

Prefer an efficient visual implementation such as:

  • Display entities
  • Item display entities
  • Particles
  • Other modern Paper-compatible visual APIs

Use the most efficient approach compatible with Minecraft 1.21.11.

Clean up all visual entities properly.

Do not create permanent entities that remain after the plugin is disabled.

---

Security / Anti-Duplication

The ability token must be securely bound to the player's UUID.

A copied or renamed normal Minecraft item must NOT be recognized as a valid ability token.

Use persistent data/NBT/PDC data to identify legitimate MysticGems tokens.

The plugin must prevent:

  • Token duplication
  • Token transfer
  • Token theft
  • Token storage
  • Token dropping
  • Fake token creation

---

Final Token Requirement

Every player should have:

1 Ability + 1 Ability Token + 1 Orbiting Visual Token

The token must remain safely in the player's inventory while its visual representation continuously orbits around them.

The system must work correctly after:

  • Server restart
  • Player relog
  • Plugin reload
  • Ability reroll
  • Ability level-up
  • "/mg start"
  • "/mg stop"

The token and its orbiting visual must always stay synchronized with the player's current ability and level.

Kodari AI
KodariAug 21 at 3:28 pm 3
  1. Create the Gradle/Paper project and plugin metadata.

  2. Add persistent ability profiles, activation, reroll, level-up, and /mg commands.

  3. Add UUID-bound token creation, anti-transfer protection, restoration, and synchronization.

  4. Add one-entity-per-player orbit visuals with configurable movement and cleanup.

  5. Add configuration and installation notes, including the optional model-data resource-pack path.

  1. Created the Paper 1.21.11 MysticGems project with Java 21 Gradle configuration and plugin metadata.

  2. Added persistent abilities, activation, rerolling, leveling, /mg commands, cooldowns, and restart-safe player profiles.

  3. Added UUID-bound ability tokens with persistent data, unique materials, lore, glow, model-data values, owner binding, anti-duplication, and automatic restoration.

  4. Added protection against dropping, trading, inventory movement, chests, shulkers, hoppers, pickup, death drops, and duplicate tokens.

  5. Added optimized one-ItemDisplay orbit visuals per player with configurable radius, height, speed, particles, refresh behavior, and shutdown cleanup.

  6. Added README documentation covering installation, commands, token behavior, and optional resource-pack model-data ranges.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
README.md
settings.gradle
Code
13 1,012
src/main/java/com/mysticgems/MysticGemsPlugin.java
package com.mysticgems;

import com.mysticgems.ability.AbilityManager;
import com.mysticgems.command.MysticGemsCommand;
import com.mysticgems.listener.MysticGemsListener;
import com.mysticgems.token.AbilityTokenManager;
import com.mysticgems.visual.OrbitManager;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public class MysticGemsPlugin extends JavaPlugin {
    private AbilityManager abilityManager;
    private AbilityTokenManager tokenManager;
    private OrbitManager orbitManager;

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

        this.abilityManager = new AbilityManager(this);
        this.abilityManager.load();
        this.tokenManager = new AbilityTokenManager(this, abilityManager);
        this.orbitManager = new OrbitManager(this, abilityManager, tokenManager);

        MysticGemsListener listener = new MysticGemsListener(this, abilityManager, tokenManager, orbitManager);
        Bukkit.getPluginManager().registerEvents(listener, this);

        MysticGemsCommand command = new MysticGemsCommand(this, abilityManager, tokenManager, orbitManager);
        if (getCommand("mg") != null) {
            getCommand("mg").setExecutor(command);
            getCommand("mg").setTabCompleter(command);
        }

        orbitManager.start();
        Bukkit.getScheduler().runTaskTimer(this, () -> {
            if (!tokenManager.isAutoRestoreEnabled()) {
                return;
            }
            Bukkit.getOnlinePlayers().forEach(tokenManager::reconcile);
        }, 20L, 20L);
    }

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

    public void reloadSettings() {
        reloadConfig();
        tokenManager.reloadSettings();
        orbitManager.reloadSettings();
    }

    public AbilityManager getAbilityManager() {
        return abilityManager;
    }

    public AbilityTokenManager getTokenManager() {
        return tokenManager;
    }

    public OrbitManager getOrbitManager() {
        return orbitManager;
    }
}