Randomized Structure Loot

Adding loot tables to containers in structure is easy, you need to have PC and NBT Studio installed.

Software Preparation

Download and launch NBT Studio

Exporting Structure

Export your structure into BP/structures

Creating the Loot Table

Create the directory BP/loot_tables/chests and create your loot table file here.

You can learn how to make loot tables in Beginners Guide

BP/loot_tables/chests/my_structure_loot.jsonCopy
{
	"pools": [
		{
			"rolls": {
				"min": 8,
				"max": 10
			},
			"entries": [
				{
					"type": "item",
					"name": "minecraft:glass_bottle",
					"functions": [
						{
							"function": "set_count",
							"count": {
								"min": 4,
								"max": 6
							}
						}
					],
					"weight": 1
				},
				{
					"type": "item",
					"name": "minecraft:potion",
					"functions": [
						{
							"function": "set_count",
							"count": {
								"min": 4,
								"max": 6
							}
						}
					],
					"weight": 1
				}
			]
		}
	]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

Adding the Loot Table

Launch NBT Studio and open file (Ctrl + O)

Find your container (Ctrl + F)

Navigate to your container, block_position_data > block_entity_data. Add a string tag

Add LootTable and the file path to your loot table

Save changes (Ctrl + S)

Testing

Load your structure and open the container

Contributors

SirLichMedicalJewel105