7jjas

Hi i want a plugin who delete any chance of drop a heavy core from Trials chamber

Kodari AI
KodariMar 4 at 12:00 pm 6,115 (v2)

I’ll create a plugin that prevents Heavy Core items from dropping in Trial Chambers.

NoHeavyCore
Prevents Heavy Core items from dropping in Minecraft's Trial Chambers. Listens to item spawn events and automatically removes any Heavy Core drops, ensuring they never appear in the world. Includes configurable messages and optional notifications for administrators. Simple and lightweight solution for servers that want to disable this specific drop without modifying loot tables.

Plugin created! NoHeavyCore will automatically prevent Heavy Core items from dropping anywhere in the world (including Trial Chambers).

Features:

  • Blocks Heavy Core item spawns using cross-version compatible XMaterial

  • Admin notifications when a drop is blocked (configurable)

  • Reload command: /noheavycore reload

  • Fully configurable messages and behavior

  • Logs blocked drops with coordinates

The plugin listens to item spawn events and cancels them if they’re Heavy Cores, effectively removing the drop chance from Trial Chambers.

7jjas

And now make it so that the maximum enchantment on the mace would be Density 3.

Kodari AI
KodariMar 4 at 12:12 pm 11,779 (v2)

I’ll read the existing files to understand the current implementation and add the Density 3 cap for maces.

I’ll add a new listener to cap Density enchantments on maces to level 3. This will check items when they spawn and when chests are opened.

Now I’ll update the main plugin class to register the MaceEnchantmentListener and update the config:

Mace enchantments are now capped at Density 3. The plugin will automatically reduce any Density enchantment above level 3 to level 3 when a mace is picked up, crafted, or enchanted.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
6 267
src/main/java/com/noheavycore/NoHeavyCore.java
package com.noheavycore;

import com.noheavycore.listener.ItemSpawnListener;
import com.noheavycore.listener.MaceEnchantmentListener;
import lombok.Getter;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class NoHeavyCore extends JavaPlugin {

    private FileConfiguration config;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        this.config = getConfig();

        getServer().getPluginManager().registerEvents(new ItemSpawnListener(this), this);
        getServer().getPluginManager().registerEvents(new MaceEnchantmentListener(this), this);

        getLogger().info("NoHeavyCore has been enabled!");
    }

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

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

            if (args.length == 0) {
                sender.sendMessage(colorize("&6NoHeavyCore &7v" + getDescription().getVersion()));
                sender.sendMessage(colorize("&7Use &f/noheavycore reload &7to reload the config."));
                return true;
            }

            if (args[0].equalsIgnoreCase("reload")) {
                reloadConfig();
                this.config = getConfig();
                sender.sendMessage(colorize(config.getString("messages.prefix") + " " + config.getString("messages.reload")));
                return true;
            }

            sender.sendMessage(colorize("&cUsage: /noheavycore reload"));
            return true;
        }
        return false;
    }

    public String colorize(String message) {
        return ChatColor.translateAlternateColorCodes('&', message);
    }

    public boolean isPluginEnabled() {
        return config.getBoolean("enabled", true);
    }

    public boolean shouldNotifyAdmins() {
        return config.getBoolean("notify-admins", true);
    }

    public String getMessage(String path) {
        String prefix = config.getString("messages.prefix", "&8[&6NoHeavyCore&8]&r");
        String message = config.getString("messages." + path, "");
        return colorize(prefix + " " + message);
    }
}