Iris Shaders

IceSMP Custom Tools Plugin

Create a complete, professional Minecraft Paper plugin named IceTools for Minecraft Java 26.3.

The plugin must be fully functional, optimized, and compatible with LuckPerms, Vault, WorldGuard, and standard Paper servers.

IMPORTANT VERSION INFORMATION:

  • Actual server version: Paper 26.3.
  • My Minecraft client version: 1.21.11.
  • ViaVersion is installed on the server.
  • Build the plugin specifically for Paper 26.3, NOT Paper 1.21.11.
  • Use Java 25 for building the plugin.
  • Ensure players connecting with Minecraft 1.21.11 through ViaVersion can use all tools correctly.
  1. Main Command & Permissions

Create this command:

"/iced give <player> <item>"

Supported items:

  • "icedrill"
  • "iceaxe"
  • "iceshovel"
  • "icesponge"
  • "icebucket"
  • "icesellaxe"

Examples:

  • "/iced give Steve icedrill"
  • "/iced give Steve iceaxe"
  • "/iced give Steve iceshovel"
  • "/iced give Steve icesponge"
  • "/iced give Steve icebucket"
  • "/iced give Steve icesellaxe"

Strict OP-Only Access

IMPORTANT: Only Minecraft OP players can use the "/iced" command.

  • Only players with actual server OP status can execute "/iced".
  • Regular players must never be able to give themselves or others these tools.
  • Apply this restriction to ALL subcommands, including "/iced give", "/iced reload", and "/iced help".
  • Do not rely only on LuckPerms permissions.
  • Check "player.isOp()" server-side before executing any subcommand.
  • Regular players receive: "&cYou don't have permission to use this command!"
  • Console can execute "/iced" commands.
  • Tab completion must not reveal any administrative functionality to unauthorized players.
  1. IceDrill – 6000 Uses

Item: Diamond Pickaxe.

Features:

  • Mine a 3x3 area in front of the player.
  • Break blocks in the direction the player is facing.
  • The 3x3 mining area must include the center block and surrounding blocks.
  • Must work underground and in all directions.
  • Only break blocks that can normally be mined with a pickaxe.
  • Respect WorldGuard protection and other region protections.
  • Do not break protected blocks or containers.
  • Each block broken consumes 1 use.
  • Display remaining uses in the item lore.

Maximum uses: 6000/6000.

  1. IceAxe – 3500 Uses

Item: Diamond Axe.

Features:

  • Tree Feller: Break an entire connected tree with one hit.
  • Detect connected logs belonging to the same tree.
  • Do not break nearby unrelated wooden structures.
  • Respect region protections.
  • Each log broken consumes 1 use.
  • Display remaining uses in lore.

Maximum uses: 3500/3500.

  1. IceShovel – 5000 Uses

Item: Diamond Shovel.

Features:

  • Break a 3x3 area of shovel-compatible blocks.
  • Support dirt, grass blocks, sand, gravel, mud, and other blocks normally mined with a shovel.
  • Follow the player's facing direction.
  • Respect region protections.
  • Each block broken consumes 1 use.
  • Display remaining uses in lore.

Maximum uses: 5000/5000.

  1. IceSponge – 750 Uses

Item: Sponge.

Features:

  • Remove water and lava in the selected area.
  • Work with both flowing and source liquids.
  • Do not affect protected regions.
  • Each activation consumes 1 use.
  • Display remaining uses in lore.

Maximum uses: 750/750.

  1. IceBucket – 6000 Uses

Item: Bucket.

Features:

  • A special reusable liquid bucket.
  • Store up to 16 buckets worth of liquid.
  • Support both water and lava.
  • Allow players to collect and place liquids.
  • Track stored liquid type and quantity.
  • Never duplicate liquids.
  • Prevent mixing water and lava in the same storage.
  • Each successful collection or placement consumes 1 use.
  • Display remaining uses and stored capacity in lore.

Maximum uses: 6000/6000.

  1. IceSellAxe – 4000 Uses

Item: Diamond Axe.

Features:

  • A special selling axe.
  • When breaking supported sellable blocks, automatically sell the drops.
  • Integrate with Vault economy.
  • Deposit money directly into the player's balance.
  • Show the amount earned.
  • Only sell supported items with configured prices.
  • Respect region protections.
  • Each successful sale consumes uses based on the items sold.
  • Display remaining uses in lore.

Maximum uses: 4000/4000.

  1. Item Appearance

All tools must have:

  • Custom display names using IceSMP branding.
  • Custom lore.
  • Remaining uses displayed clearly.
  • Maximum uses displayed.
  • Custom enchantment glint.
  • Unbreakable vanilla durability, with our own custom Uses system.

Example lore:

&b&lICE DRILL &7Special Mining Tool

&fUses: &b6000/6000

