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.
This allows modpack creators and other mod developers to define specific drops for individual mobs or even third-party entities like dragons, bosses, or custom NPCs.

These loot tables are automatically loaded and will be used only if the original entity’s loot table is empty or missing, which is often the case for special or custom mobs such as ender_dragon, ice_dragon, or other modded entities / bosses.

This allows mod developers to define custom drops for their entities without requiring special integration. By placing the corresponding loot table at data/easy_mob_farm/loot_tables/entities/<namespace>/<entity_name>.json, the mob will drop the defined items when captured and processed by the Easy Mob Farm system.

πŸ“ Loot Table Structure

The custom Loot tables are stored in the following path within a data pack or resource pack:

data/easy_mob_farm/loot_tables/entities/<namespace>/<entity_name>.json
  • <namespace>: The namespace of the entity's mod (e.g. minecraft, iceandfire)
  • <entity_name>: The entity's registry name (e.g. ender_dragon, fire_dragon)

βœ” Example Paths

Entity Resource Location Path
Ender Dragon easy_mob_farm:entities/minecraft/ender_dragon data/easy_mob_farm/loot_tables/entities/minecraft/ender_dragon.json
Fire Dragon (Ice & Fire) easy_mob_farm:entities/iceandfire/fire_dragon data/easy_mob_farm/loot_tables/entities/iceandfire/fire_dragon.json

πŸ›  How It Works

  1. The mod first attempts to use the vanilla loot table of an entity.
  2. If the vanilla loot table is empty or does not exist, it looks for a fallback loot table under:
    data/easy_mob_farm/loot_tables/entities/<namespace>/<entity_name>.json
    
  3. If a custom loot table is found, it is used to generate loot for the mob farm.

πŸ’‘ 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.

πŸ‰ Ice and Fire Dragon Example

The following example shows the custom loot table for the Fire Dragon for the Ice and Fire mod. This loot table will drop dragon bones, dragon flesh, and dragon blood.

πŸ“‚ File: data/easy_mob_farm/loot_tables/entities/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}
          ]
        }
      ]
    }
  ]
}

🧩 Troubleshooting

If your custom loot table does not seem to work, check the following:

  • βœ… Make sure the file exists at the correct path inside the datapack or mod resources.
  • βœ… Ensure the JSON syntax is valid and includes at least "type" and "pools".
  • βœ… Check your Minecraft logs (latest.log) while running with debug mode enabled.

πŸ“‹ Log examples when a loot table is being used:

You may see entries like the following when a custom loot table is loaded:

No loot drops for EntityIceDragon['Ice Dragon'/4859, l='ServerLevel[Enderdragon]', x=0.00, y=0.00, z=0.00] trying custom loot table easy_mob_farm:entities/iceandfire/ice_dragon!
No loot drops for EnderDragon['Ender Dragon'/4790, l='ServerLevel[Enderdragon]', x=0.00, y=0.00, z=0.00] trying custom loot table easy_mob_farm:entities/minecraft/ender_dragon!

These messages indicate that the default loot table was empty, and a **custom one is being used ** instead.

If your file is malformed or refers to missing items, you will see:

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

Use these logs to verify correct integration and fix issues.

πŸ“¦ Summary

  • βœ… No mod integration is required β€” works via datapacks or resource packs
  • βœ… Fully supports modded items and conditions
  • βœ… Allows customized drops per mob or mod
⚠️ **GitHub.com Fallback** ⚠️