7jjas

make a plugin that will completely block mace enchanting

Kodari AI
KodariMar 29 at 12:17 am 3,385 (v2)

I’ll create a plugin that blocks all mace enchanting through enchanting tables and anvils.

MaceEnchantBlocker
A lightweight plugin that completely prevents maces from being enchanted through any means. Blocks enchanting table usage and anvil combinations when a mace is involved. Includes configurable messages and bypass permissions for staff. Works seamlessly across all Minecraft versions that support maces using XSeries compatibility.

Plugin created! This will completely block mace enchanting through:

Features:

  • Blocks enchanting table usage on maces

  • Blocks anvil combinations/enchanting with maces

  • Bypass permission (maceenchantblocker.bypass) for staff

  • Configurable messages

  • Works across all versions using XSeries

  • Debug mode for logging blocked attempts

The plugin gracefully handles servers that don’t have maces (pre-1.21) and allows admins with the bypass permission to enchant maces if needed.

7jjas

completely block the possibility of any enchanting at the table and through the book in the anvil

Kodari AI
KodariMar 29 at 12:22 am 8,207 (v2)

I’ll read the current files to understand the existing implementation, then modify it to completely block enchanting table and anvil book enchanting.

I’ll modify the plugin to completely block all enchanting at enchanting tables and all anvil book enchanting.

All enchanting table usage and anvil enchanted book application is now completely blocked.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
5 162
src/main/java/com/maceenchantblocker/MaceEnchantBlocker.java
package com.maceenchantblocker;

import com.maceenchantblocker.listener.MaceEnchantListener;
import lombok.Getter;
import org.bukkit.ChatColor;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class MaceEnchantBlocker extends JavaPlugin {

    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        getServer().getPluginManager().registerEvents(new MaceEnchantListener(this), this);
        
        getLogger().info("MaceEnchantBlocker has been enabled!");
    }

    @Override
    public void onDisable() {
        getLogger().info("MaceEnchantBlocker has been disabled!");
    }

    public String getMessage(String path) {
        return ChatColor.translateAlternateColorCodes('&', getConfig().getString("messages." + path, "&cError loading message."));
    }

    public boolean isFeatureEnabled() {
        return getConfig().getBoolean("enabled", true);
    }

    public boolean isDebug() {
        return getConfig().getBoolean("debug", false);
    }
}