samiformer

Develop a Minecraft plugin that removes all command limitations for enchantments and mob summoning. Allow players to enchant items with unlimited levels and configure how many mobs are spawned using commands, such as /summon [mob] [amount], where the amount can be specified up to any value. Include a user-friendly configuration file for setting default limits and permissions for different player ranks. Also make some commands which you think will be useful

Kodari AI
KodariApr 17 at 5:33 pm 14,555 (v2)
UnlimitedCommandsPlus
A Fabric 1.21.4 mod that removes all vanilla limitations on enchantments and mob spawning. Players can enchant items to any level via /enchant and summon multiple mobs at once via /summon. Includes /killmobs, /clearenchants, /iteminfo, and /enchantlist commands. Supports a TOML config file for setting default max levels, spawn limits, and per-rank permission nodes. Fully configurable and permission-aware.

Let me read the required docs before writing any code.

UnlimitedCommandsPlus
A Fabric 1.21.4 mod removing all vanilla limitations on enchantments and mob spawning. Provides /enchant (any level), /enchantall, /clearenchants, /enchantlist, /summon (with quantity and spread), /killmobs, /iteminfo, and /ucreload commands. Includes a JSON config file for customizing max enchant levels, max spawn amounts, default spread radius, kill radius, and per-command permission levels for different operator ranks.

Now let me plan the class structure before writing:

  • UnlimitedCommandsPlus.java — mod initializer, wires everything up

  • ModConfig.java — plain config data POJO

  • ConfigManager.java — load/save config via Gson

  • commands/CommandRegistry.java — all Brigadier command registrations

  • Build files + resources

Here’s a summary of everything created:

8 files total. The mod provides these commands:

Command
Description
/enchant <name> [level]
Enchant held item to any level (up to config max)
/enchantall [level]
Apply every enchantment at once to held item
/clearenchants
Strip all enchantments from held item
/enchantlist [page]
Paginated list of all enchantment IDs with short names
/summon <entity> [amount] [spread]
Spawn multiple entities with optional random spread radius
/killmobs [radius]
Kill all non-player entities within radius
/iteminfo
Show type, count, durability, and all enchantments on held item
/ucreload
Reload
unlimitedcmds.json
config at runtime

Config lives at .minecraft/config/unlimitedcmds.json and controls max enchant level (default 32767), max spawn amount (10000), spreads, kill radius, and individual permission levels per command.

samiformer

The compilation failed with this error:

code
Compilation failed with 2 error(s):

ERROR in src/main/java/com/unlimitedcmds/commands/CommandRegistry.java at line 12: cannot find symbol
import net.minecraft.command.argument.EntitySummonArgumentType;
                                     ^
  symbol: class EntitySummonArgumentType
  location: package net.minecraft.command.argument

ERROR in   src/main/java/com/unlimitedcmds/commands/CommandRegistry.java at line 12: cannot find symbol
  import net.minecraft.command.argument.EntitySummonArgumentType;
                                       ^
  symbol: class EntitySummonArgumentType
  location: package net.minecraft.command.argument


=== COMPILATION ERROR ANALYSIS ===

MISSING CLASSES:
  - EntitySummonArgumentType
ACTION: Create these classes or check imports

FILES TO INVESTIGATE:
  - src/main/java/com/unlimitedcmds/commands/CommandRegistry.java
  -   src/main/java/com/unlimitedcmds/commands/CommandRegistry.java

Please fix this error by creating a new artifact with the corrected code.

Kodari AI
KodariApr 17 at 5:37 pm 5,824 (v2)

The fix is straightforward: EntitySummonArgumentType doesn’t exist in Yarn-mapped Fabric 1.21.4. I’ll replace it with a StringArgumentType that suggests entity IDs from the registry directly.

  • Removed the non-existent EntitySummonArgumentType import entirely.

  • The /summon command now uses StringArgumentType.word() with manual tab-completion suggestions pulled directly from Registries.ENTITY_TYPE.getIds(), and resolves the entity ID with Identifier.of() (defaulting to the minecraft: namespace if no prefix is provided).

samiformer

The compilation failed with this error:

code
Compilation failed with 10 error(s):

ERROR in src/main/java/com/unlimitedcmds/commands/CommandRegistry.java at line 50: cannot find symbol
                            .getRegistryManager().get(RegistryKeys.ENCHANTMENT);
                                                 ^
  symbol: method get(RegistryKey<Registry<Enchantment>>)
  location: interface Immutable

ERROR in src/main/java/com/unlimitedcmds/commands/CommandRegistry.java at line 172: cannot find symbol
        Registry<Enchantment> enchReg = source.getServer().getRegistryManager().get(RegistryKeys.ENCHANTMENT);
                                                                               ^
  symbol: method get(RegistryKey<Registry<Enchantment>>)
  location: interface Immutable

ERROR in src/main/java/com/unlimitedcmds/commands/CommandRegistry.java at line 209: cannot find symbol
        Registry<Enchantment> enchReg = source.getServer().getRegistryManager().get(RegistryKeys.ENCHANTMENT);
                                                                               ^
  symbol: method get(RegistryKey<Registry<Enchantment>>)
  location: interface Immutable

