Skip to content

Configuration ​

RestrictedInventory uses JSON files powered by CoolerConfig. Changes are watched and reloaded while the game or server is running.

Common configuration ​

Path: config/restrictedinventory-common.json

KeyTypeDefaultPurpose
useClientRestrictionbooleanfalseUse each player's client rules instead of one shared server ruleset
useTeamAndTagRestrictionsbooleanfalseRead teamRestrictions and tagRestrictions and let them target individual players
restrictedSlotsobject{}Map a slot index to an item, tag, or variant-aware entry
groupsobject{}Named sets of entries a slot can be restricted to as a whole
teamRestrictionsobject{}Rules per vanilla scoreboard team name
tagRestrictionsobject{}Rules per vanilla entity tag

When shared rules change, the server synchronizes them to players. Changing the scope also refreshes command permissions.

groups is defined here only, and is synchronized to every connecting client so that a group id means the same thing on both sides. See groups and displays.

teamRestrictions and tagRestrictions are read only while useTeamAndTagRestrictions is true. A player matched by one of those rules uses it instead of restrictedSlots; everyone else keeps using restrictedSlots. See teams and tags.

Client configuration ​

Path: config/restrictedinventory-client.json

KeyTypeDefaultPurpose
showSlotIndexbooleantrueShow inventory slot indices while Tab is held
restrictedSlotsobject{}The player's rules when client restrictions are enabled

Client restrictedSlots are ignored while the server has useClientRestriction set to false.

Slot numbering ​

RangeInventory area
0–8Hotbar, left to right
9–35Main inventory, left to right from the top row (9–17, 18–26, 27–35)
Slot numbers
91011121314151617
181920212223242526
272829303132333435
012345678
Hover a slot to read its number.

Only indices from 0 through 35 are valid. Armor and offhand slots are not part of this ruleset.

Restriction values ​

ValueSlot previewMeaning
"minecraft:diamond_sword"That one item
"#minecraft:swords"#Any item in the tag; the preview cycles through its members
{"item": "...", "tag"/"components": {…}}The item, narrowed to stacks carrying that variant data
{"item": "...", "display": …}The item, drawn as some other stack
{"group": "..."}Anything in the named restriction group

Use an item ID for one item, or start an item tag with #:

json
{
  "useClientRestriction": false,
  "restrictedSlots": {
    "0": "minecraft:torch",
    "1": "#minecraft:swords",
    "8": "minecraft:totem_of_undying"
  }
}

This reserves hotbar slot 0 for torches, slot 1 for any sword in the tag, and slot 8 for a totem of undying:

Inventory
3 restricted slots. Hover a slot to read its rule.

For exact variants, replace the string with an object. Minecraft 1.20.1 uses item with tag; newer versions use item with components. Existing string entries remain valid. See variant filters.

To change only the icon a slot draws, or to accept any of several entries at once, see groups and displays. To give different players different rules, see teams and tags.

Released under the MIT License.