Restrictions

You have your stage, now let's lock something behind it!

The restrictions can be added in the same JSON file where the stage was previously created. Here's an example of all the possible restrictions a mod pack developer may use:

empty stage/restriction file
{
  "Restriction Data": {
    "stage": "",
    "itemList": [],
    "modList": [],
    "tagList": [],
    "exceptionList": [],
    "structureList": [],
    "mobList": [],
    "containerList": [],
    "dimensionList": []
  },
  "Settings": {
    "advancedTooltips": "ALWAYS", /* Wheather to show advanced tooltips on the affected items. Valid values: ALWAYS, NONE, ADVANCED - see the wiki for more details */
    "itemsTitle": "Unavailable Item", /* The title of the item tooltip - if left empty ("") the default name of the item will be used */
    "dropItemsFromInventory": true, /* Wheather to check the player's inventory and drop the restricted items */
    "dropArmorFromInventory": false, /* Wheather to check the player's armor slots and drop the restricted armor */
    "canPickupItems": false, /* Wheather the restricted item can be picked up or not */
    "itemsPickupDelay": 15, /* The delay between restricted item pickup */
    "hideInJEI_REI": true, /* Wheather to hide the restricted item in JEI or REI */
    "canUseItems": false, /* Wheather the restricted item can be used with right or left click */
    "containerListWhitelist": false, /* Wheather to whitelist or blacklist the restricted containers */
    "canBreakBlocks": false, /* if an item block is restricted, this applies to the IN-WORLD BLOCK - wheather to destroy the in-world block or not */
    "canRightClickBlocks": false /* if an item block is restricted, this applies to the IN-WORLD BLOCK - wheather the restricted block can be right-clicked or not */
  }
}

Something that's important to remember is that the contents of this file are COMPLETELY optional. This makes the stage/restriction file modular. If you wanna make a file just for item restrictions for a certain mod, you can do it. You wanna do it just for mob restrictions? Totally possible!

Simple Restrictions

Let's cover what some of these objects mean. We recommend using a mod like Kubejs to find all of these ids:

  • "itemList" - This is a list. Here you can add item ids. This will gate the correspondent items to the stage created. If block item id's are added here, special restrictions will be applied to the in-world blocks if desired. Check the Settings page for more info.

!!! VERY IMPORTANT !!!

If you're interested in restricting a block which does not have an item related to it, know that unfortunately, at the moment, this is not possible. Every block needs to have an item related to it in order for a restriction to be applied.

"itemList": [
   {"item": "minecraft:stick"},
   {"item": "minecraft:diamond"},
   {"item": "thermal:sludge"}
]

The "itemList" object also allows for item restrictions based on item NBT data. Here's how you would lock a chest with the display name 'Magic Chest' behind a stage:

"itemList": [
    {
        "item": "minecraft:chest",
        "nbt": {
            "display": {
                "Name": "[{\"text\":\"Magic Chest\",\"italic\":false}]"
            }
        }
    }
]
  • "modList" - This is a list. Here you can add mod ids. This will gate the correspondent mod's items to the stage created. Use it if you wanna gate a mod's items entirely:

"modList": ["minecraft", "botania", "thermal"]
  • "tagList" - This is a list. Here you can add item tags. This will gate all the items included in that tag.

"tagList": ["minecraft:logs", "forge:ingots"]
  • "exceptionList" - This is a list. This is a bit of a different object, as it is primarily meant to be used with the "modList" restriction. Here's how it works. Let's say you wanna gate every item from Botania, except for the Mana Pool (for some reason). You'll have to add the Mana Pool's id to this list. You can even do these with more mods and items!

"modList": ["botania", "thermal"],
    "exceptionList": [
        { "item": "botania:mana_pool" },
        { "item": "thermal:redstone_furnace" }
] // these items can even be added to another stage in another file!

You can even use tags, intead of item ids!

"modList": ["botania", "thermal"],
    "exceptionList": [
        { "tag": "minecraft:logs" }
] // This will exclude all the block with the "minecraft:logs" tag, not just the blocks from botania and thermal
  • "containerList" - This is a list where you can add container IDs to restrict them. A restricted container will behave as follows: when the player opens the container, any restricted items in their inventory will be dropped on the ground, preventing interaction with the container while holding restricted items. To find a container's ID, use the mod's debug feature.

"containerList": ["net.minecraft.inventory.container.WorkbenchContainer"]
  • "dimensionList" - This is a list. Here you can add dimension IDs so they can be restricted. The player won't be able to enter the restricted dimension(s) until they obtain the proper stage. Access will be restricted even through commands or teleport. Unlike other restrictions in this category, this one has a message setting. For each dimension restricted, you can make a custom message to be display on the action bar when a player attempts to enter that said dimension.

      "dimensionList": [
        {
          "dimension": "minecraft:the_nether",
          "message": "You're not allowed in The Nether!"
        },
        {
          "dimension": "minecraft:the_end",
          "message": "I.. AM STEVE!!!"
        }
      ]

