Conditional Barriers

A Fabric mod for Minecraft that allows players to pass through barrier blocks based on configurable rules or external conditions via an API.

by
871 Downloads
fabriccursedmanagementutility
Rent Server with this Mod

About this Mod

ConditionalBarriers

ConditionalBarriers is a Fabric mod for Minecraft that allows players to pass through barrier blocks based on configurable rules or external conditions via an API.

By default, barrier blocks are impassable for everyone. This mod changes that by allowing fine-grained control over who can walk through them, making it ideal for map makers, server administrators, and developers.

Features

  • Configurable Pass Rules: Define who can pass through barriers using various criteria (Game Mode, Permission Level, Player Name, UUID, Scoreboard Tags).
  • Developer API: Easily register custom conditions to control barrier accessibility from other mods.
  • In-game Commands: Manage the mod's state and reload configuration without restarting the server.
  • No More Suffocation: Automatically prevents players from suffocating inside barriers if they are allowed to pass through them.
  • High Performance: Implemented using optimized Mixins to ensure minimal impact on server performance.

Commands

The mod provides the following commands (requires permission level 2 or higher):

  • /conditionalbarriers on: Enables rule evaluation.
  • /conditionalbarriers off: Disables the mod's logic (making all barriers passable for everyone).
  • /conditionalbarriers status: Displays whether the mod is currently active.
  • /conditionalbarriers reload: Reloads the configuration from the disk.
  • /cb: A shorter alias for /conditionalbarriers.

Configuration

The configuration file is located at config/conditionalbarriers.json. It allows you to define a list of rules that are evaluated in order.

Example Configuration

{
  "defaultPassable": false,
  "rules": [
    {
      "type": "SPECTATOR",
      "action": "ALLOW"
    },
    {
      "type": "CREATIVE",
      "action": "ALLOW"
    },
    {
      "type": "SCOREBOARD_TAG",
      "action": "ALLOW",
      "value": "can_pass_barriers"
    },
    {
      "type": "OPERATOR_LEVEL",
      "action": "ALLOW",
      "operatorLevel": 4
    }
  ]
}

Rule Types

  • CREATIVE: Matches players in Creative mode.
  • SPECTATOR: Matches players in Spectator mode.
  • OPERATOR_LEVEL: Matches players with a specific permission level.
  • PLAYER_NAME: Matches a specific player name (case-sensitive option available).
  • PLAYER_UUID: Matches a specific player UUID.
  • SCOREBOARD_TAG: Matches players with a specific scoreboard tag.

Installation & Requirements

ConditionalBarriers is required on both the client and the server to function correctly. This is because the client's physics engine needs to know when a barrier block should be non-solid to allow for smooth movement.

  1. Make sure you have the Fabric Loader installed on both sides.
  2. Drop the ConditionalBarriers JAR file into the mods folder of both your client and server.
  3. (Optional) Install Fabric API if not already present.

Developer API

If you are a mod developer, you can use the ConditionalBarriersApi to add your own logic.

Adding the API to your project

To use the ConditionalBarriers API in your own mod, you can add it as a dependency using Modrinth or your preferred Maven repository.

Gradle (Modrinth)

  1. Add the Modrinth repository to your build.gradle:
repositories {
    maven {
        name = "Modrinth"
        url = uri("https://api.modrinth.com/maven")
    }
}
  1. Add the dependency:
dependencies {
    modImplementation "maven.modrinth:conditional-barriers:<VERSION>"
}

Note: Replace <VERSION> with the actual version you want to use.

fabric.mod.json

Add the mod to your depends section to ensure it's present at runtime:

"depends": {
    "conditionalbarriers": ">=1.0.0"
}

Registering a Custom Condition

ConditionalBarriersApi.registerCondition(new Identifier("mymod", "special_access"), context -> {
    if (someCustomLogic(context.player())) {
        return BarrierDecision.ALLOW; // Let them pass
    }
    return BarrierDecision.PASS; // Let other rules decide
});

Manual Overrides

You can also force a specific player to be able to pass (or be blocked) regardless of other rules:

ConditionalBarriersApi.setPlayerOverride(player, PlayerBarrierOverride.ALLOW);

Installation & Requirements

  1. Make sure you have the Fabric Loader installed.
  2. Drop the ConditionalBarriers JAR file into your mods folder.
  3. (Optional) Install Fabric API if not already present.

License

This project is licensed under the terms specified in the LICENSE.txt file.

Available Versions

Conditional Barriers 1.0.0release
MC 1.21.1fabric
March 31, 2026

How to Install Conditional Barriers on Your Server

1

Order Server

Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).

2

Set fabric Loader

In the panel under "Egg", select the fabric loader and matching Minecraft version (1.21.1).

3

Install Mod

Open the mod browser in the dashboard and search for "Conditional Barriers". Click "Install" – done! Alternatively, upload the .jar via SFTP to the /mods folder.

Compatibility

Mod Loaders

fabric

Minecraft Versions

1.21.1

Server-side

Required

Recommended RAM

4 GB(min. 3 GB)

Frequently Asked Questions

Conditional Barriers server crashes on startup – what to do?

Most common cause: wrong fabric version or insufficient RAM. Check the server log (latest.log) for "OutOfMemoryError" or "Mixin" errors. With Mado Hosting: ensure at least 3 GB RAM is allocated and the loader matches the mod version (1.21.1). You can switch loaders with one click in the panel.

Is Conditional Barriers compatible with fabric?

Conditional Barriers officially supports fabric for Minecraft 1.21.1. The Mado dashboard automatically detects incompatible loader combinations.

Server lagging with Conditional Barriers – how to optimize performance?

Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if Conditional Barriers consumes the most tick time. Common fixes: reduce server view-distance to 8-10, install "performant" or "starlight" as supplementary mods on Forge. With Mado Hosting, your server runs on NVMe SSDs with dedicated CPU cores for minimal latency.

Rent Modded Server

Install Conditional Barriers with just one click on your server.

Recommended RAM
4 GBab €8/mo
Min. 3 GB | +1 GB pro 8 Spieler
Create Server Now
1-Click Mod Install
NVMe SSD Storage
DDoS Protection included

Details

License
MIT License
Server-side
Required

Supported Versions

1.21.1