v8px.

1.21.11 plugin that makes anvils easier to craft! called EasyAnvil, and it is top left and right iron ingots moddle iron ingot and bottom three slots iron ingots but the top middle is a iron block

Kodari AI
KodariMay 13 at 2:48 am 4,104 (v2)

I’ll create a simple plugin that adds a cheaper anvil crafting recipe.

EasyAnvil
A lightweight plugin that makes anvils more accessible by adding a cheaper crafting recipe. The new recipe requires only 6 iron ingots and 1 iron block (15 ingots total) instead of the vanilla recipe requiring 31 ingots. Perfect for survival servers where anvils are essential but resource-intensive to craft early game.

Done! Created EasyAnvil plugin with:

  • Custom anvil recipe using 6 iron ingots + 1 iron block (15 ingots total vs vanilla’s 31)

  • Recipe layout matches your specification with iron block in top middle

  • Config option to enable/disable and optionally remove vanilla recipe

  • /easyanvil reload command for admins

  • XSeries integration for cross-version compatibility

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
5 197
src/main/java/com/easyanvil/EasyAnvil.java
package com.easyanvil;

import lombok.Getter;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class EasyAnvil extends JavaPlugin {

    private RecipeManager recipeManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.recipeManager = new RecipeManager(this);
        
        if (getConfig().getBoolean("enabled", true)) {
            recipeManager.registerRecipe();
            getLogger().info("Custom anvil recipe has been registered!");
        } else {
            getLogger().info("Custom anvil recipe is disabled in config.");
        }
        
        getLogger().info("EasyAnvil has been enabled!");
    }

    @Override
    public void onDisable() {
        if (recipeManager != null) {
            recipeManager.unregisterRecipe();
        }
        getLogger().info("EasyAnvil has been disabled!");
    }

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

            if (args.length == 0) {
                sender.sendMessage(ChatColor.GOLD + "EasyAnvil v" + getDescription().getVersion());
                sender.sendMessage(ChatColor.YELLOW + "Use /easyanvil reload to reload the config.");
                return true;
            }

            if (args[0].equalsIgnoreCase("reload")) {
                reloadConfig();
                recipeManager.unregisterRecipe();
                
                if (getConfig().getBoolean("enabled", true)) {
                    recipeManager.registerRecipe();
                    sender.sendMessage(ChatColor.GREEN + "EasyAnvil config reloaded! Custom recipe is enabled.");
                } else {
                    sender.sendMessage(ChatColor.GREEN + "EasyAnvil config reloaded! Custom recipe is disabled.");
                }
                return true;
            }

            sender.sendMessage(ChatColor.RED + "Unknown subcommand. Use /easyanvil reload");
            return true;
        }
        return false;
    }
}