&8IceSMP Exclusive

  1. Important Technical Requirements
  • Save each item's identity and remaining uses using PersistentDataContainer.
  • Uses must persist after server restarts.
  • Prevent item duplication exploits.
  • Prevent bypassing the custom uses system.
  • Support anvils, inventory movement, and item dropping safely.
  • Protect against WorldGuard bypasses.
  • Do not consume uses when an action fails.
  • Handle creative mode safely.
  • Provide a configurable config.yml for prices, uses, item names, and settings.
  • Add proper permissions.
  • Add a reload command: "/iced reload".
  • Add "/iced help".
  • Provide clear success and error messages.
  1. Final Delivery

Build the actual working plugin, not just example code.

Deliver:

  1. A compiled ".jar" file ready to install.
  2. Complete Java source code.
  3. "plugin.yml".
  4. Default "config.yml".
  5. Installation instructions.

The plugin must compile successfully for Paper 26.3 using Java 25.

Do not target Paper 1.21.11.

Do not leave unfinished methods, placeholders, or simulated functionality. Test the build and fix compilation errors before delivering.

Final permission rule: Every "/iced" subcommand must verify actual server OP status before execution. Never allow regular players to use administrative commands.

The plugin must work for players connecting from Minecraft 1.21.11 through ViaVersion.

Kodari AI
KodariNov 14 at 7:49 am 4
IceTools
IceTools is a comprehensive Paper plugin for IceSMP servers that adds six specialized mining tools with custom durability systems. Features include a 3x3 mining IceDrill, tree-felling IceAxe, area-clearing IceShovel, liquid-absorbing IceSponge, reusable liquid-storing IceBucket, and an auto-selling IceSellAxe integrated with Vault economy. All tools feature custom names, lore, persistent use counts via PersistentDataContainer, WorldGuard protection respect, and configurable settings. Admin commands are strictly OP-only with tab completion protection.

Created the IceTools source, plugin.yml, default configuration, and Java 25 build configuration.

This is not yet a verified, production-ready delivery. I couldn’t compile or test it here, so I can’t provide a verified JAR or guarantee Paper 26.3 and ViaVersion compatibility. Protection, liquid handling, and duplication safety still require testing before deployment.

To build it in Kodari, click Compile in the top bar, then Compile in the window. If it succeeds, download the JAR from that build. Install it on a Paper server with Vault and an economy provider for selling; WorldGuard and LuckPerms are optional integrations. Test on a staging server before using it on IceSMP.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
5 464
src/main/java/com/icesmp/icetools/IceTools.java
package com.icesmp.icetools;

import com.cryptomorin.xseries.XEnchantment;
import com.cryptomorin.xseries.XItemFlag;
import com.cryptomorin.xseries.XMaterial;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldguard.LocalPlayer;
import com.sk89q.worldguard.WorldGuard;
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
import com.sk89q.worldguard.protection.flags.Flags;
import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.economy.EconomyResponse;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.BlockState;
import org.bukkit.block.Container;
import org.bukkit.block.data.Levelled;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockDropItemEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.inventory.PrepareAnvilEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataContainer;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;

import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Set;

public final class IceTools extends JavaPlugin implements Listener, TabExecutor {
    private static final List<String> TYPES = Arrays.asList("icedrill", "iceaxe", "iceshovel", "icesponge", "icebucket", "icesellaxe");
    private NamespacedKey typeKey, usesKey, maxKey, liquidKey, amountKey;
    private final Set<java.util.UUID> processing = new HashSet<>();

    @Override
    public void onEnable() {
        saveDefaultConfig();
        typeKey = new NamespacedKey(this, "type");
        usesKey = new NamespacedKey(this, "uses");
        maxKey = new NamespacedKey(this, "maximum");
        liquidKey = new NamespacedKey(this, "liquid");
        amountKey = new NamespacedKey(this, "amount");
        getServer().getPluginManager().registerEvents(this, this);
        getCommand("iced").setExecutor(this);
        getCommand("iced").setTabCompleter(this);
    }

    private String color(String text) {
        return ChatColor.translateAlternateColorCodes('&', text);
    }

    private String type(ItemStack item) {
        if (item == null || !item.hasItemMeta()) return null;
        String type = item.getItemMeta().getPersistentDataContainer().get(typeKey, PersistentDataType.STRING);
        return TYPES.contains(type) ? type : null;
    }

    private int number(ItemStack item, NamespacedKey key) {
        if (item == null || !item.hasItemMeta()) return 0;
        return item.getItemMeta().getPersistentDataContainer().getOrDefault(key, PersistentDataType.INTEGER, 0);
    }

    private ItemStack create(String type) {
        String material = switch (type) {
            case "icedrill" -> "DIAMOND_PICKAXE";
            case "iceaxe", "icesellaxe" -> "DIAMOND_AXE";
            case "iceshovel" -> "DIAMOND_SHOVEL";
            case "icesponge" -> "SPONGE";
            default -> "BUCKET";
        };
        ItemStack item = XMaterial.matchXMaterial(material).map(XMaterial::parseItem).orElseThrow();
        ItemMeta meta = item.getItemMeta();
        int max = Math.max(1, getConfig().getInt("tools." + type + ".uses", 1));
        PersistentDataContainer data = meta.getPersistentDataContainer();
        data.set(typeKey, PersistentDataType.STRING, type);
        data.set(usesKey, PersistentDataType.INTEGER, max);
        data.set(maxKey, PersistentDataType.INTEGER, max);
        data.set(amountKey, PersistentDataType.INTEGER, 0);
        meta.setUnbreakable(true);
        XEnchantment.matchXEnchantment("UNBREAKING").ifPresent(e -> meta.addEnchant(e.getEnchant(), 1, true));
        XItemFlag.of("HIDE_ENCHANTS").ifPresent(flag -> flag.set(meta));
        item.setItemMeta(meta);
        refresh(item);
        return item;
    }

