-
Notifications
You must be signed in to change notification settings - Fork 9
2.3.x Loot Modifications
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.
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:
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.
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 |
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.
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
}
]
}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"
}
]
}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 |
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
}
]
}Creates a random potion based on the loot level.
{
"type": "item",
"name": "minecraft:air",
"weight": 1,
"functions": [
{
"function": "dungeoncrawl:random_potion",
"loot_level": 1
}
]
}Creates a shield with random patterns.
{
"type": "item",
"name": "minecraft:shield",
"weight": 1,
"functions": [
{
"function": "dungeoncrawl:shield"
}
]
}Creates a suspicious stew with various random effects.
{
"type": "item",
"name": "minecraft:air",
"weight": 1,
"functions": [
{
"function": "dungeoncrawl:suspicious_stew"
}
]
}