velarain
📎 1 file 5,331 chars
📄
pasted-code-1784697730269.txt
txt 419 lines
▶
Create a Minecraft Paper 1.21.11 plugin named "Ashhollow Magic".

==================================================
IMPORTANT PLUGIN STRUCTURE
==================================================

Create this as a STANDALONE plugin.

Do NOT combine this plugin with:

Ashhollow Kingdoms code
Kingdom management
Ruler system
Relics
Kingdom commands

A separate plugin called "Ashhollow Kingdoms" will handle kingdoms.

This plugin ONLY handles:

Origins
Species
Origin abilities
Magic system
Savior system


Create API support to connect with Ashhollow Kingdoms.

==================================================
MAGIC SYSTEM CORE
==================================================

Create the command:

/magic


Players can open the magic menu.

Show:

Current origin
Species description
Abilities
Magic status
Cooldowns


==================================================
ORIGIN SYSTEM
==================================================

When a new player joins:

Do NOT automatically give Savior.

Players choose their origin.

Create an origin selection menu.


Each origin must display:

Name
Description
Advantages
Disadvantages
Passive abilities
Active ability


After selecting:

Save origin permanently.
Apply origin traits.
Send kingdom information to Ashhollow Kingdoms API.


==================================================
ORIGIN LIST
==================================================


🌑 SHADOW KINGDOM


Vampire

Description:
A night creature with blood magic and enhanced senses.

Advantages:
Stronger at night.
Fast movement.
Blood abilities.

Disadvantages:
Slightly weakened by sunlight.
Cannot stay in sunlight too long.


Shadeborn

Description:
A being connected to living shadows.

Ability:
Shadow Meld.


Nightfang

Description:
A shadow hunter with beast-like abilities.

Ability:
Predator Strike.


Ravenfolk

Description:
A mysterious winged shadow species.

Ability:
Dark Flight.


Warlock

Description:
A forbidden magic user.

Ability:
Dark Curse.



🌿 NATURE KINGDOM


Dryad

Ability:
Nature Blessing.


Sylvan Elf

Ability:
Forest Arrow.


Dwarf

Description:
A small but strong underground race.

Size:
Around 1 block tall.

Advantages:
Strong resistance.
Mining ability.

Disadvantages:
Slower movement.


Ability:
Ancient Stone.


Treantkin

Ability:
Ancient Roots.


Nature Catkin

Description:
A feline species blessed by nature spirits.

Ability:
Spirit Pounce.



❄ ICE KINGDOM


Frostborn

Ability:
Frost Armor.


Snow Elf

Ability:
Ice Lance.


Crystalborn

Ability:
Crystal Barrier.


Winter Wolfkin

Ability:
Frozen Fang.


Glacier Giantkin

Ability:
Frozen Ground.



🌊 WATER KINGDOM


Merfolk

Advantages:
Breathe underwater.
Swim faster.

Disadvantages:
Needs water support.

Ability:
Ocean Current.


Siren

Ability:
Ocean Song.


Tideborn

Ability:
Wave Control.


Coralfolk

Ability:
Coral Shield.


Abyssal Fisherkin

Ability:
Deep Sea Vision.



🔥 FIRE KINGDOM


Emberkin

Ability:
Flame Burst.


Phoenixborn

Ability:
Phoenix Rebirth.


Ifrit

Ability:
Inferno Hand.


Ashwalker

Ability:
Ash Storm.


Magmaborn

Ability:
Magma Armor.



==================================================
MAGIC COMMANDS
==================================================

/magic

Open magic menu.


/magic origin

Choose origin if allowed.


/magic info

Show origin information.


/magic toggle

Enable or disable magic abilities.
==================================================
SAVIOR SYSTEM
==================================================

Savior is NOT a selectable origin.

Only the server owner/admin can grant Savior.


Admin command:

/magic savior set 


Requires LuckPerms permission:

ashhollow.magic.savior


When a player becomes Savior:

Remove previous origin abilities.
Replace them with Savior abilities.
Mark player as Savior.


==================================================
MAGIC ACTIVATION
==================================================

Abilities should NOT activate by hitting the ground.

Create proper activation methods:

Ability menu.
Keybind support if possible.
Commands.

Abilities require:

Cooldowns.
Proper effects.
Permission checks.


