Custom Loot Tables - MarkusBordihn/BOs-Easy-Mob-Farm GitHub Wiki

🐉 Custom Loot Tables for Easy Mob Farm

Easy Mob Farm supports fully customizable loot tables for each captured mob using a * directory-based priority system*.
This allows modpack creators and mod developers to define specific drops for individual mobs with fine-grained control over how those drops interact with vanilla loot.

📁 Loot Table Modes

Custom loot tables are organized by directory name which determines their behavior:

data/easy_mob_farm/loot_tables/entities/
├── overwrite/     # Completely replaces vanilla loot (ignores vanilla drops)
├── priority/      # Uses custom first, falls back to vanilla if custom is empty
├── bonus/         # Adds extra drops on top of vanilla loot
└── fallback/      # Only used when vanilla loot table is empty (legacy behavior)

🎯 Mode Behaviors

Mode Description Use Case
overwrite Uses only custom loot table, completely ignoring vanilla drops Complete modpack rebalancing, total drop replacement
priority Tries custom table first, falls back to vanilla if custom returns nothing Soft overrides that respect vanilla as ultimate fallback
bonus Adds custom drops to vanilla drops (cumulative) Enhancement without replacement, extra farm-specific rewards
fallback Uses custom only if vanilla is empty (original behavior) Custom mobs with no vanilla drops (ender dragon, modded bosses)

🔄 Execution Order

  1. Check overwrite/ → if exists, use only that and stop
  2. Check priority/ → add drops if exists
  3. Add vanilla drops
  4. Check bonus/ → add drops if exists (combines with priority + vanilla)
  5. If still empty → check fallback/ for legacy support

📂 Path Structure

data/easy_mob_farm/loot_tables/entities/<mode>/<namespace>/<entity_name>.json
  • <mode>: One of overwrite, priority, bonus, or fallback
  • <namespace>: The namespace of the entity's mod (e.g. minecraft, iceandfire)
  • <entity_name>: The entity's registry name (e.g. zombie, fire_dragon)

✔ Example Paths

Entity Mode Path
Zombie (complete replacement) overwrite data/easy_mob_farm/loot_tables/entities/overwrite/minecraft/zombie.json
Creeper (custom first) priority data/easy_mob_farm/loot_tables/entities/priority/minecraft/creeper.json
Cow (extra drops) bonus data/easy_mob_farm/loot_tables/entities/bonus/minecraft/cow.json
Ender Dragon (no vanilla loot) fallback data/easy_mob_farm/loot_tables/entities/fallback/minecraft/ender_dragon.json
Fire Dragon (modded boss) fallback data/easy_mob_farm/loot_tables/entities/fallback/iceandfire/fire_dragon.json

💡 Design Notes

  • Custom loot tables use standard Minecraft JSON format.
  • Any item, including modded items, can be defined in drops.
  • Conditions like random_chance and set_count are supported.
  • Use set_count function to control loot amounts instead of global multipliers.

🐉 Examples

Example 1: Overwrite Mode - Reduce Ignis Loot

To fix the issue where Ender Cataclysm's Ignis drops too many Igneum ingots:

File: data/easy_mob_farm/loot_tables/entities/overwrite/cataclysm/ignis.json

{
  "type": "minecraft:entity",
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "item",
          "name": "cataclysm:ignitium_ingot",
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 1,
                "max": 3
              }
            }
          ],
          "conditions": [
            {"condition": "minecraft:random_chance", "chance": 0.4}
          ]
        }
      ]
    }
  ]
}

This completely replaces vanilla Ignis drops with a controlled amount (1-3 ingots, 40% chance).

Example 2: Priority Mode - Custom Zombie Drops

Try custom drops first, but fall back to vanilla if custom returns nothing:

File: data/easy_mob_farm/loot_tables/entities/priority/minecraft/zombie.json

{
  "type": "minecraft:entity",
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "item",
          "name": "minecraft:rotten_flesh",
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 2,
                "max": 4
              }
            }
          ]
        }
      ]
    }
  ]
}

Example 3: Bonus Mode - Extra Cow Drops

Add farm-specific bonus drops on top of vanilla beef/leather:

File: data/easy_mob_farm/loot_tables/entities/bonus/minecraft/cow.json

{
  "type": "minecraft:entity",
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "item",
          "name": "minecraft:leather",
          "conditions": [
            {"condition": "minecraft:random_chance", "chance": 0.3}
          ]
        }
      ]
    }
  ]
}

This gives a 30% chance for extra leather in addition to normal cow drops.

Example 4: Fallback Mode - Fire Dragon

For modded entities with no vanilla loot table:

File: data/easy_mob_farm/loot_tables/entities/fallback/iceandfire/fire_dragon.json

{
  "type": "minecraft:entity",
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "item",
          "name": "iceandfire:dragonbone"
        },
        {
          "type": "item",
          "name": "iceandfire:fire_dragon_flesh",
          "conditions": [
            {"condition": "minecraft:random_chance", "chance": 0.8}
          ]
        },
        {
          "type": "item",
          "name": "iceandfire:dragonscales_red",
          "conditions": [
            {"condition": "minecraft:random_chance", "chance": 0.6}
          ]
        },
        {
          "type": "item",
          "name": "iceandfire:fire_dragon_blood",
          "conditions": [
            {"condition": "minecraft:random_chance", "chance": 0.35}
          ]
        }
      ]
    }
  ]
}

🔧 Controlling Loot Amounts

Use Minecraft's built-in set_count function to adjust drop quantities:

{
  "type": "item",
  "name": "minecraft:diamond",
  "functions": [
    {
      "function": "minecraft:set_count",
      "count": {
        "min": 1,
        "max": 5
      }
    }
  ]
}

Combine with random_chance to reduce drop frequency:

{
  "type": "item",
  "name": "minecraft:emerald",
  "conditions": [
    {"condition": "minecraft:random_chance", "chance": 0.2}
  ]
}

This gives a 20% chance to drop the item - perfect for "more frequent harvests with fewer items per cycle" gameplay.

🔄 Migration from Legacy System

If you have existing loot tables at the old path:

Old: data/easy_mob_farm/loot_tables/entities/<namespace>/<entity>.json
New: data/easy_mob_farm/loot_tables/entities/fallback/<namespace>/<entity>.json

Simply move your files into the fallback/ subdirectory. The old path is still supported with a deprecation warning.

🧩 Troubleshooting

If your custom loot table does not seem to work:

  • ✅ Verify the file is in the correct mode directory (overwrite/, priority/, bonus/, or fallback/)
  • ✅ Ensure the JSON syntax is valid with at least "type" and "pools"
  • ✅ Check Minecraft logs with debug mode enabled

📋 Log Examples

When using mode-based loot tables:

Using overwrite loot table for EntityType{minecraft:zombie}
Using priority loot table for EntityType{minecraft:creeper}
Using bonus loot table for EntityType{minecraft:cow}
Using fallback loot table for EntityType{iceandfire:fire_dragon}
Using legacy loot table path easy_mob_farm:entities/minecraft/ender_dragon - please move to entities/fallback/

If malformed:

Couldn't parse loot table easy_mob_farm:entities/overwrite/...
Expected name to be an item, was unknown string '...'

📦 Summary

  • ✅ Four modes: overwrite, priority, bonus, fallback
  • ✅ Directory-based system - no config files needed
  • ✅ Modes can combine (priority + vanilla + bonus)
  • ✅ Use set_count for quantity control
  • ✅ Use random_chance for drop frequency
  • ✅ No mod integration required - works via datapacks
  • ✅ Fully supports modded items and conditions
⚠️ **GitHub.com Fallback** ⚠️