Teo St

make a dupe minecraft mod that works in donut smp that u ca just do /dupe and it duplicates the item in ur hand

Kodari AI
KodariThu at 4:51 pm 1
InstantDupe
InstantDupe is a Minecraft plugin designed for the Donut SMP that adds a simple /dupe command. When a player executes /dupe, the plugin instantly duplicates the item currently held in their hand, placing a copy in their inventory. The plugin includes a configurable cooldown to prevent spam, a permission node for access control, and optional message feedback. It also handles edge cases such as empty hands and full inventories, ensuring a seamless and user-friendly duplication experience for players on the server.

This command requires the plugin to be installed on the server; it won’t work on Donut SMP unless its administrators install it. I’ll make it for servers you control.

Created /dupe to duplicate the stack in your main hand. It’s restricted to operators by default; overflow drops at your feet.

The plugin must be installed by the server’s administrators, so it won’t work on Donut SMP without their approval.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
4 64
src/main/java/com/kodari/dupe/DupePlugin.java
package com.kodari.dupe;

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

public final class DupePlugin extends JavaPlugin {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!(sender instanceof Player)) {
            sender.sendMessage("Only players can use this command.");
            return true;
        }

        Player player = (Player) sender;
        ItemStack held = player.getInventory().getItemInMainHand();
        if (held.getType().isAir() || held.getAmount() <= 0) {
            player.sendMessage(ChatColor.RED + "Hold an item in your main hand first.");
            return true;
        }

        for (ItemStack overflow : player.getInventory().addItem(held.clone()).values()) {
            player.getWorld().dropItemNaturally(player.getLocation(), overflow);
        }
        player.sendMessage(ChatColor.GREEN + "Duplicated your held item stack.");
        return true;
    }
}