ERROR in src/main/java/com/unlimitedcmds/commands/CommandRegistry.java at line 244: cannot find symbol
        Registry<Enchantment> enchReg = source.getServer().getRegistryManager().get(RegistryKeys.ENCHANTMENT);
                                                                               ^
  symbol: method get(RegistryKey<Registry<Enchantment>>)
  location: interface Immutable

ERROR in src/main/java/com/unlimitedcmds/commands/CommandRegistry.java at line 270: cannot find symbol
        Optional<EntityType<?>> typeOpt = Registries.ENTITY_TYPE.getOrEmpty(entityId);
                                                                ^
  symbol: method getOrEmpty(Identifier)
  location: variable ENTITY_TYPE of type DefaultedRegistry<EntityType<?>>

ERROR in   src/main/java/com/unlimitedcmds/commands/CommandRegistry.java at line 50: cannot find symbol
                              .getRegistryManager().get(RegistryKeys.ENCHANTMENT);
                                                   ^
  symbol: method get(RegistryKey<Registry<Enchantment>>)
  location: interface Immutable

ERROR in   src/main/java/com/unlimitedcmds/commands/CommandRegistry.java at line 172: cannot find symbol
          Registry<Enchantment> enchReg = source.getServer().getRegistryManager().get(RegistryKeys.ENCHANTMENT);
                                                                                 ^
  symbol: method get(RegistryKey<Registry<Enchantment>>)
  location: interface Immutable

ERROR in   src/main/java/com/unlimitedcmds/commands/CommandRegistry.java at line 209: cannot find symbol
          Registry<Enchantment> enchReg = source.getServer().getRegistryManager().get(RegistryKeys.ENCHANTMENT);
                                                                                 ^
  symbol: method get(RegistryKey<Registry<Enchantment>>)
  location: interface Immutable

ERROR in   src/main/java/com/unlimitedcmds/commands/CommandRegistry.java at line 244: cannot find symbol
          Registry<Enchantment> enchReg = source.getServer().getRegistryManager().get(RegistryKeys.ENCHANTMENT);
                                                                                 ^
  symbol: method get(RegistryKey<Registry<Enchantment>>)
  location: interface Immutable

ERROR in   src/main/java/com/unlimitedcmds/commands/CommandRegistry.java at line 270: cannot find symbol
          Optional<EntityType<?>> typeOpt = Registries.ENTITY_TYPE.getOrEmpty(entityId);
                                                                  ^
  symbol: method getOrEmpty(Identifier)
  location: variable ENTITY_TYPE of type DefaultedRegistry<EntityType<?>>


=== COMPILATION ERROR ANALYSIS ===

MISSING METHODS:
  - get(RegistryKey<Registry<Enchantment>>)
  - getOrEmpty(Identifier)
ACTION: Check method names and signatures

FILES TO INVESTIGATE:
  - src/main/java/com/unlimitedcmds/commands/CommandRegistry.java
  -   src/main/java/com/unlimitedcmds/commands/CommandRegistry.java

Please fix this error by creating a new artifact with the corrected code.

Kodari AI
KodariApr 17 at 5:38 pm 7,596 (v2)

Two fixes needed:

  • getRegistryManager().get(...) → .getOrThrow(...) (method was renamed in 1.21.4)

  • Registries.ENTITY_TYPE.getOrEmpty(id) → .getOptionalValue(id) (method renamed on Registry)

All five call sites patched: four getRegistryManager().get(...) calls replaced with getOrThrow(...), and the getOrEmpty(Identifier) call on the static ENTITY_TYPE registry replaced with getOptionalValue(Identifier).

samiformer

It works and compiles, but enchants still max out at 255 after said enchants being above it. Please fix that.

Also make the spread for multishot lower. <3

Kodari AI
KodariApr 17 at 5:48 pm 20,386 (v2)

Three things to fix:

  • The 255 cap comes from ItemEnchantmentsComponent.Builder.add() clamping internally — need a mixin to bypass it

  • The default summon spread in ModConfig should be lowered

  • Wire up the mixin config everywhere

Now I have full context. The ItemEnchantmentsComponent.Builder.add() internally clamps levels to 255. I’ll mixin into it to bypass that clamp, wire up the mixin config, and lower the default summon spread.

Two changes made:

  • Enchantment cap fix: a mixin on ItemEnchantmentsComponent.Builder.add() now intercepts the call at HEAD, writes the level directly into the raw Object2IntOpenHashMap field (bypassing the vanilla intRange(0, 255) clamp), and short-circuits the original method — levels can now go up to your config’s maxEnchantLevel (32767).

  • Multishot spread: defaultSummonSpread lowered from 5.0 to 1.5 blocks, so entities spawn much tighter around you. Players can still pass a custom spread value to /summon if they want more.

samiformer

the summon command doesnt really work well cause of the position infront of the amount, could you please rewrite it? make the amount, then position, then etc..

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
11 576
src/main/java/com/unlimitedcmds/UnlimitedCommandsPlus.java
package com.unlimitedcmds;

import com.unlimitedcmds.commands.CommandRegistry;
import net.fabricmc.api.ModInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class UnlimitedCommandsPlus implements ModInitializer {

    public static final String MOD_ID = "unlimitedcmds";
    public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);

    @Override
    public void onInitialize() {
        ConfigManager.load();
        CommandRegistry.register();
        LOGGER.info("UnlimitedCommandsPlus initialized.");
    }
}