aris_manji
📎 1 file 14,585 chars
📄
pasted-code-1783789878839.txt
txt 162 lines
▶
Act as an expert Spigot/Paper Minecraft plugin developer. Generate a complete, optimized Java plugin for a custom weapon system inspired heavily by "Altar SMP" mechanics, compatible with Minecraft 1.20+.

### PROJECT IDENTIFICATION & NAMING
- **Plugin Name:** Aris Weapons Smp
- **Main Class Name:** ArisWeaponsSmp
- **Artifact/Folder Name:** ArisWeaponsSmp
- **Base Package Structure:** com.aris.weaponssmp
Ensure all logs, command prefixes, permissions, and internal configuration keys use this exact naming scheme. Do not use generic names or placeholder project structures.

### IMPORTANT CRITICAL AI RULES (READ BEFORE GENERATING CODE)
1. **Material Correctness:** All Swords must be Netherite Swords, all Axes must be Netherite Axes. All Maces must use the standard Minecraft Mace base (`Material.MACE`) as there is no Netherite variant for Maces.
2. **AoE Mechanic Handling:** When writing Area of Effect (AoE) abilities, DO NOT use heavy entity loops that cause server lag. Instead, utilize `player.getNearbyEntities(radius, radius, radius)` and ALWAYS explicitly check if an entity is an instance of a `Player`. Exclude the weapon user from taking damage or effects from their own AoE attacks.
3. **Potion Amplifiers (Level 255):** When applying extreme potion effects like Slowness or Blindness 255, apply them carefully via `new PotionEffect(PotionEffectType.SLOW, duration_ticks, 255, false, false, true)`. Set the boolean flags to hide particles and ambient icons so it does not cause visual client lag or screen crashes.
4. **Persistent Max Hearts:** The permanent Heart Theft mechanic must be hardcoded to modify the `Attribute.GENERIC_MAX_HEALTH` using a persistent UUID modifier. Save this data inside the player's `PersistentDataContainer` using custom `NamespacedKey` entries so it safely persists through player deaths, rejoins, and total server restarts without resetting.

### GENERAL SYSTEM SPECIFICATIONS
1. Custom Model Data: Every weapon must have a unique Custom Model Data ID starting sequentially at 1 and ending at 17. 
2. Tooltips & Lore: When a player hovers their cursor over a weapon, the lore must clearly display the weapon's theme, its Passive, and its 3 Active Abilities including exact activation triggers and cooldowns.
3. Cooldown System:
   - Ability 1 (Shift + Right-Click): 10 seconds.
   - Ability 2 (Shift + Left-Click): 20 seconds.
   - Ability 3 / Ultimate (Shift + Swap Hand Key / F): 1 minute.

### CRAFTING, RITUAL, & RESTRICTION SYSTEM
1. Configurable Recipes: All weapon recipes must be handled via a `config.yml`.
2. Global Ritual Event: When a recipe is matched and crafted:
   - The item does not go into the player's inventory immediately. It floats in mid-air at those coordinates using a safe armor stand or display entity.
   - A global Bossbar appears on every single player's screen showing the exact X, Y, Z coordinates of the weapon being ritualized.
3. Crafting Locks: Each weapon can only be crafted ONCE globally. Once a player crafts a specific weapon, nobody else can craft it, and that player cannot craft it again.
4. Reset Command: Admins can bypass this lock using `/weapons crafting reset [weapon_name]`.

### ADMINISTRATIVE COMMANDS (Permission: arisweapons.admin)
- `/weapons give [player_name] [weapon_name]` - Gives the specified weapon.
- `/weapons view` - Opens a virtual chest INVENTORY GUI displaying all 17 weapons for preview.
- `/weapons crafting reset [weapon_name]` - Resets the global crafting lock for that weapon.

---

### THE 17 LEGENDARY WEAPONS DEFINITION

1. "Error Blade" (Netherite Sword) | Custom Model Data: 1
   - Theme: Glitch, reality distortion, and total UI disruption.
   - **Passive (Glitch Corruption):** Every melee attack has a 15% chance to inflict both Blindness and Slowness 255 onto the enemy player for exactly 6 seconds (blinding them completely and locking them entirely in place).
   - Ability 1: Teleports the user 6 blocks forward in their looking direction.
   - Ability 2: Forces the target's screen to shake violently and scrambles their hotbar slot selection.
   - Ability 3: Emits a 7-block AoE pulse that temporarily disables all active potion effects on nearby players for 8 seconds.