    private void refresh(ItemStack item) {
        String type = type(item);
        if (type == null) return;
        ItemMeta meta = item.getItemMeta();
        PersistentDataContainer data = meta.getPersistentDataContainer();
        meta.setDisplayName(color(getConfig().getString("tools." + type + ".name", "&bIce Tool")));
        List<String> lore = new ArrayList<>();
        lore.add(color("&7IceSMP Special Tool"));
        lore.add("");
        lore.add(color("&fUses: &b" + data.getOrDefault(usesKey, PersistentDataType.INTEGER, 0) + "/" + data.getOrDefault(maxKey, PersistentDataType.INTEGER, 0)));
        if (type.equals("icebucket")) {
            String liquid = data.getOrDefault(liquidKey, PersistentDataType.STRING, "empty");
            lore.add(color("&fStored: &b" + liquid + " " + data.getOrDefault(amountKey, PersistentDataType.INTEGER, 0) + "/16"));
        }
        lore.add("");
        lore.add(color("&8IceSMP Exclusive"));
        meta.setLore(lore);
        item.setItemMeta(meta);
    }

    private void consume(ItemStack item, int amount) {
        ItemMeta meta = item.getItemMeta();
        PersistentDataContainer data = meta.getPersistentDataContainer();
        data.set(usesKey, PersistentDataType.INTEGER, Math.max(0, data.getOrDefault(usesKey, PersistentDataType.INTEGER, 0) - amount));
        item.setItemMeta(meta);
        refresh(item);
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (sender instanceof Player player && !player.isOp()) {
            sender.sendMessage(color("&cYou don't have permission to use this command!"));
            return true;
        }
        if (args.length == 1 && args[0].equalsIgnoreCase("reload")) {
            reloadConfig();
            sender.sendMessage(color("&aIceTools configuration reloaded."));
        } else if (args.length == 3 && args[0].equalsIgnoreCase("give")) {
            Player target = Bukkit.getPlayerExact(args[1]);
            String type = args[2].toLowerCase(Locale.ROOT);
            if (target == null || !TYPES.contains(type)) {
                sender.sendMessage(color("&cUnknown online player or tool."));
            } else if (target.getInventory().firstEmpty() == -1) {
                sender.sendMessage(color("&cThat player's inventory is full."));
            } else {
                target.getInventory().addItem(create(type));
                sender.sendMessage(color("&aGave " + type + " to " + target.getName() + "."));
                target.sendMessage(color("&bYou received an IceSMP tool!"));
            }
        } else {
            sender.sendMessage(color("&b/iced give <player> <item> &7| &b/iced reload &7| &b/iced help"));
        }
        return true;
    }

    @Override
    public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
        if (sender instanceof Player player && !player.isOp()) return Collections.emptyList();
        List<String> choices = new ArrayList<>();
        if (args.length == 1) choices.addAll(Arrays.asList("give", "reload", "help"));
        else if (args[0].equalsIgnoreCase("give") && args.length == 2) {
            for (Player p : Bukkit.getOnlinePlayers()) choices.add(p.getName());
        } else if (args[0].equalsIgnoreCase("give") && args.length == 3) choices.addAll(TYPES);
        String prefix = args[args.length - 1].toLowerCase(Locale.ROOT);
        choices.removeIf(s -> !s.toLowerCase(Locale.ROOT).startsWith(prefix));
        return choices;
    }

    private boolean allowed(Player player, Block block, boolean place) {
        if (!block.getChunk().isLoaded()) return false;
        if (!Bukkit.getPluginManager().isPluginEnabled("WorldGuard")) return true;
        LocalPlayer local = WorldGuardPlugin.inst().wrapPlayer(player);
        if (WorldGuard.getInstance().getPlatform().getSessionManager().hasBypass(local, local.getWorld())) return true;
        return WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery()
                .testState(BukkitAdapter.adapt(block.getLocation()), local, place ? Flags.BLOCK_PLACE : Flags.BLOCK_BREAK);
    }

    private boolean safe(Block block) {
        return !(block.getState() instanceof Container) && block.getType().isBlock() && block.getType().getHardness() >= 0;
    }

    @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
    public void onBreak(BlockBreakEvent event) {
        Player player = event.getPlayer();
        if (processing.contains(player.getUniqueId())) return;
        ItemStack item = player.getInventory().getItemInMainHand();
        String type = type(item);
        if (type == null) return;
        if (!player.hasPermission("icetools.use") || number(item, usesKey) <= 0 || item.getAmount() != 1) {