env.json

A small FabricMC library allowing to convert an `env.json` file into a Java Object. It is mostly used by Environment Driven Assets and Environment Driven Data.

MModding You can click on the banner to join our Discord.

env.json

env.json logo

Supports

Supports Fabric Loader Supports Quilt Loader

Requirements

Requires Fabric API

Concept

env.json is a Minecraft Library introducing a new sub json file extension format, with the goal of redirecting minecraft resources to other ones based on the environment context.

Implementations

env.json doesn't provide these redirections directly, but only the operations around env.json files and their resource reload management.

There is currently two official implementations of env.json:

Mod Identifier: env-driven-assets.

Environments: Client

Applies env.json operations to Minecraft Vanilla asset types.

Mod Identifier: env-driven-data.

Environments: Common & Server

Applies env.json operations to Minecraft Vanilla data types.

The env.json Format

[
  {
    "rules": [ // the primary set of rules, is an "any" type
      {
        "type": "sequence", // all rules in the sequence must pass
        "rule": [] // the rules
      },
      {
        "type": "any", // passes if at least one rule passes
        "rule": [] // the rules
      },
      {
        "type": "not", // reverses the rule
        "rule": { // the rule
          "type": "...",
          "rule": "..."
        }
      },
      {
        "type": "dimension", // passes if the current dimension matches this one
        "rule": "minecraft:overworld" // the dimension, can also be a tag
      },
      {
        "type": "biome", // passes if the current biome matches this one
        "rule": "minecraft:plains" // the biome, can also be a tag
      },
      {
        "type": "x_coord", // passes if the following operations on the x-axis are valid
        "rule": {
          "comparator": "==", // must be &lt;, &gt;, ==, <=, >=, =< or =>
          "value": "100" // must be an integer
        }
      },
      {
        "type": "y_coord", // passes if the following operations on the y-axis are valid
        "rule": {
          "comparator": "==", // must be &lt;, &gt;, ==, <=, >=, =< or =>
          "value": "100" // must be an integer
        }
      },
      {
        "type": "z_coord", // passes if the following operations on the z-axis are valid
        "rule": {
          "comparator": "==", // must be &lt;, &gt;, ==, <=, >=, =< or =>
          "value": "100" // must be an integer
        }
      },
      {
        "type": "submerged", // passes if the current context is surrounded by water or not
        "rule": true // true for "if it is submerged" and false for "if it is not submerged"
      },
      {
        "type": "sky", // passes if the context is above the sky limit, at or below
        "rule": "at" // must be "above", "at" or "below"
      },
      {
        "type": "water", // passes if the context is above the water level, at or below
        "rule": "at" // must be "above", "at" or "below"
      },
      {
        "type": "void", // passes if the context is above the void limit, at or below
        "rule": "at" // must be "above", "at" or "below"
      }
    ],
    "result": "minecraft:block/stone" // the redirected resource
  }
]

The file must be registered under this format: redirected_resource_name-redirected_resource_extension.env.json.

Usage For Developers

In your build.gradle

repositories {
    // ...
    maven { url 'https://jitpack.io' }
}

// ...

dependencies {
    // ...
    modImplementation "com.mmodding:env.json:${theMostBeautifulVersionYouCanFind}"
}

You can now get your EnvJson object from a Resource object thanks to ExtendedResource#of(Resource)#getEnvJson or parse it with EnvJson#parse(Path) or EnvJson#parse(InputStream).

Badge For Developers

Requires env.json

[<img src="https://github.com/MModding/art/blob/main/mods/env_json/requires_env_json.png?raw=true" width="256" alt="Requires env.json">](https://modrinth.com/mod/env.json)

Promotion

//raw.githubusercontent.com/ModFest/art/3bf66556e674d670e30f647d6a48c4e1798c21d4/badge/128h/ModFest" rel="noopener noreferrer" target="_blank">https://raw.githubusercontent.com/ModFest/art/3bf66556e674d670e30f647d6a48c4e1798c21d4/badge/128h/ModFest 1.20 Badge Cozy.png" alt="ModFest 1.20">

The env.json Team

profile avatar
  • 1
    Followers
  • 11
    Projects
  • 21.8K
    Downloads

More from FirstMegaGame4View all

  • Invisibility Plus project image

    Invisibility Plus

    • 129
    • Mods

    Invisibility Plus is a mod that makes the next 4 levels of invisibility potions useful.

    • 129
    • May 25, 2026
    • Mods
  • Psithurism project image

    Psithurism

    • 140
    • Mods

    Bring Japanese culture into your home with new deco blocks, new food, traditional cosmetics and much more!

    • 140
    • May 25, 2026
    • Mods
    • +3
  • MModding Library project image

    MModding Library

    • 383
    • Mods

    A set of tools made by the MModding organization, providing new useful systems in mod making.

    • 383
    • May 24, 2026
    • Mods
  • Extravaganza! project image

    Extravaganza!

    • 1.6K
    • Mods

    Extravaganza! is a mod about adding carnival and festivity goodies, as well as some amusing activities through blocks, entities or items.

    • 1.6K
    • August 31, 2025
    • Mods
    • +4
  • Invisibility Plus project image

    Invisibility Plus

    • 129
    • Mods

    Invisibility Plus is a mod that makes the next 4 levels of invisibility potions useful.

    • 129
    • May 25, 2026
    • Mods
  • Psithurism project image

    Psithurism

    • 140
    • Mods

    Bring Japanese culture into your home with new deco blocks, new food, traditional cosmetics and much more!

    • 140
    • May 25, 2026
    • Mods
    • +3
  • MModding Library project image

    MModding Library

    • 383
    • Mods

    A set of tools made by the MModding organization, providing new useful systems in mod making.

    • 383
    • May 24, 2026
    • Mods
  • Extravaganza! project image

    Extravaganza!

    • 1.6K
    • Mods

    Extravaganza! is a mod about adding carnival and festivity goodies, as well as some amusing activities through blocks, entities or items.

    • 1.6K
    • August 31, 2025
    • Mods
    • +4