W

and the planet abilitys as a echo shard with custom model data and name the plugin UnionSMP

📎 1 file 2,760 chars
📄
pasted-code-1775100054896.txt
txt 61 lines
▶
Create a Minecraft Paper 1.21.x plugin called "SolarInfuse" with the following features:

🌌 CORE
On first join, assign each player one planet randomly.
Multiple players can have the same planet.
Planet assignments saved in PersistentDataContainer or YAML.
Show title, chat, and sound when a planet is assigned.
🪐 PLANETS & ABILITIES
Mercury (Speed): Speed II, dash forward, yellow streak particles
Venus (Fire): Fire resistance, ignite nearby enemies, flame particles, no Slowness in lava
Earth (Life): Regeneration I, heal self + allies, green particles
Mars (Strength): Strength I, temporary Strength II, red dust particles
Saturn (Gas): Slow falling, knockback gas burst, cloud rings
Jupiter (Magnetism): Pull items/players, electric orbit particles
Uranus (Ice): Frost walker, freeze nearby enemies, snowflake particles
Neptune (Wind): Jump boost, launch/glide, cloud + wind spiral particles
✨ PARTICLES
Advanced particle animations (rings, spirals, trails) per planet
Particles do not loop forever; duration, distance, and visibility configurable in config.yml
Particles visible but do not block player view
Smooth loops via schedulers
💎 GEMS SYSTEM (Offense, Defense, Neutral, Planet Passive)
Each gem has 4 abilities:
Neutral passive (always active) → minor constant effect visible to player
Level 1 ability (offense/active) → powerful effect with cooldown
Level 2 ability (defense/active) → secondary effect with cooldown
Always-active inherent planet passive → innate effect (e.g., Fire Resistance and no Slowness in lava for Fire gem)
Example: Mars Fire Gem
Neutral: Fire Resistance (infinite)
Offense: Fire damage reflects to nearby players
Defense: Fire damage reflects back to attacker
Planet inherent passive: Strength boost or dash
Abilities trigger via right-click or special conditions
Cooldowns, levels, and passive visibility configurable in config.yml
🎮 PLAYER SYSTEM
Assign planet on first join
Save player planet in PersistentDataContainer/YAML
Show planet on join with title, chat, and sound
🛠 COMMANDS
OP only:
/setplanet  
/resetplanet 
/giveplanet  
/reloadplugin
Player command:
/plugininfo → shows current planet, gem abilities, neutral passive, cooldowns
🪄 CUSTOM ITEM
Reroller: craftable book item
Right-click rerolls the player’s planet randomly
Recipe configurable in plugin
⚙️ CONFIGURATION
Cooldowns, ability strengths, particle settings, gem levels, and neutral passives configurable in config.yml
Particle duration, distance, and visibility adjustable per planet

✅ This includes everything:

Neutral passive always active
Level 1 offense, Level 2 defense
Planet inherent passive (e.g., Fire gem → Fire Resistance + no Slowness in lava)
Reroller as a book
Configurable particles
Kodari AI
KodariApr 2 at 3:29 am 34,573 (v2)
UnionSMP
A Minecraft SMP plugin that assigns each player one of 8 planets on first join, each with unique passive effects and two active abilities (L1 offense, L2 defense) activated via Echo Shard items with custom model data. Features include configurable particle effects (rings, spirals, trails), a craftable planet Reroller book, full admin commands for planet management, per-player cooldown tracking, YAML-based data persistence, and a /plugininfo command displaying all ability details and cooldowns.
  • 8 planets each with neutral passive, L1 offense, L2 defense, and innate planet passive — all tied to an Echo Shard with per-planet custom model data

  • Particle effects (rings, spirals, trails) per ability; passive scheduler keeps effects active; special handling for frost walk, no-fall, lava slowness immunity, magnetism

  • Full admin commands, reroller recipe, YAML storage, and config-driven cooldowns/particle settings

All 17 files created — UnionSMP plugin with 8 planets (Mercury, Venus, Earth, Mars, Saturn, Jupiter, Uranus, Neptune), each with a persistent neutral passive applied via scheduler, an L1 offense and L2 defense triggered by right-clicking / shift+right-clicking the planet’s Echo Shard (custom model data 1001–1008), advanced particle effects (rings and spirals) per ability, frost-walk and fall-damage immunity handled in event listeners, a craftable Planet Reroller book (Nether Star surrounded by Books), full admin commands (/setplanet, /resetplanet, /giveplanet, /reloadplugin), and a /plugininfo command showing the player’s planet, all ability descriptions, and live cooldown countdowns — all fully configurable in config.yml.

