dizoispro
📎 1 file 9,515 chars
📄
pasted-code-1790758393482.txt
txt 366 lines
▶
I want a Minecraft SMP plugin with a custom /smp start system, a custom boss, and two legendary weapons.

SMP START SYSTEM

When an admin types:

/smp start

The server should show and broadcast:

“SMP IS GOING TO START!”

The countdown should appear both on the player's screen and in chat:

3
2
1

After the countdown finishes:

The SMP officially starts.
The Overworld world border is automatically set to 20,000 blocks.
The server announces:
“SMP HAS STARTED!”
CUSTOM BOSS — THE VOID LORD

The plugin should have a powerful custom boss called:

THE VOID LORD

The boss should have:

Custom name
Large configurable health
Boss bar
Custom attacks
Special abilities
Particles
Sounds
Multiple attack phases
Custom drops

The boss should not spawn naturally.

When players defeat the boss, it should drop special materials required to craft the legendary weapons.

Example drops:

Void Core
Storm Core
Experience
Configurable rare loot

The special materials must have unique internal identifiers so normal renamed items cannot be used in the recipes.

LEGENDARY WEAPON 1 — VOID REAPER
Recipe
[ Void Core ] [ Nether Star ] [ Void Core ]
[ Blaze Rod ] [ Netherite Sword ] [ Blaze Rod ]
[ Obsidian ]  [ Void Core ]   [ Obsidian ]

When a player successfully crafts the Void Reaper, the item should NOT immediately go into their inventory as a usable weapon.

Instead, the ritual should automatically begin.

LEGENDARY WEAPON 2 — STORM BREAKER
Recipe
[ Storm Core ] [ Nether Star ] [ Storm Core ]
[ Diamond ]    [ Netherite Axe ] [ Diamond ]
[ Lightning Rod ] [ Storm Core ] [ Lightning Rod ]

When a player successfully crafts the Storm Breaker, its ritual should also automatically begin.

RITUAL SYSTEM

This is a very important part of the plugin.

When either legendary weapon is crafted:

1. The ritual should automatically begin

The plugin should select a random safe ritual location inside the world border.

The ritual location should be shown to players using the boss bar coordinates.

The legendary weapon should then appear floating at the selected ritual location.

The weapon should:

Visually float in the air.
Rotate slowly.
Have glowing effects.
Have particles around it.
Play custom sounds.
Be visually suspended above the ritual location.
Not be given directly to the player.
Have Warden-style dark/sculk particles and effects surrounding the weapon.
Have a powerful dark energy effect around the ritual area.
Have the weapon continuously rotate while floating.
Have the Warden-style particles continue throughout the ritual.
Have a visible vertical energy/particle effect that makes the ritual location easy to recognize.

The floating item should represent the weapon waiting to awaken.

For example:

“THE VOID REAPER RITUAL HAS BEGUN!”

or

“THE STORM BREAKER RITUAL HAS BEGUN!”

2. Five-minute ritual

The ritual should last exactly:

5 minutes

The ritual duration should be configurable.

During those 5 minutes:

The weapon remains floating.
The weapon slowly rotates continuously.
Warden-style particles continue around the weapon.
Dark/sculk energy effects continue around the ritual location.
The weapon cannot be picked up.
The weapon cannot be used.
Players cannot bypass the ritual.
The ritual location remains fixed.
Particles and sounds should continue.
A countdown should be displayed.
The ritual should remain visually active for the entire 5 minutes.
RANDOM RITUAL COORDINATES

When the ritual starts, the plugin should generate/select a random coordinate location for the ritual.

The coordinates should be shown in the boss bar at the top of the screen.

Example:

⚔ VOID REAPER RITUAL | X: 1245 Y: 72 Z: -3821 | 04:37

The boss bar should continuously update:

X coordinate
Y coordinate
Z coordinate
Remaining ritual time

Example:

VOID REAPER RITUAL — X: 1245 Y: 72 Z: -3821 — 03:21