==================================================
KINGDOM CONNECTION
==================================================

Connect with Ashhollow Kingdoms.

When origin is selected:

Send:

Player UUID
Origin name
Kingdom element


Example:

Vampire → Shadow

Dwarf → Nature

Phoenixborn → Fire

Merfolk → Water

Frostborn → Ice


==================================================
DATA STORAGE
==================================================

Save:

Player UUID
Origin
Abilities
Magic enabled/disabled
Savior status


==================================================
PLUGIN QUALITY
==================================================

Requirements:

Paper 1.21.11 compatible.
Optimized.
No placeholder code.
No TODO.
Proper command registration.
Complete Java source code.
Kodari AI
KodariJul 22 at 5:25 am 19
AshhollowMagic
A standalone Paper 1.21.11 magic plugin for origin-based character abilities. Players choose and permanently save one of 25 elemental origins across Shadow, Nature, Ice, Water, and Fire, then inspect abilities, descriptions, traits, cooldowns, and magic status through interactive menus. Abilities activate from the menu, command, or swap-hand keybind with cooldowns, effects, permissions, and persistence. Authorized administrators can grant the non-selectable Savior role, while a public event and service API connect origin selections to Ashhollow Kingdoms.
  1. Project foundation: create the Gradle build, plugin metadata, configuration, and persistent player data model.

  2. Magic domain: add all origins, ability execution, cooldowns, Savior handling, and the Ashhollow Kingdoms-facing API event/service.

  3. Player interface: add reusable inventory GUI infrastructure, magic/origin menus, command handling, and keybind/event listeners.

A standalone Paper 1.21.11 magic plugin providing permanent origin selection, elemental species abilities, passive traits, cooldown management, configurable magic toggling, inventory-based menus, command and keybind activation, and persistent player data. It includes a non-selectable Savior system controlled by LuckPerms permissions and exposes an API plus origin-selection events for integration with the separate Ashhollow Kingdoms plugin.

Implemented the Ashhollow Magic plugin with:

  • All 25 requested origins across Shadow, Nature, Ice, Water, and Fire.

  • Permanent origin selection through /magic origin.

  • /magic, /magic info, /magic toggle, and /magic ability.

  • Savior granting via /magic savior set <player>.

  • LuckPerms permission checks.

  • Active abilities with cooldowns, effects, damage, particles, sounds, and keybind activation.

  • Persistent YAML player data for origins, abilities, magic state, and Savior status.

  • Inventory GUI framework with magic and origin menus.

  • Ashhollow Kingdoms integration through OriginSelectedEvent and a registered public API.

  • Paper 1.21.11 metadata, Gradle configuration, XSeries compatibility, and default configuration.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
24 1,360
src/main/java/com/ashhollow/magic/AshhollowMagicPlugin.java
package com.ashhollow.magic;

import com.ashhollow.magic.api.AshhollowMagicAPI;
import com.ashhollow.magic.data.MagicDataStore;
import com.ashhollow.magic.gui.GUIListener;
import com.ashhollow.magic.gui.GUIManager;
import org.bukkit.Bukkit;
import org.bukkit.plugin.ServicePriority;
import org.bukkit.plugin.java.JavaPlugin;

public class AshhollowMagicPlugin extends JavaPlugin {
    private MagicDataStore dataStore;
    private MagicManager magicManager;
    private AshhollowMagicAPI api;

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

        dataStore = new MagicDataStore(this);
        KingdomsIntegration kingdomsIntegration = new KingdomsIntegration(this);
        magicManager = new MagicManager(this, dataStore, kingdomsIntegration);
        api = new AshhollowMagicAPI(magicManager);

        GUIManager guiManager = new GUIManager();
        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
        Bukkit.getPluginManager().registerEvents(new MagicListener(magicManager), this);
        Bukkit.getServicesManager().register(AshhollowMagicAPI.class, api, this, ServicePriority.Normal);

        MagicCommand magicCommand = new MagicCommand(magicManager, guiManager);
        getCommand("magic").setExecutor(magicCommand);
        getCommand("magic").setTabCompleter(magicCommand);
    }

    @Override
    public void onDisable() {
        if (dataStore != null) {
            dataStore.saveAll();
        }
        Bukkit.getServicesManager().unregister(AshhollowMagicAPI.class, api);
    }
}