Skip to content

Direct Drops

fzzyhmstrs edited this page Dec 10, 2022 · 1 revision

Often there are certain drops defined by Minecraft or Mods that don't use the loot table system to define their behavior. These drops are typically hardcoded one way or another. Examples:

  • Equipment spawned with a mob, like a skeleton's bow.
  • Special items that are are hardcoded, like the Wither's nether star.
  • Certain mods that handle all of their drops via hardcoding, rather than with tables.

Drops defined this way will have a icon indicating that they are a direct drop:

image

Direct Drop Tables

To handle these situations, you may simply define a "spoof" loot table that matches the functionality of the hardcoded drop, without actually registering into the Minecraft loot system. EMI Loot uses these tables specifically to define visual information in the recipe viewer. Place these loot tables in the following data path:

Direct drop tables are server-side, so go in your datapack or data mod folder

./data/<mod_id>/direct_drops/<table_type>/<table_name>.json

In this case, the mod_id, table_type, and table_name all matter. These need to match to the block or mob being spoofed.

  • mod_id must match the mod id of the block or mob. minecraft block means minecraft folder.
  • table_type must be one of the types used by Minecrafts loot system, currently only blocks, and entities is supported.
  • table_name must match to the block/entity being spoofed. A squid will lead to a table name of squid.json. Check in-game with the /summon command if you need to figure out a mobs exact id, or turn on advanced tooltips to see a blocks id.

Custom Functions and Conditions

EMI Loot adds support for several Lootify custom loot functions and conditions, for simpler and more nuanced table description.

ID Type Description In-Game Example
lootify:wither_kill Condition Describes a drop made when a wither kills another mob image
lootify:spawns_with Condition Drops when the mob naturally spawns with the item image
lootify:creeper Condition Drops when the mob is blown up by a charged creeper; useful for mob heads image
lootify:set_any_damage Function Used in place of set_damage if the item can be damaged to any value from 1 to max image
lootify:ominous_banner Function Defines an ominous banner drop when the input item is a white banner image

Configuration

Direct drops can be disabled in the EMI Loot config. If for some reason these drops are not desirable, they can be disabled.

Example

The following loot table example adds the hardcoded drops of the wither into EMI Loot for display. Without this file included, the wither doesn't show up in the viewer at all, because it has no traditional loot table. This example table uses the standard vanilla loot table format as described here, with the addition of the lootify condition lootify:wither_kill.

This table is defined in the path ./data/minecraft/direct_drops/entities/wither.json; you can find it in the EMI Loot files if you open the .jar file.

{
  "type": "minecraft:entity",
  "pools": [
    {
      "bonus_rolls": 0.0,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:nether_star"
        }
      ],
      "rolls": 1.0
    },
    {
      "bonus_rolls": 0.0,
      "conditions": [
        {
          "condition": "lootify:wither_kill"
        }
      ],
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:wither_rose"
        }
      ],
      "rolls": 1.0
    }
  ]
}
Clone this wiki locally