This allows players to know where the ritual is happening and travel there.

The coordinates should be randomized within the world border.

The plugin must make sure the random ritual location is valid and inside the 20,000-block world border.

The random location should not spawn inside:

Lava
Void
Unreachable locations
Dangerous underground locations
Other invalid locations

The plugin should find a safe surface location for the ritual.

RITUAL LOCATION

At the randomly selected ritual location:

The weapon floats in the air.
The weapon slowly rotates.
Warden-style dark/sculk particles surround the weapon.
Dark energy particles continuously appear around the ritual.
The area has special visual effects.
Sounds can periodically play.
A vertical beam/effect can show the ritual location.
Players can travel to the location using the coordinates displayed in the boss bar.
The ritual should look powerful and supernatural.
The visual effects should continue throughout the full 5-minute ritual.

The ritual location should remain unchanged for the entire 5 minutes.

WHEN THE 5 MINUTES END

This is extremely important.

When the 5-minute ritual finishes:

The floating weapon should stop rotating.
The floating animation should end.
The Warden-style particles and ritual effects should stop.
The weapon should fall/drop down from its floating position toward the ground.
A powerful completion effect should play.
A completion sound should play.
A server-wide message should appear:

“THE VOID REAPER HAS AWAKENED!”

or

“THE STORM BREAKER HAS AWAKENED!”

The weapon should become a normal physical item entity and drop onto the ground at the ritual location.

It should NOT automatically go into the crafter's inventory.

FIRST PLAYER TO PICK IT UP OWNS IT

The awakened weapon should be available for players to pick up.

The player who picks up the weapon first becomes the owner of that weapon.

For example:

Player A crafted the weapon.

But Player B reached the ritual location first.

After the ritual finishes, the weapon drops on the ground.

If Player B picks it up first:

Player B becomes the owner of the weapon.

The plugin should then bind/register that weapon to Player B.

The original crafter should NOT automatically receive ownership.

This creates competition around the ritual location.

WEAPON OWNERSHIP

After a player picks up the awakened weapon:

The plugin should store the owner's UUID.
The weapon should be registered as activated.
The weapon's ability should become usable.
The ownership information should be stored safely.
The owner should remain associated with the weapon even after restarting the server.
The plugin should use a unique internal identifier for every legendary weapon.

The weapon should have lore similar to:

§5VOID REAPER
§7Legendary Weapon
§aSTATUS: AWAKENED
§dAbility: Void Slash
§7Cooldown: 30 seconds
§8Owner: PlayerName
WEAPON HOLDING EFFECTS

After a legendary weapon has awakened and is held by its registered owner:

Both legendary weapons should give the holder:

Strength V
Regeneration V

These effects should remain active while the awakened legendary weapon is being held.

When the player stops holding the legendary weapon, the plugin should remove the effects provided by the weapon.

The effects should NOT activate on:

Normal weapons
Renamed weapons
Fake/copy items
Unawakened ritual weapons

The plugin must verify the weapon's unique internal identifier and awakened/ownership status before applying the effects.

Both Void Reaper and Storm Breaker should have these effects.

IMPORTANT ANTI-BYPASS RULES

Players should not be able to:

Rename normal weapons to bypass the system.
Copy the weapon using normal mechanics.
Use the ability before awakening.
Receive Strength V or Regeneration V from an unawakened/fake weapon.
Pick up the floating ritual weapon before the timer ends.
Duplicate the weapon through normal inventory actions.
Create fake Void Cores or Storm Cores by renaming items.
Bypass weapon ownership.

Every important custom item should have a unique internal identifier using Minecraft's item data / PersistentDataContainer system.

VOID REAPER ABILITY

After awakening:

Void Slash

The player can activate the ability using a configurable action such as:

Right click
Sneak + right click

The ability can:

Create a dark/void effect.
Damage nearby enemies.
Create particles.
Play custom sounds.
Have a configurable cooldown.

The ability should only work when the player is using the genuine awakened Void Reaper.

