Wiki 9Minecraft Wiki 9Minecraft

Editing Chest Loot Tables for Dungeons and Structures

Java EditionModGuides 4FAQ 20Related mods 60
DownloadLootTweaker Mod

Get the files on 9Minecraft

Contents (3)
  1. Locating Structure Chest Tables
  2. Adding Themed Loot
  3. Testing in a Fresh Chunk

Locating Structure Chest Tables

Structure chests use paths like minecraft:chests/simple_dungeon, minecraft:chests/desert_pyramid, or minecraft:chests/stronghold_library. Modded structures add their own namespace, so search the log dump for chests/ entries to find them all.

Adding Themed Loot

Suppose you want every dungeon chest to sometimes contain an enchanted book. Grab the table and add an entry with a low chance:

`zenscript

import mods.loottweaker.LootTweaker;

val dungeon = LootTweaker.getTable("minecraft:chests/simple_dungeon");

dungeon.addEntry(<minecraft:enchanted_book>, 1, 1, 0.15);

`

Chest tables often have multiple pools with rolls. Adding an entry appends to the main pool, so it rolls alongside existing loot. If you want a guaranteed item, use a chance of 1, but be aware this can flood chests if the pool rolls multiple times.

Testing in a Fresh Chunk

Chest loot is generated when the chunk first loads, so existing chests will not change. Travel to ungenerated terrain, or use a new world, to confirm your edits. If a chest still looks vanilla, the structure may use a different table than you assumed — recheck the dump.