shubizzz

You are an expert Minecraft Paper plugin developer.

Create a complete Paper plugin named ArtifactSMP for Minecraft 1.21.1 using Java 21.

The plugin must implement an artifact system where each player can hold only one artifact at a time.

Each artifact has:

Passive ability (always active or automatically triggered)

Spark ability (activated using SHIFT + RIGHT CLICK)

Cooldown system for spark abilities

INVENTORY GUI system to view artifacts

Random roll system to assign artifacts

Base item for all artifacts is PAPER. If no resource pack is installed, it appears as normal paper. If resource pack is installed, use CustomModelData to show custom textures.

---

Commands:

/artifact INVENTORY GUI

Opens a 27-slot INVENTORY GUI showing all artifacts

Each artifact is represented as a PAPER item

Display name is the artifact name

Clicking items is optional and not required to do anything

---

/artifact roll <player>

Starts artifact roll for a target player

Show title with random artifact name during roll

Show subtitle: "Your Fate Is Being Decided"

After 3 seconds (60 ticks), randomly select one artifact

Assign artifact to player and store it using UUID → Artifact type

Send message to player confirming received artifact

Artifacts list: Swift Warden Zombie Breeze Wither Blaze Witch Magician

---

Artifact storage system:

Each player can only have one artifact and if they die or press Q button while holding the artifact the artifact will drop

Store data using UUID mapped to Artifact enum

Create ArtifactManager with:

give(player, artifact)

get(player)

has(player)

---

Cooldown system:

Create CooldownManager

Store cooldowns using UUID + abilityName → expiration timestamp

If ability is on cooldown:

Do not activate ability

Send message "Ability is on cooldown"

---

Spark system rules:

Activated by SHIFT + RIGHT CLICK

Works in main hand or offhand

Must check cooldown before activation

If on cooldown, do nothing except message

---

Artifact abilities:

Swift Artifact: Passive: Speed II permanently + 30% reduced fall damage Spark: Teleport 6 blocks forward Cooldown: 60s

---

Warden Artifact: Passive: Nearby players within 6 blocks get Darkness (10s periodically) Spark: Darkness 5s + deal 1 heart damage to players in 5 block radius Cooldown: 180s

---

Zombie Artifact: Passive: Regeneration II permanently Spark: Regeneration 100 for 3s + spawn 5 zombies Zombies must attack all players except artifact owner Cooldown: 90s

---

Breeze Artifact: Passive: Jump Boost II permanently Spark: Launch player upward and forward Also next axe hit has boosted damage effect once Cooldown: 80s

---

Wither Artifact: Passive: 10% chance on hit to apply Wither II for 2 seconds Spark: Strength VI for 15s + Wither II for 5s to enemies within 8 blocks Cooldown: 150s

---

Blaze Artifact: Passive: Fire Resistance permanently Spark: Blindness V for 7s + Fire for 7s to enemies within 8 blocks Cooldown: 50s

---

Witch Artifact: Passive: 5% chance on hit to apply Poison V for 2 seconds Spark: Poison II for 10s + Nausea for 10s to enemies within 8 blocks Cooldown: 60s

---

Magician Artifact: Passive: Every 30 seconds give random buff for 30 seconds: Speed II, Resistance I, Jump Boost II, Fire Resistance I

Spark: Regeneration 100 for 1 second + Poison 100 for 2 seconds to enemies within 5 blocks Cooldown: 120s

---

Zombie behavior rule: Zombies spawned must target all players except artifact owner using AI targeting logic or periodic target updates.

---

CustomModelData system: Each artifact uses PAPER with CustomModelData: Swift = 1001 Warden = 1002 Zombie = 1003 Breeze = 1004 Wither = 1005 Blaze = 1006 Witch = 1007 Magician = 1008

Resource pack behavior:

CustomModelData maps to custom textures in paper.json overrides

Without resource pack, item is normal paper

With resource pack, item becomes custom artifact model

---

Project structure:

me.artifact

me.artifact.command

me.artifact.listener

me.artifact.manager

me.artifact.cooldown

me.artifact.artifacts

---

Required classes:

Main plugin class

Artifact enum

ArtifactManager

CooldownManager

