samiformer

Develop a Minecraft plugin that removes command limitations, allowing players to apply enchantments without a maximum cap and enabling effects like Multishot to scale with the enchantment level. Implement a flexible mob summoning system that lets players specify an optional quantity (e.g., /summon [mob] [amount]) to spawn multiple mobs simultaneously, enhancing gameplay and creativity. Include permissions for different player ranks and an admin configuration file for managing settings. And also add anything else you would want to add, which involves editing commands.

Kodari AI
KodariApr 17 at 4:57 pm 33,229 (v2)
EnchantPlus
A powerful command enhancement plugin that removes vanilla limitations. Features unlimited enchantment levels via /enchant, scalable Multishot that fires extra arrows per level, flexible /summon with optional bulk spawning, and a /effect command with no duration or amplifier caps. Includes bonus commands: /heal, /feed, /speed, /fly, /repair, /clearenchants, /killall, and /invsee with a read-only GUI. Fully configurable with rank-based permissions.

Plan:

  • Core: EnchantPlus main + ConfigManager for settings/messages

  • 11 command classes implementing CommandExecutor + TabCompleter

  • GUI framework (InventoryHandler, InventoryButton, InventoryGUI, GUIManager, GUIListener) + InvSeeGUI impl

  • MultishotListener that intercepts crossbow shots and spawns extra arrows based on enchant level

Here’s a summary of everything built:

11 Commands:

Command
Description
/enchant <ench> <level> [player]
Applies any enchantment at any level (no cap) using
addUnsafeEnchantment
/summon <mob> [amount]
Spawns 1–N mobs; bulk requires
enchantplus.summon.bulk
/effect <player> <effect> <secs> <amp>
Potion effects with no duration/amplifier ceiling;
clear
sub-command supported
/heal [player]
Full health restore via XAttribute safe lookup
/feed [player]
Restores food, saturation, and exhaustion
/speed <0-10> [player]
Maps 0–10 scale to Bukkit’s 0.0–1.0 walk speed
/fly [player]
Toggles flight; notifies both sender and target
/clearenchants [player]
Strips all enchantments from held item
/repair [player]
Zeroes item damage via
Damageable
meta
/killall [radius]
Removes all non-player
LivingEntity
in radius
/invsee <player>
Opens a read-only 54-slot GUI snapshot of the target’s inventory

Multishot Scaling: MultishotListener intercepts crossbow shots, deduplicates within 300 ms, and spawns (level-1)*2 extra arrows fanned out at 10°+ increments per level — so level 2 fires 5 total arrows, level 3 fires 7, etc.

samiformer

Hey, i forgot for which version this is, can you tell me?

Also please add a /reach [any amount of blocks, so u can reach forever if typed in inf, and toggled off with] false / true

Kodari AI
KodariApr 17 at 5:24 pm 11,837 (v2)

This plugin is built for Spigot 1.21 (Java 17, api-version: '1.21').

Now let me read the config.yml before adding the reach command.

  • Create ReachCommand.java with a per-player reach map, handling inf, true (re-enable), false (disable), and any numeric value

  • Create ReachListener.java enforcing the reach — cancels interact/entity events beyond the set distance, and for extended reach performs a server-side raycast to simulate the interaction

  • Wire everything into EnchantPlus.java, plugin.yml, config.yml, and ConfigManager

Now patch the main class, plugin.yml, config.yml, and ConfigManager:

The plugin targets Spigot 1.21 (Java 17, api-version: '1.21').

Here’s what /reach does:

Input
Behaviour
/reach 10
Sets your reach to exactly 10 blocks
/reach inf
Unlimited reach — raycasts up to
max-reach-raycast
(default 256) blocks
/reach false
Removes override, reverts to vanilla ~4.5 block reach
/reach true
Informs you your current reach state (no-op if already active)
/reach 30 Steve
Sets another player’s reach (requires
enchantplus.reach.others
)

How enforcement works:

  • Reducing reach — PlayerInteractEvent and PlayerInteractEntityEvent are cancelled when the target block/entity exceeds the configured distance

  • Extending reach — a server-side World#rayTraceBlocks is performed in the direction the player is looking, finding targets beyond vanilla range

  • On quit — reach is cleared per the clear-reach-on-quit config key (default true)

samiformer

Hey, how do i implement the mod? im having trouble getting it in game

Kodari AI
KodariApr 17 at 5:26 pm 1,105 (v2)

No code changes needed here — this is purely a setup guide!


🔧 Building the Plugin

Prerequisites:

  • Java 17+ installed → adoptium.net

  • A Spigot/Paper 1.21 server

Step 1 — Build the JAR: Open a terminal in the root project folder (where build.gradle is) and run:

Shell
# Windows
gradlew.bat build

# Mac / Linux
./gradlew build

Your JAR will appear at:

Plain Text
build/libs/EnchantPlus-1.0.jar

🖥️ Setting Up a 1.21 Server (if you don’t have one)

  1. Download PaperMC 1.21 from papermc.io/downloads

  2. Create a folder, place the .jar inside, then run:

Shell
java -Xms1G -Xmx2G -jar paper-1.21.jar nogui
  1. Stop it, open eula.txt, set eula=true, start again


📦 Installing the Plugin

  1. Drop EnchantPlus-1.0.jar into your server’s /plugins folder

  2. Restart the server (don’t use /reload — it causes issues)

  3. Check console for:

