rüzgar

Create a Minecraft Anvil plugin for Folia 26.1.2 using Java 25.

  • /anvil opens a virtual anvil GUI.
  • Players can rename, repair and combine enchanted items.
  • Use normal Minecraft XP costs.
  • LuckPerms permissions: anvil.use and anvil.admin.
  • VIP permission: /lp group vip permission set anvil.use true.
  • All messages must be in Turkish and configurable in config.yml.
  • Fully Folia compatible with folia-supported: true.
  • Prevent item duplication and exploits.
  • Generate complete source code and a downloadable working JAR file.
  • No compilation errors.
Kodari AI
KodariNov 12 at 9:58 am 2
AnvilGUI
A Folia-compatible virtual anvil plugin for Minecraft 26.1.2. Players use /anvil to open a GUI that replicates vanilla anvil functionality including renaming, repairing, and combining enchanted items with standard XP costs. Features LuckPerms integration with anvil.use and anvil.admin permissions, Turkish configurable messages, and robust anti-duplication measures. Built with Folia's regionized scheduling for thread safety and full compatibility.

Created the Folia 26.1.2 plugin using Minecraft’s native anvil mechanics for XP costs and item handling. Messages are configurable in config.yml.

Grant VIP access with: /lp group vip permission set anvil.use true

To get the JAR, click Compile in Kodari’s top bar, then Compile in the window. Once it succeeds, click Download. The build has not yet been verified.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
5 89
src/main/java/com/kodari/sanalors/SanalOrs.java
package com.kodari.sanalors;

import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

public final class SanalOrs extends JavaPlugin {
    @Override
    public void onEnable() {
        saveDefaultConfig();
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!(sender instanceof Player player)) {
            sendMessage(sender, "only-player");
            return true;
        }
        if (!player.hasPermission("anvil.use")) {
            sendMessage(player, "no-permission");
            return true;
        }
        if (args.length != 0) {
            sendMessage(player, "usage");
            return true;
        }
        if (player.openAnvil(null, true) == null) {
            sendMessage(player, "open-failed");
        }
        return true;
    }

    private void sendMessage(CommandSender sender, String key) {
        String message = getConfig().getString("messages." + key, "");
        if (!message.isEmpty()) {
            sender.sendMessage(ChatColor.translateAlternateColorCodes('&', message));
        }
    }
}