STORM BREAKER ABILITY

After awakening:

Thunder Strike

The player can activate the ability using a configurable action.

The ability can:

Strike lightning at the target.
Deal configurable damage.
Create storm particles.
Play thunder sounds.
Have a configurable cooldown.

The ability should only work when the player is using the genuine awakened Storm Breaker.

CONFIGURATION

The plugin should make the required systems configurable, including:

SMP countdown
World border size
Ritual duration
Random ritual location
Safe-location detection
Boss health
Boss attacks
Boss phases
Boss drops
Recipes
Weapon abilities
Ability damage
Ability cooldowns
Strength effect
Regeneration effect
Ritual particles
Warden-style ritual particles
Dark/sculk energy effects
Ritual sounds
Boss sounds
Weapon sounds
Messages
Boss bar
Coordinate display
Ritual effects
Other relevant plugin settings

The plugin should be optimized for a multiplayer Paper SMP server.

The plugin should save active rituals, ritual locations, weapon ownership, weapon activation status, and other important data properly so that a server restart does not break the system or lose the legendary weapons.
Kodari AI
KodariSep 30 at 8:57 am 2
VoidStormSMP
A comprehensive SMP plugin featuring an automated countdown start system with configurable world border expansion, a custom Void Lord boss with multi-phase attacks, particles, boss bar, and unique drops, plus two legendary weapons (Void Reaper and Storm Breaker) obtained through crafting and a five-minute ritual system. Rituals spawn floating weapons at random safe locations with Warden-style effects, boss bar coordinates, and timed completion. Weapons awaken with ownership binding, persistent data storage, holder effects, and unique abilities like Void Slash and Thunder Strike, all fully configurable with anti-bypass protections.

Created the Paper 1.21.4 SMP plugin with /smp start countdown and world-border setup, a manually summoned phased Void Lord, custom core recipes, and five-minute weapon rituals. Rituals and weapon ownership persist in data.yml; the first player to pick up an awakened weapon becomes its owner. Both weapons include owner-checked abilities and holding effects, with settings in config.yml.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
5 1,238
src/main/java/com/kodari/smp/SmpPlugin.java
package com.kodari.smp;

import com.cryptomorin.xseries.XMaterial;
import com.cryptomorin.xseries.XPotion;
import com.cryptomorin.xseries.XSound;
import com.cryptomorin.xseries.particles.XParticle;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.Particle;
import org.bukkit.World;
import org.bukkit.WorldBorder;
import org.bukkit.attribute.AttributeInstance;
import org.bukkit.boss.BarColor;
import org.bukkit.boss.BarFlag;
import org.bukkit.boss.BarStyle;
import org.bukkit.boss.BossBar;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Item;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Warden;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.event.entity.EntityPickupItemEvent;
import org.bukkit.event.inventory.CraftItemEvent;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.event.inventory.InventoryMoveItemEvent;
import org.bukkit.event.inventory.PrepareItemCraftEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataContainer;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.scheduler.BukkitTask;
import org.bukkit.util.Vector;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.YamlConfiguration;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;

public final class SmpPlugin extends JavaPlugin implements Listener, org.bukkit.command.CommandExecutor {
    private final Map<UUID, Ritual> rituals = new HashMap<>();
    private final Map<UUID, WeaponRecord> weapons = new HashMap<>();
    private final Map<UUID, BossState> bosses = new HashMap<>();
    private final Map<String, Long> abilityCooldowns = new HashMap<>();
    private final Set<UUID> weaponEffectPlayers = new HashSet<>();

