ricsi0663

minecraft plugin that gives a mace to the player when they first join the server, and disable crafting maces

Kodari AI
KodariApr 7 at 10:35 am 5,919 (v2)

I’ll create a simple plugin that gives players a mace on their first join and prevents mace crafting.

MaceStarter
A lightweight plugin that automatically gives players a mace when they join the server for the first time and prevents maces from being crafted. Features include persistent player data tracking to ensure the mace is only given once per player, configurable mace enchantments and display name, and complete crafting recipe blocking. Perfect for servers that want to make maces a unique starter item or special reward.

All files created! The plugin gives players a customizable mace on their first join (tracked in data.yml) and completely blocks mace crafting with a configurable message.

ricsi0663

so it is correct what you made but u can still craft it with a crafter

Kodari AI
KodariApr 7 at 10:45 am 2,193 (v2)

I need to read the current implementation to see what’s missing for crafter block support.

I see the issue - the current implementation only blocks manual crafting table usage via PrepareItemCraftEvent, but doesn’t block the automated crafter block that was added in Minecraft 1.20.3+.

I need to add a listener for the CrafterCraftEvent to block the crafter block from crafting maces.

Added support for blocking the crafter block from crafting maces. The CrafterCraftEvent listener will now cancel any mace crafting attempts from automated crafter blocks.

ricsi0663

where is the dowland file

Kodari AI
KodariApr 7 at 10:46 am 1,096 (v2)

The downloadable plugin JAR file will be located in the build/libs/ directory after you build the project.

How to build:

  1. Open terminal/command prompt in the project root directory (where build.gradle is)

  2. Run the build command:

    • On Windows: gradlew.bat build

    • On Mac/Linux: ./gradlew build

  3. Find your JAR:

    • Location: build/libs/MaceStarter-1.0.jar (or similar name based on your build.gradle settings)

  4. Upload to server:

    • Copy the JAR file from build/libs/ to your server’s plugins/ folder

    • Restart the server


Note: The build/ folder is typically not committed to Git (it’s in .gitignore), so you won’t see it until you run the build command for the first time.

If you want me to check your build.gradle configuration to confirm the exact JAR name that will be generated, let me know!

ricsi0663

so can u dowlnad the plugin you made for me

Kodari AI
KodariApr 7 at 10:50 am 2,862 (v2)

I’ll read the existing plugin files to see what’s already been created for you:

I can see your MaceStarter plugin is already created! Here’s what it does:

Features:

  • ✅ Gives new players a customized mace on first join

  • ✅ Prevents mace crafting (in crafting tables & crafter blocks)

  • ✅ Tracks players who already received a mace

  • ✅ /macestarter reload command to reload config

  • ✅ Customizable display name, lore, and enchantments

To compile and use the plugin:

  1. Build the JAR file:

    Shell
    ./gradlew build
    

    (On Windows use: gradlew.bat build)

  2. Find your plugin JAR:

    • The compiled plugin will be in build/libs/MaceStarter-1.0.0.jar

  3. Install on your server:

    • Copy MaceStarter-1.0.0.jar to your server’s plugins/ folder

    • Restart the server

Configuration (config.yml):

  • Customize the mace display name, lore, and enchantments

  • Edit messages sent to players

  • Use & color codes (like &a for green, &c for red)

The plugin requires Minecraft 1.21+ since the mace item was added in that version. All files are ready to build! 🎯

Would you like me to modify anything about the plugin or help you build it?

ricsi0663

can you also make it so it disables the crafting of the crafter

Kodari AI
KodariApr 7 at 10:56 am 3,567 (v2)

I’ll read the existing files to understand the plugin structure and add cr

I’ll update the CraftingListener to also block crafting of the crafter block itself:

Updated CraftingListener to block both mace and crafter crafting, with separate configurable messages for each blocked item type.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
8 348
src/main/java/com/macestarter/MaceStarter.java
package com.macestarter;

import com.macestarter.listener.CraftingListener;
import com.macestarter.listener.PlayerJoinListener;
import com.macestarter.manager.PlayerDataManager;
import lombok.Getter;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class MaceStarter extends JavaPlugin {

    private PlayerDataManager playerDataManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.playerDataManager = new PlayerDataManager(this);
        this.playerDataManager.loadData();
        
        getServer().getPluginManager().registerEvents(new PlayerJoinListener(this), this);
        getServer().getPluginManager().registerEvents(new CraftingListener(this), this);
        
        getLogger().info("MaceStarter has been enabled!");
    }

    @Override
    public void onDisable() {
        if (playerDataManager != null) {
            playerDataManager.saveData();
        }
        getLogger().info("MaceStarter has been disabled!");
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (command.getName().equalsIgnoreCase("macestarter")) {
            if (!sender.hasPermission("macestarter.admin")) {
                sender.sendMessage(colorize("&cYou don't have permission to use this command!"));
                return true;
            }

            if (args.length == 0 || !args[0].equalsIgnoreCase("reload")) {
                sender.sendMessage(colorize("&eUsage: /macestarter reload"));
                return true;
            }

            reloadConfig();
            playerDataManager.loadData();
            sender.sendMessage(colorize(getConfig().getString("messages.reload")));
            return true;
        }
        return false;
    }

    public String colorize(String message) {
        return message.replace('&', '\u00A7');
    }
}