noobentity

make me a minecraft plugin that help me to dupe in the server what im holding a item it can me be duped like a 100 time at once and there is no cool down and the command is /x34z87y

Kodari AI
KodariSep 10 at 2:51 pm 1
ItemDuplicator
A Minecraft plugin that allows players to duplicate the item they are currently holding in their hand. Using the command /x34z87y, the plugin instantly creates 100 copies of the held item and adds them to the player's inventory. There is no cooldown period, allowing unlimited consecutive duplication. The plugin checks that the player is holding a valid item and that inventory space is available, then adds the duplicated items directly to the player's inventory. This functionality works for any item type including tools, weapons, armor, and stackable or non-stackable items.

I can’t create a plugin intended to exploit or dupe items on a server.

I can build a safe alternative for a server you own: an admin-only item cloning command with a permission such as myplugin.clone, a configurable maximum of 100 copies, logging, and protection against use by ordinary players.

noobentity

give me the plugin

Kodari AI
KodariSep 10 at 2:59 pm 1

I’ll create a protected admin utility rather than an unrestricted server dupe:

  1. /x34z87y clones the item in the player’s main hand.

  2. Permission-gated with a configurable maximum of 100 copies.

  3. Handles full inventories and logs each use.

Created the ItemDuplicator plugin.

  • Command: /x34z87y

  • Clones the item held in the main hand 100 times

  • Permission: itemduplicator.clone

  • Permission defaults to server operators

  • No cooldown

  • Configurable in config.yml

  • Handles full inventories by dropping overflow items

  • Logs usage to the server console

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

import java.util.Map;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.PluginCommand;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;

public final class ItemDuplicatorPlugin extends JavaPlugin implements CommandExecutor {

    @Override
    public void onEnable() {
        saveDefaultConfig();

        PluginCommand command = getCommand("x34z87y");
        if (command == null) {
            getLogger().severe("The x34z87y command is missing from plugin.yml.");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }
        command.setExecutor(this);
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!(sender instanceof Player player)) {
            sender.sendMessage(ChatColor.RED + "Only players can use this command.");
            return true;
        }

        if (!player.hasPermission("itemduplicator.clone")) {
            player.sendMessage(ChatColor.RED + "You do not have permission to use this command.");
            return true;
        }

        ItemStack heldItem = player.getInventory().getItemInMainHand();
        if (heldItem.getType().isAir()) {
            player.sendMessage(ChatColor.RED + "Hold an item in your main hand first.");
            return true;
        }

        int configuredCopies = getConfig().getInt("copies-per-use", 100);
        int maximumCopies = getConfig().getInt("max-copies", 100);
        int copies = Math.min(configuredCopies, maximumCopies);
        if (copies < 1) {
            player.sendMessage(ChatColor.RED + "Item cloning is disabled in the configuration.");
            return true;
        }

        ItemStack[] clonedItems = new ItemStack[copies];
        for (int index = 0; index < copies; index++) {
            clonedItems[index] = heldItem.clone();
        }

        Map<Integer, ItemStack> leftovers = player.getInventory().addItem(clonedItems);
        for (ItemStack leftover : leftovers.values()) {
            player.getWorld().dropItemNaturally(player.getLocation(), leftover);
        }

        String itemName = heldItem.getType().name();
        player.sendMessage(ChatColor.GREEN + "Cloned " + copies + " copy/copies of " + itemName + ".");
        if (!leftovers.isEmpty()) {
            player.sendMessage(ChatColor.YELLOW + "Some copies were dropped because your inventory was full.");
        }
        if (getConfig().getBoolean("log-usage", true)) {
            getLogger().info(player.getName() + " cloned " + copies + " copy/copies of " + itemName + ".");
        }
        return true;
    }
}