-
Notifications
You must be signed in to change notification settings - Fork 9
Loot
Important
This page is part of the older wiki for 2.2.x versions of the mod. Not all the concepts introduced carry over to newer versions.
All loot tables used for chests and barrels are located in data/dungeoncrawl/loot_tables/chests/. Currently, it contains the following loot tables:
| File Name | Use Case |
|---|---|
| kitchen.json | Used in the food side room. |
| library.json | Used in the large node with bookshelves. |
| secret_room.json | Used in the secret room. |
| stage_1.json | Used in the first layer of a dungeon. |
| stage_2.json | Used in the second layer of a dungeon. |
| stage_3.json | Used in the third layer of a dungeon. |
| stage_4.json | Used in the fourth layer of a dungeon. |
| stage_5.json | Used in the fifth and all following layers of a dungeon. |
| supply_chest.json | Used in the starter room. |
| treasure_room.json | Used in the final loot room. |
Additionally, other loot tables are stored in data/dungeoncrawl/loot_tables/misc/
| File Name | Use Case |
|---|---|
| dispenser_1.json | Automatically applied to all dispensers on the first layer of a dungeon. |
| dispenser_2.json | Automatically applied to all dispensers on the second layer of a dungeon. |
| dispenser_3.json | Automatically applied to all dispensers on the third and all following layers of a dungeon. |
To change any of the loot tables, simply override it's file with a datapack.
In addition to the loot tables, there are also treasure item files located at data/dungeoncrawl/treasure/. These files are very similiar to loot_tables and are used to determine the item that is used when the dungeoncrawl:random_item loot function is used during loot generation for a chest.
Adding items to these files instead to the loot tables directly will make it easier to insert large quantities of items to the loot pool, since you won't have to tweak the weights of all existing items in order to maintain a proper generation chance distribution.
Each entry must and can only have a value for the item's resource name and it's weight:
{
"item": "minecraft:leather_boots",
"weight": 1
}A complete treasure file could look like this:
[
{
"item": "minecraft:leather_boots",
"weight": 1
},
{
"item": "minecraft:leather_leggings",
"weight": 1
},
{
"item": "minecraft:leather_chestplate",
"weight": 1
},
{
"item": "minecraft:leather_helmet",
"weight": 1
},
{
"item": "minecraft:chainmail_boots",
"weight": 1
},
{
"item": "minecraft:chainmail_leggings",
"weight": 1
},
{
"item": "minecraft:chainmail_chestplate",
"weight": 1
},
{
"item": "minecraft:chainmail_helmet",
"weight": 1
},
{
"item": "minecraft:wooden_pickaxe",
"weight": 3
},
{
"item": "minecraft:wooden_axe",
"weight": 2
},
{
"item": "minecraft:wooden_hoe",
"weight": 2
},
{
"item": "minecraft:stone_pickaxe",
"weight": 4
},
{
"item": "minecraft:iron_shovel",
"weight": 2
},
{
"item": "minecraft:stone_hoe",
"weight": 2
},
{
"item": "minecraft:stone_axe",
"weight": 2
}
]To change a treasure file, simpy overwrite its file with a datapack.
For more information on how the treasure files are used, see the Loot Function section. All treasure files can be overwritten by a datapack.
Dungeon Crawl provides several loot functions. All of those loot functions and their effect, requirements, etc... are explained and listed below.
Name: dungeoncrawl:enchanted_book
Required Additional Information: loot_level
The loot level parameter determines "how good" the loot is supposed to be. In most cases, this should be equal to the stage (dungeon layer) the loot table with this function is used in.
Effect: Creates an enchanted book. The enchantment level depends on the loot level.
Implementation Example:
{
"type": "item",
"name": "minecraft:air",
"weight": 1,
"functions": [
{
"function": "dungeoncrawl:enchanted_book",
"loot_level": 1
}
]
}The item name "minecraft:air" does not matter in this case, since the loot function will automatically create an enchanted book anyway.
Name: dungeoncrawl:material_blocks
Required Additional Information: None
Effect: Creates a stack of 16 - 32 blocks of the material block of either a theme or a sub-theme fitting for the biome the chest is in.
Implementation Example:
{
"type": "item",
"name": "minecraft:air",
"weight": 1,
"functions": [
{
"function": "dungeoncrawl:material_blocks"
}
]
}The item name "minecraft:air" does not matter in this case, since the loot function will automatically create a stack of blocks anyway.
Name: dungeoncrawl:random_item
Required Additional Information: loot_level
The loot level parameter determines "how good" the loot is supposed to be. In most cases, this should be equal to the stage (dungeon layer) the loot table with this function is used in.
Effect: Creates a random enchanted item based on the loot level.
This function uses the treasure files based on the rule below. For more information on that, visit the Treasure Files section.
| 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 |
Implementation Example:
{
"type": "item",
"name": "minecraft:air",
"weight": 6,
"functions": [
{
"function": "dungeoncrawl:random_item",
"loot_level": 1
}
]
}The item name "minecraft:air" does not matter in this case, since the loot function will automatically create a random item anyway.
Name: dungeoncrawl:special_item
Required Additional Information: loot_level
The loot level parameter determines "how good" the loot is supposed to be. In most cases, this should be equal to the stage (dungeon layer) the loot table with this function is used in.
Effect: Creates a random special item (enchantments and custom name) based on the loot level.
Implementation Example:
{
"type": "item",
"name": "minecraft:air",
"weight": 6,
"functions": [
{
"function": "dungeoncrawl:special_item",
"loot_level": 1
}
]
}The item name "minecraft:air" does not matter in this case, since the loot function will automatically create a random item anyway.
Name: dungeoncrawl:random_potion
Required Additional Information: loot_level
The loot level parameter determines "how good" the loot is supposed to be. In most cases, this should be equal to the stage (dungeon layer) the loot table with this function is used in.
Effect: Creates a random potion based on the loot level.
Implementation Example:
{
"type": "item",
"name": "minecraft:air",
"weight": 1,
"functions": [
{
"function": "dungeoncrawl:random_potion",
"loot_level": 1
}
]
}The item name "minecraft:air" does not matter in this case, since the loot function will automatically create a potion anyway.
Name: dungeoncrawl:shield
Required Additional Information: None
Effect: Creates a shield with random patterns.
Implementation Example:
{
"type": "item",
"name": "minecraft:shield",
"weight": 1,
"functions": [
{
"function": "dungeoncrawl:shield"
}
]
}Name: dungeoncrawl:suspicious_stew
Required Additional Information: None
Effect: Creates a suspicious stew with various random effects.
Implementation Example:
{
"type": "item",
"name": "minecraft:air",
"weight": 1,
"functions": [
{
"function": "dungeoncrawl:suspicious_stew"
}
]
}The item name "minecraft:air" does not matter in this case, since the loot function will automatically create a suspicious stew anyway.