Skip to content

SpawnsWith Loot Tables

Partonetrain edited this page Nov 19, 2026 · 2 revisions

If the SpawnsWith feature and "Generic Mob Tables" option are enabled, mobs in the trains_tweaks:rolls_generic_equipment tag will roll the trains_tweaks:equipment/generic loot table after spawning. From here, equipment that is rolled will be equipped on the mob. The loot table is rolled with the local difficulty where the mob is spawning as the luck value, making it possible for different rates on different difficulties (using "bonus_rolls" and "quality" fields).

Additionally, you can define equipment tables for a specific mob by placing an equipment loot table at trains_tweaks:equipment/namespace/entityid_*, where * is either main_hand, off_hand, or armor. Mainhand and offhand tables should only ever roll up to one item each, while armor tables should only ever roll up to 4. Some examples can be found here. These too are rolled with local difficulty passed as luck. I tried to make the default ones 1:1 with vanilla, but with loot tables inherently not being as flexible as code, they may end up giving different results.

Caveats

  • The drop chance of all items generated when any SpawnsWith equipment table is not defined in the table, but rather the config file.
  • The Carved Pumpkin/Jack-o-Lantern helmet spawns on Halloween happen before equipment tables are rolled, and as such could be overwritten.
  • Enchantments can be defined in generic or specific loot tables, but by default the vanilla code that uses the minecraft:on_mob_spawn_equipment enchantment tag runs. This can be disabled with the "Populate Enchantments" option in SpawnsWith config, though.
  • Mobs that pick up items will still drop picked up items 100% of the time.

Clone this wiki locally