    private File dataFile;
    private YamlConfiguration data;
    private NamespacedKey itemTypeKey;
    private NamespacedKey weaponKindKey;
    private NamespacedKey weaponIdKey;
    private NamespacedKey weaponStateKey;
    private NamespacedKey ownerIdKey;
    private NamespacedKey ritualIdKey;
    private NamespacedKey bossKey;
    private BukkitTask bossTask;
    private BukkitTask effectsTask;
    private boolean started;
    private boolean startCountdownRunning;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        dataFile = new File(getDataFolder(), "data.yml");
        data = YamlConfiguration.loadConfiguration(dataFile);
        itemTypeKey = new NamespacedKey(this, "item_type");
        weaponKindKey = new NamespacedKey(this, "weapon_kind");
        weaponIdKey = new NamespacedKey(this, "weapon_id");
        weaponStateKey = new NamespacedKey(this, "weapon_state");
        ownerIdKey = new NamespacedKey(this, "owner_id");
        ritualIdKey = new NamespacedKey(this, "ritual_id");
        bossKey = new NamespacedKey(this, "void_lord");

        started = data.getBoolean("started", false);
        loadWeapons();
        registerRecipes();
        Bukkit.getPluginManager().registerEvents(this, this);
        getCommand("smp").setExecutor(this);
        if (started) {
            applyWorldBorder();
        }
        restoreRituals();
        restoreBosses();
        bossTask = new BukkitRunnable() {
            @Override
            public void run() {
                tickBosses();
            }
        }.runTaskTimer(this, 20L, 20L);
        effectsTask = new BukkitRunnable() {
            @Override
            public void run() {
                tickWeaponEffects();
            }
        }.runTaskTimer(this, 20L, 20L);
    }

    @Override
    public void onDisable() {
        if (bossTask != null) {
            bossTask.cancel();
        }
        if (effectsTask != null) {
            effectsTask.cancel();
        }
        for (Ritual ritual : rituals.values()) {
            if (ritual.task != null) {
                ritual.task.cancel();
            }
            if (ritual.visual != null && ritual.visual.isValid()) {
                ritual.visual.remove();
            }
            if (ritual.bar != null) {
                ritual.bar.removeAll();
            }
        }
        for (BossState state : bosses.values()) {
            state.bar.removeAll();
        }
        saveData();
    }

    @Override
    public boolean onCommand(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command,
                             String label, String[] args) {
        if (!sender.hasPermission("kodarismp.admin")) {
            sender.sendMessage(color("&cYou do not have permission to use this command."));
            return true;
        }
        if (args.length == 1 && args[0].equalsIgnoreCase("start")) {
            startSmp(sender);
            return true;
        }
        if (args.length >= 1 && args[0].equalsIgnoreCase("boss")) {
            Location spawnLocation;
            if (sender instanceof Player player) {
                spawnLocation = player.getLocation();
            } else {
                World world = configuredWorld(getConfig().getString("world", "world"));
                if (world == null) {
                    sender.sendMessage(color("&cNo world is available to spawn the Void Lord."));
                    return true;
                }
                spawnLocation = world.getSpawnLocation();
            }
            spawnBoss(spawnLocation);
            sender.sendMessage(color("&5The Void Lord has been summoned."));
            return true;
        }
        sender.sendMessage(color("&eUsage: /smp start or /smp boss [spawn]"));
        return true;
    }

    private void startSmp(org.bukkit.command.CommandSender sender) {
        if (started) {
            sender.sendMessage(color(getConfig().getString("smp.messages.already-started", "&eThe SMP has already started.")));
            return;
        }
        if (startCountdownRunning) {
            sender.sendMessage(color("&eThe SMP countdown is already running."));
            return;
        }
        startCountdownRunning = true;
        Bukkit.broadcastMessage(color(getConfig().getString("smp.messages.going-to-start", "&c&lSMP IS GOING TO START!")));
        List<Integer> seconds = getConfig().getIntegerList("smp.countdown-seconds");
        if (seconds.isEmpty()) {
            seconds = Arrays.asList(3, 2, 1);
        }
        List<Integer> countdown = new ArrayList<>(seconds);
        new BukkitRunnable() {
            private int index;

            @Override
            public void run() {
                if (index >= countdown.size()) {
                    started = true;
                    startCountdownRunning = false;
                    applyWorldBorder();
                    data.set("started", true);