ArtifactCommand (/artifact)

ArtifactListener (passives + spark handling)

INVENTORY GUI class

---

Requirements:

Must work on Paper 1.21.1

Must use Java 21

No pseudo code

Fully working implementation

Clean OOP structure

No emojis

Must compile directly in IntelliJ without errors

---

If anything is unclear, assume standard Paper plugin development behavior and implement it in the most stable way.

Kodari AI
KodariMay 26 at 3:48 am 14,031 (v2)
ArtifactSMP
A Paper 1.21.1 artifact system where each player holds one artifact at a time. Features 8 unique artifacts (Swift, Warden, Zombie, Breeze, Wither, Blaze, Witch, Magician) each with passive and spark abilities. Includes a roll system with animated titles, inventory GUI to browse artifacts, cooldown management, CustomModelData support for resource packs, and drop-on-death/drop-on-Q mechanics.

Planning the class structure before writing:

  • ArtifactSMP — main plugin, initializes managers, registers commands/listeners

  • Artifact enum — defines all 8 artifacts with name + CustomModelData

  • ArtifactManager — UUID → Artifact map, give/get/has/remove

  • CooldownManager — UUID+abilityName → expiry timestamp

  • ArtifactCommand — handles /artifact and /artifact roll <player>

  • ArtifactListener — passives (scheduled tasks), spark (shift+right-click), drop on death/Q

  • ArtifactGUI — 27-slot inventory showing all artifacts

  • GUIManager + GUIListener — inventory event routing

  • InventoryHandler, InventoryButton, InventoryGUI — GUI framework

Here’s a summary of what was built:

  • 8 artifacts fully implemented with passive effects (via repeating scheduler tasks) and spark abilities (SHIFT + RIGHT CLICK on the artifact paper item)

  • ArtifactManager handles give/remove/item building and starts/stops per-player passive tasks; passives for Swift (Speed II + fall reduction), Warden (Darkness aura), Zombie (Regen II), Breeze (Jump Boost II), Blaze (Fire Resistance), and Magician (random buff every 30s) are all running as scheduled tasks

  • CooldownManager uses a simple UUID:abilityName → expiry timestamp map with no external dependencies

  • Drop/death handling — PlayerDeathEvent and PlayerDropItemEvent both call removeWithoutItem so the item drops naturally but the passive/task is cleaned up

  • Breeze axe boost is tracked via a Set<UUID> and consumed on the next axe hit

  • ArtifactGUI places all 8 artifact paper items in a 27-slot inventory across slots 1,3,5,7,10,12,14,16 (spread across two rows)

  • Roll system fires a title every 5 ticks for 60 ticks then assigns a random artifact with a confirmation title and message

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
14 998
src/main/java/me/artifact/ArtifactSMP.java
package me.artifact;

import me.artifact.command.ArtifactCommand;
import me.artifact.inventory.gui.GUIListener;
import me.artifact.inventory.gui.GUIManager;
import me.artifact.listener.ArtifactListener;
import me.artifact.manager.ArtifactManager;
import me.artifact.cooldown.CooldownManager;
import org.bukkit.plugin.java.JavaPlugin;

public class ArtifactSMP extends JavaPlugin {

    private ArtifactManager artifactManager;
    private CooldownManager cooldownManager;
    private GUIManager guiManager;

    @Override
    public void onEnable() {
        this.artifactManager = new ArtifactManager(this);
        this.cooldownManager = new CooldownManager();
        this.guiManager = new GUIManager();

        GUIListener guiListener = new GUIListener(guiManager);
        getServer().getPluginManager().registerEvents(guiListener, this);

        ArtifactListener artifactListener = new ArtifactListener(this);
        getServer().getPluginManager().registerEvents(artifactListener, this);

        ArtifactCommand artifactCommand = new ArtifactCommand(this);
        getCommand("artifact").setExecutor(artifactCommand);
        getCommand("artifact").setTabCompleter(artifactCommand);
    }

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

    public ArtifactManager getArtifactManager() {
        return artifactManager;
    }

    public CooldownManager getCooldownManager() {
        return cooldownManager;
    }

    public GUIManager getGuiManager() {
        return guiManager;
    }
}