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
Let me read the required docs before writing any code.
Now let me plan the class structure before writing:
UnlimitedCommandsPlus.java— mod initializer, wires everything upModConfig.java— plain config data POJOConfigManager.java— load/save config via Gsoncommands/CommandRegistry.java— all Brigadier command registrationsBuild 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.
The compilation failed with this error:
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.
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
EntitySummonArgumentTypeimport entirely.The
/summoncommand now usesStringArgumentType.word()with manual tab-completion suggestions pulled directly fromRegistries.ENTITY_TYPE.getIds(), and resolves the entity ID withIdentifier.of()(defaulting to theminecraft:namespace if no prefix is provided).
The compilation failed with this error:
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.
Two fixes needed:
getRegistryManager().get(...)→.getOrThrow(...)(method was renamed in 1.21.4)Registries.ENTITY_TYPE.getOrEmpty(id)→.getOptionalValue(id)(method renamed onRegistry)
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).
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
Three things to fix:
The 255 cap comes from
ItemEnchantmentsComponent.Builder.add()clamping internally — need a mixin to bypass itThe default summon spread in
ModConfigshould be loweredWire 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 atHEAD, writes the level directly into the rawObject2IntOpenHashMapfield (bypassing the vanillaintRange(0, 255)clamp), and short-circuits the original method — levels can now go up to your config’smaxEnchantLevel(32767).Multishot spread:
defaultSummonSpreadlowered from5.0to1.5blocks, so entities spawn much tighter around you. Players can still pass a custom spread value to/summonif they want more.
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..
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.");
}
}