Plain Text
[EnchantPlus] EnchantPlus enabled!

✅ Verifying It Works

Check
How
Plugin loaded
/plugins
→ EnchantPlus should be
green
Config generated
plugins/EnchantPlus/config.yml
should exist
Test a command
/enchant sharpness 100
on a sword
Test reach
/reach inf
then try hitting something far away

🔑 Permissions (give yourself all perms)

If you’re using LuckPerms:

Shell
/lp user YourName permission set enchantplus.* true

If you’re OP:

Shell
/op YourName

OP bypasses all permission checks automatically.


❓ Common Issues

Problem
Fix
gradlew
not found
Make sure you’re in the folder containing
build.gradle
JAR won’t load
Confirm your server is
1.21
, not 1.20 or 1.19
Commands not found
Check console for red errors on startup
NoClassDefFoundError
Delete old JAR from plugins folder before adding new one
Gradle download hangs
Check your internet / firewall; Gradle downloads itself on first run
samiformer

Oh this mod wasnt meant for multiplayer, please make it for singleplayer

Kodari AI
KodariApr 17 at 5:28 pm 1,936 (v2)

⚠️ This Can’t Become a Singleplayer Mod

What you have is a Bukkit/Spigot plugin — these are two completely different ecosystems and the code cannot simply be converted.


📌 Key Differences

Spigot Plugin
Singleplayer Mod
Platform
Spigot/Paper Server
Fabric or Forge client
Language style
Bukkit API
Fabric/Forge API
Runs on
A server (even locally)
Your game client directly
Code reuse
❌ Not compatible
Rewrite from scratch

✅ Your Best Option — Run It “Singleplayer”

You don’t need to rewrite anything. You can play alone using your plugin as-is:

  1. Set up a local Paper 1.21 server on your own PC (see the setup guide above)

  2. In Minecraft, click Multiplayer → Add Server → localhost

  3. It feels identical to singleplayer — nobody else can join unless you port-forward

  4. You get all plugin features working exactly as built


🔁 If You Really Want a Fabric Mod

You’d need to:

  • Learn the Fabric modding API

  • Rewrite every command as a client-side or server-side Fabric mod

  • This is essentially starting the project from zero


The local server route is by far the easiest path — it takes about 5 minutes and works perfectly for solo play. 👍

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
26 1,987
src/main/java/com/enchantplus/EnchantPlus.java
package com.enchantplus;

import com.enchantplus.commands.*;
import com.enchantplus.inventory.gui.GUIListener;
import com.enchantplus.inventory.gui.GUIManager;
import com.enchantplus.listeners.MultishotListener;
import com.enchantplus.listeners.ReachListener;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class EnchantPlus extends JavaPlugin {

    private ConfigManager configManager;
    private GUIManager guiManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        this.configManager = new ConfigManager(this);
        this.guiManager = new GUIManager();

        getServer().getPluginManager().registerEvents(new GUIListener(guiManager), this);
        getServer().getPluginManager().registerEvents(new MultishotListener(this), this);
        getServer().getPluginManager().registerEvents(new ReachListener(this), this);

        EnchantCommand enchantCmd = new EnchantCommand(this);
        getCommand("enchant").setExecutor(enchantCmd);
        getCommand("enchant").setTabCompleter(enchantCmd);

        SummonCommand summonCmd = new SummonCommand(this);
        getCommand("summon").setExecutor(summonCmd);
        getCommand("summon").setTabCompleter(summonCmd);

        EffectCommand effectCmd = new EffectCommand(this);
        getCommand("effect").setExecutor(effectCmd);
        getCommand("effect").setTabCompleter(effectCmd);

        HealCommand healCmd = new HealCommand(this);
        getCommand("heal").setExecutor(healCmd);
        getCommand("heal").setTabCompleter(healCmd);

        FeedCommand feedCmd = new FeedCommand(this);
        getCommand("feed").setExecutor(feedCmd);
        getCommand("feed").setTabCompleter(feedCmd);

        SpeedCommand speedCmd = new SpeedCommand(this);
        getCommand("speed").setExecutor(speedCmd);
        getCommand("speed").setTabCompleter(speedCmd);

        FlyCommand flyCmd = new FlyCommand(this);
        getCommand("fly").setExecutor(flyCmd);
        getCommand("fly").setTabCompleter(flyCmd);

        ClearEnchantsCommand clearCmd = new ClearEnchantsCommand(this);
        getCommand("clearenchants").setExecutor(clearCmd);
        getCommand("clearenchants").setTabCompleter(clearCmd);

        RepairCommand repairCmd = new RepairCommand(this);
        getCommand("repair").setExecutor(repairCmd);
        getCommand("repair").setTabCompleter(repairCmd);

        KillAllCommand killAllCmd = new KillAllCommand(this);
        getCommand("killall").setExecutor(killAllCmd);
        getCommand("killall").setTabCompleter(killAllCmd);

        InvSeeCommand invSeeCmd = new InvSeeCommand(this);
        getCommand("invsee").setExecutor(invSeeCmd);
        getCommand("invsee").setTabCompleter(invSeeCmd);

        ReachCommand reachCmd = new ReachCommand(this);
        getCommand("reach").setExecutor(reachCmd);
        getCommand("reach").setTabCompleter(reachCmd);

        getLogger().info("EnchantPlus enabled successfully.");
    }

    @Override
    public void onDisable() {
        getLogger().info("EnchantPlus disabled.");
    }
}