2. "Life Stealer" (Netherite Sword) | Custom Model Data: 2
   - Theme: Blood magic, vitality theft, and high-stakes penalties.
   - Passive (Heart Theft): When the wielder kills a player, the wielder permanently gains 1 Max Heart (2 generic attribute points), and the victim permanently loses 1 Max Heart (2 generic attribute points). This must be stored via PersistentDataContainer so it NEVER resets when players rejoin or the server restarts.
   - Ability 1: Instantly heals the user for 2 hearts upon hitting an enemy.
   - Ability 2: Inflicts a "Bleeding" effect on the target, dealing exactly 0.8 hearts of damage (1.6 generic damage points) every second for 5 seconds.
   - Ability 3: Instantly sacrifices exactly 3 of the user's current hearts (6 health points) to unleash an explosive blood blast. This deals a massive 255 hearts of damage (510 generic damage points) to all entities within a 5-block radius (strictly excluding the user).

3. "Dragon Blade" (Netherite Sword) | Custom Model Data: 3
   - Theme: Void energy, Ender dragon power, and knockback zoning.
   - Passive: Complete immunity to dragon breath and fall damage from heights under 15 blocks.
   - Ability 1: Shoots an Ender Pearl that causes a small explosion where it lands without damaging the user.
   - Ability 2: Spawns a lingering cloud of Dragon's Breath in a 3x3 area that deals magic damage to enemies.
   - Ability 3: Releases a massive shockwave roar that launches all nearby enemies 10 blocks backward and upward.

4. "Chrono Axe" (Netherite Axe) | Custom Model Data: 4
   - Theme: Time manipulation and stasis.
   - Passive: Wielder gains permanent Haste I.
   - Ability 1: Rewinds the user's location, health, and hunger to exactly where they were 4 seconds ago.
   - Ability 2: Places the target in "Stasis" for 3 seconds, freezing them completely in place and rendering them immune to outside damage during that window.
   - Ability 3: Slows down time globally in a 10-block radius, giving everyone Slowness IV and Mining Fatigue III except for the wielder, who gains Speed II.

5. "Shadow Weaver" (Netherite Sword) | Custom Model Data: 5
   - Theme: Stealth, darkness, and backstabbing.
   - Passive: While sneaking in dark areas (light level < 5), the wielder gains permanent Invisibility.
   - Ability 1: Instantly teleports the user directly behind the nearest targeted enemy within 8 blocks.
   - Ability 2: Blinds all players within a 6-block radius for 4 seconds, filling the area with dark smoke particles.
   - Ability 3: Enters "Shadow Realm" mode for 10 seconds. The wielder becomes fully invisible, completely silent, and their next attack deals double damage.

6. "Storm Bringer" (Base Item: Mace) | Custom Model Data: 6
   - Theme: Lightning, thunder, and heavy impacts.
   - Passive: Landing a smash attack with the mace creates a loud thunderclap sound effect that disorients targets.
   - Ability 1: Strikes the target with a bolt of lightning, dealing bonus true damage.
   - Ability 2: Slams the ground, launching the user high into the air to set up a smash attack.
   - Ability 3: Summons a massive thunderstorm localized around the player for 12 seconds; lightning strikes random enemies within 8 blocks every 2 seconds.

7. "Gravity Bound" (Base Item: Mace) | Custom Model Data: 7
   - Theme: Density, gravity inversion, and crushing weight.
   - Passive: User falls 30% slower but deals 20% more knockback on all melee attacks.
   - Ability 1: Launches the targeted enemy 8 blocks directly up into the air.
   - Ability 2: Creates a gravity well on the ground. Pulls all players within a 7-block radius into the center and roots them for 3 seconds.
   - Ability 3: Increases the wielder’s weight exponentially for 5 seconds. Landing on the ground from any height during this time creates a crushing shockwave dealing damage based on distance fallen.

8. "Viper's Kiss" (Bow) | Custom Model Data: 8
   - Theme: Acid, poison, and decaying armor.
   - Passive: All arrows shot from this bow are automatically imbued with Poison I for 4 seconds.
   - Ability 1: Fires a tracking arrow that slightly curves mid-air to hit the nearest player target.
   - Ability 2: Shoots an acid arrow that temporarily degrades the target's armor values by 15% for 6 seconds.
   - Ability 3: Fires a volley of 8 poisonous arrows simultaneously in a wide cone spread in front of the user.

