
InvScale
> I need you to write the code for a mod called "InvScale". > Goal: This is a modpack utility that restricts player inventory size by filling specific slots...
00—FreeneoforgeServer1.21.1mod
InvScale
Overview
InvScale is a modpack utility that limits how much inventory space players can use. It works by filling certain slots with a special "locked" item that can't be moved, dropped, or used - effectively shrinking the player's available inventory.
Features
- Restricts player inventory by locking slots from the bottom-right
- Locked slots are filled with an unmovable barrier item
- Works in Survival and Adventure mode only
- Creative and Spectator players are unaffected
- Fully configurable - choose how many slots to lock (0-36)
- Barrier items don't drop on death and don't clutter the world
How to Use
- Install the mod on your server (this is a server-side mod)
- Edit the config file
invscale-server.tomlin your server's config folder - Set
lockedSlotsto the number of slots you want to lock (default: 27) - Restart the server or reload the config
- Players in Survival or Adventure mode will have their restricted slots filled with barrier items
Tips & Tricks
- Default setting locks 27 slots (3 rows), leaving 9 hotbar slots free
- Setting to 0 disables the restriction entirely
- Setting to 36 locks all inventory and hotbar slots
- Players can still use their armor and offhand slots normally
- Great for challenge maps or limiting hoarding in survival servers
Known Limitations
- This is a server-side mod only - vanilla clients can still connect
- The restriction applies to main inventory and hotbar only, not armor or offhand
- Some advanced inventory interactions may briefly show before being corrected