Kaboom
📎 1 file 4,952 chars
📄
pasted-code-1795285019506.txt
txt 67 lines
▶
Create a complete Minecraft plugin for Paper/Spigot 1.21.11 (Java, Maven or Gradle, include plugin.yml, full source code, and build instructions). The plugin adds several special items with abilities. Make everything configurable in config.yml (durations, radii, cooldowns, effect levels, item names). Use persistent data (PDC) to identify the custom items so they can't be faked by renaming.

=== COMMANDS (OP ONLY) ===

The main command is /soul. Every command must start with /soul, followed by subcommands. ALL commands are restricted to OP players only (check player.isOp() and also set the permission in plugin.yml to default: op). Non-OP players get a "You don't have permission" message and cannot use or see any command (no tab completion for them either). The console may use the commands too.

Subcommands:
   - /soul give          → gives a player one of the custom items
   - /soul items                        → lists all available items
   - /soul clock                        → gives yourself the Dimension Clock
   - /soul timestop                     → gives yourself the Time Stop Clock(s)
   - /soul sword                        → gives yourself the Sword Boost item
   - /soul shield       → force-enable or disable the Barrier Shield for a player
   - /soul reload                       → reloads config.yml
   - /soul help                         → shows all /soul commands
Add full tab completion for all subcommands, player names, and item names (only for OPs).

=== PART 1: TIME ABILITIES ===

1. Dimension Clock
   - A custom clock item that the owner can carry through all dimensions (Overworld, Nether, End).
   - It must never be lost or removed on dimension change (keep on death optional via config).

2. Time Stop Clock – "Speed Mode" (Shift + Right-Click)
   - Shift + right-clicking this clock pauses time around the user.
   - The user receives Speed V (amplifier 4) for the duration.
   - Effect radius: 50 blocks. Duration and cooldown configurable.
   - Everyone else in the radius is affected by the time pause (frozen mobs/projectiles optional via config), the user is not.

3. Time Stop Clock – "Freeze Mode"
   - Pauses time in a 25-block radius for 10 seconds.
   - Every player in the radius (except the user) gets Darkness and Slowness (high amplifier, so they are effectively frozen in place; also cancel their movement and jumping).
   - The user can hit frozen players, but they do NOT take damage immediately. Instead, store all damage dealt to each frozen player during the 10 seconds and apply the accumulated damage all at once when the 10 seconds are over.
   - Remove the effects and the freeze when the time is up. Show a countdown on the action bar.

4. Sword Boost
   - For 10 seconds, the user's sword temporarily gets Sharpness X (level 10).
   - Restore the original enchantments exactly after 10 seconds, even if the player logs out, dies, drops the sword, or the server restarts during the effect.

=== PART 2: BARRIER SHIELD ABILITY ===

A shield-type ability that is toggled on/off by the owner.

Activation:
   - When first activated, nothing visible happens.
   - Every time the owner kills a player while the ability is active, a "barrier" spawns and stays around the owner (use a display entity/armor stand/interaction entity with particle effects). Max 3 barriers.
   - Each time a barrier spawns (on every kill), all players within 5 blocks of the owner get Slowness II.
   - 1 kill = 1 barrier, 2 kills = 2 barriers, 3 kills = 3 barriers.

Effects at 3 barriers (full shield):
   - Arrows and projectiles reflect/bounce off the owner (the owner is invulnerable to projectiles, similar to creative mode).
   - Any player who comes close to the owner is slowed progressively (Slowness amplifier increases with proximity) until they are fully stopped and cannot reach the owner.

Each barrier:
   - Has its own health of 20 hearts (40 HP), tracked separately.
   - Can be damaged by players via melee hits or projectiles (arrows, tridents, etc.).
   - When a barrier's health reaches 0, it breaks (particles + sound) and is removed.

Deactivation:
   - The ability can only end if (a) the owner deactivates it manually, or (b) all three barriers are destroyed.
   - It must NOT end through any timeout or other way. On owner death/logout, clean up all barrier entities safely.

=== TECHNICAL REQUIREMENTS ===
   - Clean, well-commented code with separate classes (items, abilities, listeners, command handler, manager, config).
   - Handle edge cases: player logout, death, world/dimension change, server reload, entity cleanup on disable.
   - Avoid lag: efficient scheduled tasks, no heavy loops every tick.
   - Provide the full file structure, all source files, plugin.yml (with /soul command and OP-only permission), config.yml, and a short README explaining all items and commands.
Kodari AI
KodariYesterday at 6:18 pm 5
SoulArtifacts
A comprehensive Paper/Spigot plugin introducing four unique magical artifacts with time-manipulation and defensive abilities. Features a Dimension Clock that persists across worlds, a Time Stop Clock with Speed and Freeze modes (freezing players and accumulating damage), and a Sword Boost that temporarily grants Sharpness X while preserving original enchantments. Includes a Barrier Shield system with up to three destructible barriers that reflect projectiles and slow nearby enemies. All items identified via PersistentDataContainer, fully configurable through config.yml, with OP-only /soul command featuring subcommands, tab completion, and reload support.

I’ll build the item and ability managers, OP-only command handling, configuration, and cleanup/persistence safeguards, then include the requested README.

Created SoulAbilities with configurable items, time abilities, barriers, OP-only commands, and a README.

Limitations: Frozen mobs can still perform AI actions, and boosted swords in unloaded inventories are restored when next accessed rather than exactly at expiry. Freeze release also removes Slowness and Darkness rather than restoring any effects that preceded it.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
README.md
settings.gradle
Code
11 685
src/main/java/com/kodari/soul/SoulPlugin.java
package com.kodari.soul;

import org.bukkit.plugin.java.JavaPlugin;

public final class SoulPlugin extends JavaPlugin {
    private ItemManager items;
    private AbilityManager abilities;
    private ShieldManager shields;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        items = new ItemManager(this);
        abilities = new AbilityManager(this, items);
        shields = new ShieldManager(this);
        SoulCommand command = new SoulCommand(this, items, shields);
        getCommand("soul").setExecutor(command);
        getCommand("soul").setTabCompleter(command);
        getServer().getPluginManager().registerEvents(new SoulListener(this, items, abilities, shields), this);
        abilities.start();
        shields.start();
    }

    @Override
    public void onDisable() {
        if (abilities != null) abilities.shutdown();
        if (shields != null) shields.shutdown();
    }
}