Skip to content

2.3.x Loot Modifications

Wufflez edited this page Nov 13, 2025 · 1 revision

Loot Configuration

Found in loot chests in dungeons in Dungeon Crawl, you can modify some of the equipment and loot. The configurations are per-level, affect every dungeon in your world, and require the understanding of how to make a datapack.

Treasure Configuration

Functioning similar to Loot Tables, treasure is used to determine the item that is randomly rolled when the dungeoncrawl:random_item loot function is used during loot generation for a chest.

The configuration for treasure is stored in data/dungeoncrawl/treasure.

< Name of Datapack >
├-- pack.mcmeta
└-- data
    └-- dungeoncrawl
        └-- treasure
            ├-- stage_1.json
            ├-- stage_2.json
            ├-- stage_3.json
            ├-- stage_4.json
            └-- stage_5.json

The treasure that can spawn in chest has a random chance to generate, and can be calculated like so:

$$chance=\frac{1}{0.5 + (0.1\times lootlevel)}$$

Where lootlevel is the level of luck the player has when openiong the chest.

Adding an entry to the trearure file is quite easy, as it requires only an item and a weight.

[
  {
    "item": "minecraft:iron_helmet",
    "weight": 4
  }
]

The json file is a list, therefore, multiple items can be added.

Loot Tables

The Loot Tables for Dungeon Crawl can be found in data/dungeoncrawl/loot_tables/chests/. Like vanilla loot tables, These ones can also be modified using datapacks.

Resource Location Description
food Found in the food side room
secret_room The secret bonus room
stage_1 Layer 1 of the Dungeon
stage_2 Layer 2 of the Dungeon
stage_3 Layer 3 of the Dungeon
stage_4 Layer 4 of the Dungeon
stage_5 Layer 5 of the Dungeon
supply Beginning safe room on layer 1
tresure Found in the final layer's treasure room
forge unused (Needs more info)
library unused (Needs more info)

And these Loot Tables are found in data/dungeoncrawl/loot_tables/misc/. These can be found in dispensers in the dungeon.

Resource Location Description
dispenser_1 First Layer Dispensers
dispenser_2 Second Layer Dispensers
dispenser_3 Third Layer Dispensers

Loot Functions

Dungeon Crawl has special loot functions that expand upon the loot found in dungeons. Do note: the name parameter in each of these functions under item should be ignored since the function does not take advantage of it. Additionally, the loot_level determines the strength or rarity of the funtion's effect. This generally should be equivilant to the dungeon layer's level.

Enchanted Book

Creates an enchanted book. The enchantment level depends on the loot level.

Example:

{
    "type": "item",
    "name": "minecraft:air",
    "weight": 1,
    "functions": [
        {
            "function": "dungeoncrawl:enchanted_book",
            "loot_level": 1
        }
    ]
}

Material Blocks

Creates a stack of 16 - 32 blocks of the material block of either a primary theme or a secondary theme fitting for the biome the chest is in.

Example:

{
    "type": "item",
    "name": "minecraft:air",
    "weight": 1,
    "functions": [
        {
            "function": "dungeoncrawl:material_blocks"
        }
    ]
}

Random Item

Creates a random enchanted item based on the loot level using the Treasure Configuration.

Loot Level Treasure File
1 data/dungeoncrawl/treasure/stage_1.json
2 data/dungeoncrawl/treasure/stage_2.json
3 data/dungeoncrawl/treasure/stage_3.json
4 data/dungeoncrawl/treasure/stage_4.json
All other levels data/dungeoncrawl/treasure/stage_5.json

Special Item

Creates a random special item (enchantments and custom name) based on the loot level.

{
    "type": "item",
    "name": "minecraft:air",
    "weight": 6,
    "functions": [
        {
            "function": "dungeoncrawl:special_item",
            "loot_level": 1
        }
    ]
}

Random Potion

Creates a random potion based on the loot level.

{
    "type": "item",
    "name": "minecraft:air",
    "weight": 1,
    "functions": [
        {
            "function": "dungeoncrawl:random_potion",
            "loot_level": 1
        }
    ]
}

Shield

Creates a shield with random patterns.

{
    "type": "item",
    "name": "minecraft:shield",
    "weight": 1,
    "functions": [
        {
            "function": "dungeoncrawl:shield"
        }
    ]
}

Suspicious Stew

Creates a suspicious stew with various random effects.

{
    "type": "item",
    "name": "minecraft:air",
    "weight": 1,
    "functions": [
        {
            "function": "dungeoncrawl:suspicious_stew"
        }
    ]
}

Clone this wiki locally