W

Update the plugin with the following features:

Fix all bugs.

Add one main OP command: /unionsmp Test → tests everything, allows choosing what to test.

Add death-based planet state system: -3 = shattered -2 → -1 = big cracks + little chunks off 0 → 1 = small cracks 2 → 4 = intact, no cracks (start here) 5 = energized Keep all existing commands like /set ability to assign abilities manually.

Add OP-only reset command: /unionsmp reset confirm → resets everything, reassigns planets to all players (rerolls them).

Add OP-only command to test all planets: /unionsmp set all Planets <player> → sets every planet for the target player for testing.

Make sure all commands and the planet states work correctly, and everything is fully functional for testing purposes.

Kodari AI
KodariApr 2 at 3:40 am 32,389 (v2)

Let me read all existing files first.

Now I have a complete picture. Here’s my plan:

  • Add PlanetState enum (-3 to 5) and integrate into PlayerData + PlanetManager (save/load state)

  • Add DeathListener to decrement state on death; add state-gating logic to AbilityManager

  • Create full /unionsmp command with test, reset confirm, set ability, set all planets, set state subcommands

  • Fix bugs: THORNS is not a potion effect, PotionEffectType.getByName fragility in PassiveListener, unused interval variable in scheduler

  • Update plugin.yml, config.yml, UnionSMP.java, InfoCommand.java

Here’s a summary of everything added and fixed:

New features:

  • PlanetState enum covering all 9 states (-3 to 5) with ability gating: shattered blocks everything, -2/-1 blocks L2 only, energized (5) halves all cooldowns

  • DeathListener decrements planet state on each death (min -3), plays contextual sounds

  • /unionsmp master command with full tab-completion: test [abilities l1/l2 | particles | passives | state | planet <name>], set [planet | ability | state | all planets] <player>, reset confirm, reload

  • Planet state is saved/loaded per-player in players.yml under .state

  • InfoCommand now shows current state, description, and whether abilities are blocked

Bugs fixed:

  • THORNS removed from executeEarthL2 (not a potion effect) — replaced with REGENERATION

  • PotionEffectType.getByName() in PassiveListener replaced with a safe XPotion-resolved type cached at construction time

  • Unused interval variable in startPassiveScheduler fixed — now correctly passed to runTaskTimer

  • AbilityManager.applyEffect overload added for LivingEntity (was already there but now cleanly separated from Player version)

W

fixthe bug where when i do /unionsmp reset confirm make it where it will remove the planet i have and reward me with the new one

Kodari AI
KodariApr 2 at 3:43 am 24,582 (v2)

The bug is clear: in handleReset, resetAll() clears all data but then assignRandom gives a new planet — however it never removes the old PlanetAbilityItem from the player’s inventory before adding the new one. I need to remove the old shard item from each online player’s inventory before giving the new one.

Now I have everything I need. The fix: in handleReset, before giving each online player their new planet item, remove any existing PlanetAbilityItem from their inventory.

The fix iterates each online player’s inventory before assigning a new planet, removes any existing PlanetAbilityItem (identified by custom model data), then assigns the new random planet and gives the fresh shard — so players no longer stack old and new planet items after /unionsmp reset confirm.

W

now make all the planets with cool particles and beam abilitys

Kodari AI
KodariApr 2 at 3:49 am 29,329 (v2)

Let me read all the relevant files first.

Now I have a complete picture of everything. Here’s my plan:

  • ParticleManager: Full rework — unique per-planet particles, animated beam method that returns hit entities, orbit aura effect called from a scheduler

  • AbilityManager: L1 abilities get beam attacks (CRIT beam, fire beam, lava beam, ice beam, etc.), updated with hit entity logic from beam return value

  • UnionSMP: Add orbit particle scheduler (every 5 ticks)

  • Planet: Fix Earth particle (COMPOSTER→HAPPY_VILLAGER), Neptune (CLOUD→NAUTILUS)


