Back to mods
LootInj project artwork

Modrinth · Minecraft mod

LootInj

Simple data-driven loot table modification library

Choose a version Pick your version below, then grab the matching file.

Quick answer

Which LootInj release should I use?

Updated 3 days ago
Latest stable file 1.0.5+mc26.3
Game version 26.3
Loader Fabric

LootInj 1.0.5+mc26.3 targets 26.3 with Fabric. Do not install it on the client. It must be installed on the dedicated server. All 1 required mods have matching files.

Where it goes

Is LootInj required on the client, server, or both?

Do not install it on the client. It must be installed on the dedicated server.

Client Not supported
Dedicated server Required
Loader for this release Fabric
Required install it here Optional supported, not mandatory Not supported do not install here Source doesn’t say do not assume

This file is marked server-only.

What else does LootInj 1.0.5+mc26.3 need?

1.0.5+mc26.3. Change the file and its required mods may change too.

All 1 required mods have matching files

Install Fabric API first. We found matching files for this game-version and loader setup.

Fabric API Needed by LootInj 1.0.5+mc26.3
required
Matching file found Matched file: 0.166.0+26.3

We only count dependency files that match this setup. A file for another loader does not fill the gap.

Before you install it

Add LootInj without breaking your instance.

Built for LootInj 1.0.5+mc26.3. Pick another file and the loader, install side or required mods may change.

  1. 01

    Stick to this file

    Use 1.0.5+mc26.3. It targets 26.3 with Fabric; another release may have different loader, side or dependency requirements.

  2. 02

    Bring the mods it needs

    Install Fabric API first. We found matching files for this game-version and loader setup.

  3. 03

    Put it on the correct side

    Do not install it on the client. It must be installed on the dedicated server.

  4. 04

    Pick the file you checked

    Use the “Get this file” button beside 1.0.5+mc26.3. It opens that exact file at the source.

About this project

What does LootInj add?

LootInj is a simple data-driven loot modification library, primarily for mods. It essentially acts as a JSON frontend to the Fabric API LootTableEvents.MODIFY event.

Features

  • Can add pools & modifiers, and modify pools
  • Supports data generation via FabricDynamicRegistryProvider (26.3+) or FabricCodecDataProvider (26.1-26.2)
    • Datagen matches the vanilla/FAPI LootTable.Builder and LootPool.Builder api
  • Can access other loot registries such as minecraft:predicate, minecraft:item_modifier, minecraft:context_int_provider, etc. (26.3+)
  • Can be reloaded without relogging using /reload

Format

In your mod data/datapack, loot modifications are JSON files at data/<namespace>/lootinj/loot_modification/<path>.json. The exact namespace and path do not matter, they should just be unique.

The format generally follows the vanilla loot table format:

26.3+ Format
{
  // All fields are optional except `targets`

  // A loot table id or list of ids to modify
  "targets": [
    "minecraft:blocks/dirt"
  ],

  // A list of loot pools to add
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:diamond"
        }
      ]
    }
  ],

  // A loot function or list of functions to add to the whole table
  "modifier": {
    "count": 2,
    "function": "minecraft:set_count"
  },

  // Modify all existing pools
  // Requires some extra processing so only include if you need to modify pools
  "modify_pools": {
    // Again, all fields are optional

    // A list of entries to add to the pool
    "entries": [
      {
        "type": "minecraft:item",
        "name": "minecraft:gold_ingot"
      }
    ],
    
    // A loot condition or list of conditions to add to the whole pool
    "condition": {
      "type": "minecraft:survives_explosion"
    },

    // A loot function or list of functions to add to the whole pool
    "modifier": {
      "count": 3,
      "function": "minecraft:set_count"
    }

  }

}
26.1-26.2 Format
{
  // All fields are optional except `targets`

  // A loot table id or list of ids to modify
  "targets": [
    "minecraft:blocks/dirt"
  ],

  // A list of loot pools to add
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:diamond"
        }
      ]
    }
  ],

  // A list of loot functions to add to the whole table
  "functions": [
    {
      "count": 2,
      "function": "minecraft:set_count"
    }
  ],

  // Modify all existing pools
  // Requires some extra processing so only include if you need to modify pools
  "modify_pools": {
    // Again, all fields are optional

    // A list of entries to add to the pool
    "entries": [
      {
        "type": "minecraft:item",
        "name": "minecraft:gold_ingot"
      }
    ],
    
    // A list of loot condition to add to the whole pool
    "conditions": [
      {
        "type": "minecraft:survives_explosion"
      }
    ],

    // A list of loot functions to add to the whole pool
    "functions": [
      {
        "count": 3,
        "function": "minecraft:set_count"
      }
    ]

  }

}

Comparison

I made this library because Datapatched did not quite fit my needs:

  • I usually like to datagen as much as possible, and Datapatched does not work with data generation
  • I usually try to update my mods within a few days of a minecraft update, and Datapatched sometimes takes longer to update
  • I primarily mod for Fabric 26.1+ so this library will only support those versions

If you are an end user who doesn't care about these and/or is on Neoforge, Datapatched will probably work better for you as it is better documented and supports more versions & loaders.


Developer Installation

For use in a mod, install and JiJ it from the Modrinth maven.

# gradle.properties
lootinj_version=1.0.4+mc26.3
// build.gradle
repositories {
    exclusiveContent {
        forRepository {
            maven {
                name = "Modrinth"
                url = "https://api.modrinth.com/maven"
            }
        }
        filter {
            includeGroup "maven.modrinth"
        }
    }
}

dependencies {
    // ...
    implementation include("maven.modrinth:lootinj:${project.lootinj_version}")
}

Project description from Modrinth.

Pick your setup

LootInj by Minecraft version and loader

Choose the version and loader you play, then open the matching release.

5 available setups

Check the dependencies, then try the file in a copied instance before changing a world you care about.

Recent files

LootInj versions and loaders

6 of 6 releases match

Looking for an older file? The official Modrinth project page is in Resources.