August 5, 2026 · The Minely team
How to make an RPG classes plugin with AI (abilities, mana, cooldowns)
Classes are the fastest way to make combat feel like a game instead of a gear check. Warrior, Mage, Archer — each with a couple of abilities on cooldowns and a mana bar to spend — gives players an identity in the first five minutes. The engineering is small; the discipline is in cooldowns and resource rules.
What an RPG classes plugin actually is
An RPG classes plugin lets players pick a class with its own abilities and playstyle. Abilities trigger on items or clicks, cost mana or energy, and run on cooldowns so they stay special. Each class also gets a passive — something subtle that makes it feel different between fights, not just during them.
How it works under the hood
The ability system is a registry: ability id, trigger (right click with item X, sneak, left click), cost, cooldown, and an execute function. The mana system is a per-player value regenerating on a scheduler, displayed on the XP bar or a boss bar. Class selection stores the choice with a swap cooldown to prevent mid-fight class hopping. The bug factory is cooldown drift across relogs — store timestamps, not remaining ticks.
The prompt that builds it
You do not have to write this yourself. A precise description is enough:
an RPG classes plugin with /class pick, three classes with two abilities each on right click, mana that regenerates, per-ability cooldowns, and a class swap cooldown
Name the commands, the permissions, and the exact messages players see. Precision here is what makes the first build land close.
Building it in the right order
- Create the class model and /class pick with a GUI.
- Implement the ability registry with triggers, costs, and cooldowns.
- Add mana: regen task, spend checks, and a display bar.
- Write the six abilities (two per class) with clear effects.
- Add passives and the class swap cooldown.
The details that matter in production
In production, the first thing you learn is that the happy path is the easy half. The edges are where the work lives: restarts, protection interactions, full inventories, and players who treat every system like an exploit puzzle. Build for those from day one and the launch weekend is quiet instead of a fire drill.
Storage and cleanup deserve special attention. Write state as it changes rather than on shutdown, clear per-player state on quit and on world change, and make every admin-facing action leave an audit line. The first time something goes wrong, those records are the difference between a two-minute review and an evening of guessing.
Finally, test like a hostile user. Spam-click every GUI, rejoin mid-action, try the command with no permission and with every permission, and run it while the server is under load. The bugs that survive that pass are the ones worth shipping.
Tuning it after the first build
Abilities should be strong but not decisive: a dash that covers 5 to 8 blocks, a heal for 2 to 4 hearts, a burst for 1.5x a normal hit. Cooldowns of 8 to 20 seconds keep them part of combat rather than the whole of it. Mana pools of 50 to 100 with ability costs of 15 to 35 give real choices.
Tips that save you a rebuild
- Store cooldowns as timestamps so relogs and lag never grant free resets.
- Play a sound and show an actionbar hint when an ability is on cooldown — silence reads as broken.
- Cap one ability per trigger slot; two abilities on one click is the classic double-cast bug.
- Test abilities against protection plugins before launch day.
Questions people ask
How do I add a fourth class?
Ask with its abilities and passive: "add a rogue class with a dash and a backstab, mana 60, plus a speed passive". It slots into the same registry.
Can abilities be upgraded?
Yes — an upgrade path per ability with levels in config, raising effect and cost together.
What stops macro spam?
Server-side cooldown checks on every cast — never trust the client.
Try the prompt above on a fresh project. You will see the plan, the code streaming in, and the repair loop finish the job — then a jar to download.