Here’s what changed across all 4 files:

  • Planet.java — Fixed Earth’s particle from COMPOSTER→HAPPY_VILLAGER, Neptune from CLOUD→NAUTILUS, and updated all ability descriptions to reflect the new beam attacks

  • ParticleManager.java — Fully reworked: each planet now has a unique dual-particle identity (primary + secondary), unique animated spawnAbilityEffect per planet (Mercury shoots expanding crit rings, Saturn fires growing concentric gas rings, Jupiter does inward-collapsing spirals, Uranus stacks 3 horizontal ice rings, Venus rotates fire rings upward, etc.), a spawnBeam() method that draws a dense particle ray in the player’s look direction and returns every LivingEntity pierced by it, and spawnOrbit() for ambient rotating particles around the player

  • AbilityManager.java — All L1 abilities now fire a themed beam: Mercury’s crit beam knocks back anything it hits; Venus’s flame beam ignites+damages; Earth’s life beam heals ally players and damages undead mobs; Mars’s lava lance deals 5 damage and ignites; Jupiter’s electric beam pulls all pierced entities toward the player; Uranus’s frost beam applies Slowness V; Neptune’s wind cannon launches every hit entity skyward with Levitation

  • UnionSMP.java — Added startOrbitScheduler() running every 5 ticks so all online players show their planet’s orbiting particles passively

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
20 2,381
src/main/java/com/unionsmp/UnionSMP.java
package com.unionsmp;

import com.unionsmp.commands.AdminCommand;
import com.unionsmp.commands.InfoCommand;
import com.unionsmp.commands.UnionCommand;
import com.unionsmp.data.Planet;
import com.unionsmp.listeners.AbilityListener;
import com.unionsmp.listeners.DeathListener;
import com.unionsmp.listeners.JoinListener;
import com.unionsmp.listeners.PassiveListener;
import com.unionsmp.managers.AbilityManager;
import com.unionsmp.managers.ConfigManager;
import com.unionsmp.managers.ParticleManager;
import com.unionsmp.managers.PlanetManager;
import com.unionsmp.items.RerollerItem;
import lombok.Getter;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;

@Getter
public class UnionSMP extends JavaPlugin {

    private ConfigManager configManager;
    private PlanetManager planetManager;
    private AbilityManager abilityManager;
    private ParticleManager particleManager;

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

        configManager = new ConfigManager(this);
        planetManager = new PlanetManager(this);
        abilityManager = new AbilityManager(this);
        particleManager = new ParticleManager(this);

        RerollerItem.registerRecipe(this);

        registerListeners();
        registerCommands();
        startPassiveScheduler();

        startOrbitScheduler();
        getLogger().info("UnionSMP enabled — 8 planets, infinite paths.");
    }

    @Override
    public void onDisable() {
        if (planetManager != null) {
            planetManager.save();
        }
        getLogger().info("UnionSMP disabled.");
    }

    private void registerListeners() {
        getServer().getPluginManager().registerEvents(new JoinListener(this), this);
        getServer().getPluginManager().registerEvents(new AbilityListener(this), this);
        getServer().getPluginManager().registerEvents(new PassiveListener(this), this);
        getServer().getPluginManager().registerEvents(new DeathListener(this), this);
    }

    private void registerCommands() {
        AdminCommand adminCmd = new AdminCommand(this);
        getCommand("setplanet").setExecutor(adminCmd);
        getCommand("resetplanet").setExecutor(adminCmd);
        getCommand("giveplanet").setExecutor(adminCmd);
        getCommand("reloadplugin").setExecutor(adminCmd);
        getCommand("plugininfo").setExecutor(new InfoCommand(this));

        UnionCommand unionCmd = new UnionCommand(this);
        getCommand("unionsmp").setExecutor(unionCmd);
        getCommand("unionsmp").setTabCompleter(unionCmd);
    }

    private void startPassiveScheduler() {
        int interval = configManager.getPassiveRefreshInterval();
        new BukkitRunnable() {
            @Override
            public void run() {
                for (Player player : getServer().getOnlinePlayers()) {
                    Planet planet = planetManager.getPlanet(player.getUniqueId());
                    if (planet != null) {
                        abilityManager.applyPassives(player, planet);
                    }
                }
            }
        }.runTaskTimer(this, 40L, interval);
    }

    private void startOrbitScheduler() {
        new BukkitRunnable() {
            @Override
            public void run() {
                for (Player player : getServer().getOnlinePlayers()) {
                    Planet planet = planetManager.getPlanet(player.getUniqueId());
                    if (planet != null) {
                        particleManager.spawnOrbit(player, planet);
                    }
                }
            }
        }.runTaskTimer(this, 5L, 5L);
    }
}