9. "Plague Doctor" (Crossbow) | Custom Model Data: 9
   - Theme: Decay, Wither effects, and contamination.
   - Passive: Arrows/firework rockets shot inflict Wither I for 3 seconds.
   - Ability 1: Shoots a gas projectile that creates a 4x4 cloud inflicting Nausea and Hunger on anyone inside.
   - Ability 2: Shoots a tethering arrow. If it hits, any damage the wielder takes over the next 4 seconds is shared 50/50 with the target.
   - Ability 3: Launches a massive contagious spore projectile. If it hits a player, it deals heavy Wither III damage, and if that player touches another teammate, the Wither effect spreads to them.

10. "Infernal Carver" (Netherite Axe) | Custom Model Data: 10
    - Theme: Hellfire, magma, and obsidian shielding.
    - Passive: Permanent Fire Resistance. Attacks set enemies on fire for 5 seconds.
    - Ability 1: Shoots a line of fire particles across the ground, igniting all players in its path.
    - Ability 2: Creates a ring of magma blocks around the user to trap melee opponents or shield against arrows.
    - Ability 3: Enters a "Superheat" state for 12 seconds. Every attack melts 2% of the target's shield/armor durability and ignores 25% of their armor defenses.

11. "Frost Bite" (Netherite Sword) | Custom Model Data: 11
    - Theme: Ice, hypothermia, and freezing slowing mechanics.
    - Passive: Striking an enemy builds up "Frost" stacks. At 4 stacks, the enemy is frozen solid (cannot move) for 2 seconds using a temporary Slowness 255 effect.
    - Ability 1: Fires a blast of ice shards dealing minor damage and applying Slowness II for 4 seconds.
    - Ability 2: Spawns an ice wall (3x3 grid of packed ice) directly in front of the player to block incoming projectiles.
    - Ability 3: Radiates an arctic aura for 8 seconds that forces the powder snow "freezing" overlay onto the screens of all nearby enemies, dealing ticking damage and slowing their attack speeds.

12. "Phantom Piercer" (Bow) | Custom Model Data: 12
    - Theme: Ethereal energy, phasing, and wall-piercing.
    - Passive: Arrows shoot completely straight without gravity drop-off.
    - Ability 1: The next arrow fired can pass directly through solid blocks to hit players hiding behind cover.
    - Ability 2: Fires a glowing tracking arrow that highlights all enemy outlines (Glow Effect) within a 15-block radius of where it lands.
    - Ability 3: Shoots a phantom arrow that switches positions between the wielder and the hit target upon impact.

13. "Sonic Boom" (Crossbow) | Custom Model Data: 13
    - Theme: Soundwaves, kinetic energy, and barrier disruption.
    - Passive: Knockback delivered by projectiles is doubled.
    - Ability 1: Fires a compressed soundwave that breaks any blocks like glass or doors, and heavily knocks back players.
    - Ability 2: Shoots a sonic flare that deafens targets (mutes game audio/plays ringing sound) and disorjets their FOV.
    - Ability 3: Fires a devastating Warden-style Sonic Boom projectile that travels instantly, ignoring armor values completely.

14. "Solar Flare" (Netherite Sword) | Custom Model Data: 14
    - Theme: Sun energy, blinding lights, and radiant healing.
    - Passive: Deals 15% extra damage during daylight hours in-game.
    - Ability 1: Emits a blinding flash that forces anyone looking at the wielder to turn away and grants them Blindness for 3 seconds.
    - Ability 2: Channels sunlight to instantly restore health and saturation to teammates in a 5-block radius.
    - Ability 3: Calls down a beam of solar energy from the sky. Deals high burn damage to enemies caught inside it and grants the wielder Strength II for 6 seconds.

15. "Reaper's Scythe" (Netherite Axe) | Custom Model Data: 15
    - Theme: Souls, execute thresholds, and harvesting.
    - Passive: Kills on mobs or players grant "Soul Charges" (Max 5). Each charge increases weapon damage by 4%.
    - Ability 1: Consumes 1 Soul Charge to execute a horizontal sweep attack dealing sweep damage to all front targets.
    - Ability 2: Consumes 2 Soul Charges to curse an enemy. If that enemy dies within the next 6 seconds, they drop double loot/heads and the wielder gets full health.
    - Ability 3: If an enemy player is below 15% health, using this ultimate instantly executes them, collecting their soul and granting Weakness to their nearby teammates.