Advanced Restrictions

Structure Gating

!!!VERY IMPORTANT!!!

Unlike other restriction types, this one works a bit differently. It activates once the player has the stage. For example, if you restrict access to a village under a certain stage, that village will be locked only when the player reaches that stage. This design offers more flexibility and a smoother development experience for pack creators. By default, no structures are locked when you install the mod, giving you full control over which structures to modify in your mod pack. Think of this restriction type as a way to create tailored loadouts for specific structure configurations.

"structureList" - Yet another list. EACH STRUCTURE you wanna add, has to be listed under curly braces {}. For each structure, you can apply different settings:

  1. "structure" - Here you'll add the ID of the structure you wanna gate. Use a mod such as WITS to easily find this ID

  2. "can_use_block" - This is a Boolean value. It defines weather or not a player is allowed to right click the blocks in the structure. Useful if you wanna restrict access to the furnaces in a Village for example.

  3. "can_place_block" - This is also a Boolean value. It defines weather or not a player is allowed to place blocks in the structure.

  4. "can_break_block" - Also a Boolean value. It defines weather or not a player is allowed to break the blocks in the structure.

  5. "can_use_block_list" - This acts as an exception list. If "can_use_block" is set to false, here you can add a player will be allowed to right click. Let's say you wanna allow the player to interact only with the Chests present in a Village. You'll have to add the chest's ID to this list.

  6. "can_place_block_list" - This is a list where you can add item block IDs to define the blocks a player may place in this structure IF the "can_place_block" setting is set to false. Let's say you have some custom structure. To progress in this structure, the player has to place a Redstone Block somewhere. You'll have to add the Redstone Block's ID to this list in order to allow the player to place it in the structure.

  7. "can_break_block_list" - Similar to can_place_block_list. It's used if the "can_break_block" setting is false. Here you can add item block IDs to define the blocks a player may break in a structure. Let's say you have some custom structure where a player can only break Ceramic Pots in order to get loot. You'll have to add the pot's ID to this list.

      "structureList": [
        {
          "structure": "minecraft:village_plains",
          "can_use_block": false,
          "can_place_block": false,
          "can_break_block": false,
          "can_use_block_list": ["minecraft:furnace", "minecraft:tnt"],
          "can_place_block_list": ["minecraft:sand"],
          "can_break_block_list": ["supplementaries:urn"]
        }
      ]

Mob Gating

!!! VERY IMPORTANT !!!

Similar to the Structure Gating feature, this restriction is applied when the player HAS the stage. It is meant to be used as a loadout for a single possible configuration which is given to the player one at a time.

This feature does NOT allow you to force spawn mobs. It is only used to restrict the mob spawns if they already exist. It is also used to .

The "mobList" allows you to restrict mob spawns based on the mob's ID, tag, or the mod ID. This list is flexible, meaning you can include only the settings that matter to you. If certain settings aren’t relevant, you can simply omit them. To clarify how this works, we’ll go through a few potential scenarios.

Example:

Let's say you want to restrict a single mob. Here’s how your restriction file might look:

"mobList": [
  {
    "spawnType": ["NATURAL", "SPAWNER", "MOB_SUMMONED", "SPAWN_EGG", "COMMAND"],
    "whitelist_blacklist": "WHITELIST",
    "entityID": "minecraft:zombie",
    "health": 500,
    "effects": [
      {
        "effect": "minecraft:strength",
        "amplifier": 1,
        "duration": 0,
        "chance": 100
      }
    ],
    "loadout": [
      {
        "item": "minecraft:egg",
        "slot": "MAINHAND",
        "chance": 100
      }
    ]
  }
]

Key Elements:

  1. "spawnType" - This list will specify which spawn types your configuration will apply to. The possible values are:

  • NATURAL

  • CHUNK_GENERATION

  • SPAWNER

  • STRUCTURE

  • BREEDING

  • MOB_SUMMONED

  • JOCKEY

  • EVENT

  • CONVERSION

  • REINFORCEMENT

  • TRIGGERED

  • BUCKET

  • SPAWN_EGG

  • COMMAND

  • DISPENSER

  • PATROL

  1. "whitelist_blacklist" - A string. Whether the configured mob should be spawned when the player has the stage, or stopped from spawning when the player has the stage. The possible values are:

  • "WHITELIST" - Will allow the zombie to spawn under the specified conditions when the player has the stage.

  • "BLACKLIST" - Prevents the zombie from spawning under the specified conditions (with 500 HP, strength effect, and an egg in its hand) when triggered by a spawn type like NATURAL, SPAWNER, MOB_SUMMONED, SPAWN_EGG, or COMMAND.

  1. "entityID" - A string. The id of the mob these conditions should apply to. This is a single id. You can find it in the game with the F3 menu.

  1. "health" - This is an integer. Set the health the mob will spawn with.

WIP

Now, let's see some situational examples, just so you can get a proper idea of how you can efficiently use this mod.

Last updated