reyaan_25252

Create a FULLY WORKING Minecraft Paper plugin in Java for version 1.21.11

Plugin Name: CustomMace

CRITICAL REQUIREMENTS:

  • Must compile without errors
  • Must include plugin.yml
  • Must include config.yml and data.yml
  • Must register all events properly
  • Must work on first install (no manual fixes needed)
  • Use Java 17+
  • Use PersistentDataContainer to identify custom items
  • Provide COMPLETE source code with proper package structure

----------------------------------------

FEATURES:

  1. FIRST JOIN SYSTEM:
  • When a player joins for the FIRST time:

- Give exactly ONE random custom mace (from 9 types) - Save player UUID in data.yml

  • If player already received mace โ†’ do nothing
  • If data.yml entry is deleted โ†’ player can receive again
  1. RANDOM MACE SYSTEM:
  • Total 9 UNIQUE custom maces
  • Each mace must have:

- Custom colored name - Lore - Enchantments - Unique ID using PersistentDataContainer - Unique ability - Cooldown (except God Mace)

  1. ABILITIES (all different):
  • Lightning Strike
  • Fire Burn
  • Freeze (Slowness)
  • Knockback Boost
  • Life Steal
  • Explosion (no block damage)
  • Speed Boost
  • Poison
  • Teleport behind enemy

Trigger abilities on RIGHT CLICK or HIT

  1. COOLDOWN SYSTEM:
  • Each mace has separate cooldown
  • Store cooldown using HashMap<UUID, Time>
  • Send message if on cooldown
  1. JOIN EFFECTS:
  • When player gets mace:

- Play particles (FLAME, PORTAL, etc.) - Play sound - Send title message: "You received a Legendary Mace!"

  1. GOD MACE CRAFTING:
  • If player puts ALL 9 UNIQUE custom maces in crafting table:

โ†’ Give "God Mace"

IMPORTANT RULES:

  • Only custom maces allowed (check via PersistentDataContainer)
  • No duplicate maces allowed
  • Vanilla maces must NOT work

GOD MACE:

  • Extremely powerful
  • Special ability (e.g. lightning + explosion combo)
  • NO cooldown
  1. COMMANDS:
  • /macegive <player> <type>
  • /macereload
  1. PERMISSIONS:
  • custommace.admin
  • custommace.give
  1. ANTI-EXPLOIT:
  • Prevent duplication
  • Prevent crafting abuse
  • Validate items properly

----------------------------------------

STRUCTURE:

  • Main class
  • MaceManager
  • AbilityManager
  • JoinListener
  • CombatListener
  • CraftingListener

----------------------------------------

FINAL OUTPUT:

  • Full Java code
  • plugin.yml
  • config.yml
  • data.yml
  • Must be clean, optimized, and error-free
Kodari AI
KodariMay 4 at 1:02 pm 15,664 (v2)

Iโ€™ll create a fully working custom mace plugin with 9 unique maces, abilities, cooldowns, and a God Mace crafting system.

CustomMace
A feature-rich custom mace plugin with 9 unique legendary maces, each having special abilities like lightning strikes, life steal, and teleportation. Players receive a random mace on first join, and can craft the ultimate God Mace by collecting all 9 types. Includes cooldown management, particle effects, anti-exploit measures, and full admin commands for server management.

Perfect! Iโ€™ve created a fully working CustomMace plugin with all requested features:

โœ… Features Implemented:

1. First Join System

  • Players receive ONE random mace on first join

  • UUID tracked in data.yml

  • Can receive again if data deleted

2. Nine Unique Maces

  • โšก Lightning Mace - Strikes lightning

  • ๐Ÿ”ฅ Fire Mace - Burns enemies alive

  • โ„ Freeze Mace - Slows and freezes targets

  • ๐Ÿ’ซ Knockback Mace - Massive knockback

  • โค Lifesteal Mace - Steals 30% health

  • ๐Ÿ’ฅ Explosion Mace - Creates explosions

  • โšก Speed Mace - Grants speed boost

  • โ˜  Poison Mace - Poisons enemies

  • ๐ŸŒ€ Teleport Mace - Teleports behind target

3. God Mace Crafting

  • Requires all 9 unique maces in crafting table

  • No duplicates allowed

  • Ultra-powerful combo ability (lightning + explosion + fire + wither)

  • No cooldown

4. Cooldown System

  • Individual cooldowns per mace type

  • HashMap tracking per player

  • Messages on cooldown

5. Visual Effects

  • Particles on first join (FLAME + PORTAL)

  • Title message with gradient colors

  • Sound effects (ENTITY_PLAYER_LEVELUP)

  • Ability-specific particles and sounds

6. Anti-Exploit

  • PersistentDataContainer validation

  • Prevents vanilla mace usage in crafting

  • Checks for unique maces only

  • Proper cooldown tracking

7. Commands

  • /macegive <player> <type> - Give maces

  • /macereload - Reload config

8. Permissions

  • custommace.admin - Full admin access

  • custommace.give - Give maces

All files are complete, compile-ready, and use proper Paper 1.21+ APIs with MiniMessage formatting!

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
13 957
src/main/java/com/custommace/CustomMace.java
package com.custommace;

import com.custommace.command.MaceCommand;
import com.custommace.listener.CombatListener;
import com.custommace.listener.CraftingListener;
import com.custommace.listener.JoinListener;
import com.custommace.manager.AbilityManager;
import com.custommace.manager.CooldownManager;
import com.custommace.manager.MaceManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;
import java.io.IOException;

@Getter
public class CustomMace extends JavaPlugin {
    
    private MaceManager maceManager;
    private AbilityManager abilityManager;
    private CooldownManager cooldownManager;
    
    private File dataFile;
    private FileConfiguration dataConfig;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        loadDataFile();
        
        this.cooldownManager = new CooldownManager();
        this.abilityManager = new AbilityManager(this);
        this.maceManager = new MaceManager(this);
        
        registerListeners();
        registerCommands();
        
        getLogger().info("CustomMace plugin enabled successfully!");
    }
    
    @Override
    public void onDisable() {
        saveDataFile();
        getLogger().info("CustomMace plugin disabled!");
    }
    
    private void registerListeners() {
        Bukkit.getPluginManager().registerEvents(new JoinListener(this), this);
        Bukkit.getPluginManager().registerEvents(new CombatListener(this), this);
        Bukkit.getPluginManager().registerEvents(new CraftingListener(this), this);
    }
    
    private void registerCommands() {
        MaceCommand maceCommand = new MaceCommand(this);
        getCommand("macegive").setExecutor(maceCommand);
        getCommand("macereload").setExecutor(maceCommand);
    }
    
    private void loadDataFile() {
        dataFile = new File(getDataFolder(), "data.yml");
        if (!dataFile.exists()) {
            saveResource("data.yml", false);
        }
        dataConfig = YamlConfiguration.loadConfiguration(dataFile);
    }
    
    public void saveDataFile() {
        try {
            dataConfig.save(dataFile);
        } catch (IOException e) {
            getLogger().severe("Could not save data.yml: " + e.getMessage());
        }
    }
    
    public void reloadPlugin() {
        reloadConfig();
        loadDataFile();
    }
}