16. "Tsunami" (Base Item: Trident) | Custom Model Data: 16
    - Theme: Water manipulation, Riptide, and drowning mechanics.
    - Passive: Wielder gains permanent Dolphin's Grace and Water Breathing.
    - Ability 1: Shoots a high-pressure water jet that pushes enemies away and extinguishes any fires.
    - Ability 2: Summons a geyser underneath the target, lifting them into the air and dropping them.
    - Ability 3: Envelops the user in a massive bubble of water, allowing them to use Riptide mechanics on dry land to launch and slam into enemies repeatedly for 8 seconds.

17. "Bedrock Breaker" (Netherite Axe) | Custom Model Data: 17
    - Theme: Earth, unbreakable defense, and shockwaves.
    - Passive: While holding this weapon, knockback taken is reduced to 0%.
    - Ability 1: Slams the ground to create an earthen barrier wall that emerges to block paths.
    - Ability 2: Destroys the shield-blocking stance of any enemy instantly and disables their shield use for 5 seconds.
    - Ability 3: Creates a massive earthquake using a safe nearby entities loop. The ground cracks, dealing heavy damage, applying Slowness V, and trapping enemies in the ground for 4 seconds.

### IMPLEMENTATION AND ARCHITECTURE REQUIREMENTS
- Write clean Java code implementing `Listener`, `CommandExecutor`, and `TabCompleter`.
- Ensure the ritual system uses a standard BukkitRunnable/Task to safely animate the floating item entity and handle the global Bossbar display updates cleanly.
Kodari AI
KodariJul 11 at 5:14 pm 15
ArisWeaponsSmp
ArisWeaponsSmp is a Paper 1.20+ custom weapon system inspired by Altar SMP mechanics. It adds 17 legendary weapons with unique model data, themed passive effects, three cooldown-based abilities, configurable ritual crafting, global one-time crafting locks, animated floating weapon rituals, global coordinate bossbars, persistent heart theft data, preview inventories, administrative give and reset commands, and cross-version material, sound, particle, potion, and attribute handling through XSeries.
aris_manji

The compilation failed with this error:

code
Compilation failed with 3 error(s):

ERROR in src/main/java/com/aris/weaponssmp/WeaponsGui.java at line 42: ')' expected
            if (slot % 9 ==  in 0) {
                               ^

ERROR in src/main/java/com/aris/weaponssmp/WeaponsGui.java at line 42: not a statement
            if (slot % 9 ==  in 0) {
                                ^

ERROR in src/main/java/com/aris/weaponssmp/WeaponsGui.java at line 42: ';' expected
            if (slot % 9 ==  in 0) {
                                 ^


=== COMPILATION ERROR ANALYSIS ===

SYNTAX ERRORS:
  - Line 42: ')' expected
  - Line 42: ';' expected
ACTION: Check for missing semicolons or brackets

FILES TO INVESTIGATE:
  - src/main/java/com/aris/weaponssmp/WeaponsGui.java

Please fix this error by creating a new artifact with the corrected code.

Kodari AI
KodariJul 11 at 5:18 pm 4

Fixed WeaponsGui.java by correcting the invalid condition to:

Java
if (slot % 9 == 0) {
Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
settings.gradle
Code
16 1,860
src/main/java/com/aris/weaponssmp/ArisWeaponsSmp.java
package com.aris.weaponssmp;

import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public class ArisWeaponsSmp extends JavaPlugin {
    private WeaponRegistry weaponRegistry;
    private WeaponItemFactory itemFactory;
    private CooldownManager cooldownManager;
    private PlayerStateManager stateManager;
    private RitualManager ritualManager;
    private WeaponsGui weaponsGui;

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

        weaponRegistry = new WeaponRegistry();
        itemFactory = new WeaponItemFactory(this);
        cooldownManager = new CooldownManager();
        stateManager = new PlayerStateManager(this);
        ritualManager = new RitualManager(this, itemFactory);
        weaponsGui = new WeaponsGui(weaponRegistry, itemFactory);

        WeaponsListener listener = new WeaponsListener(this);
        Bukkit.getPluginManager().registerEvents(listener, this);

        WeaponsCommand command = new WeaponsCommand(this);
        getCommand("weapons").setExecutor(command);
        getCommand("weapons").setTabCompleter(new WeaponsTabCompleter(weaponRegistry));
    }

    public WeaponRegistry getWeaponRegistry() {
        return weaponRegistry;
    }

    public WeaponItemFactory getItemFactory() {
        return itemFactory;
    }

    public CooldownManager getCooldownManager() {
        return cooldownManager;
    }

    public PlayerStateManager getStateManager() {
        return stateManager;
    }

    public RitualManager getRitualManager() {
        return ritualManager;
    }

    public WeaponsGui getWeaponsGui() {
        return weaponsGui;
    }
}