Started by
THe_mag-pie
on
Topic category: User side tutorials
I plan to make some structures in one of my mods, most of which have chests in them, how do I put random items in the chests like in dungeons.
Topic category: User side tutorials
I plan to make some structures in one of my mods, most of which have chests in them, how do I put random items in the chests like in dungeons.
there is a command that spawns a chest with random loot
/setblock ~ ~ ~ minecraft:chest 2 replace {LootTable:"chests/simple_dungeon"}
it generates a chest with random loot that you would fin in a simple dungeon, here is also the wiki page where you can find more lot tables
https://minecraft.gamepedia.com/Loot_table#List_of_loot_tables
one last thing , if you want the chest to have random loot in a structure don't open it , if you do the loot won't randomize.
hope i was useful to you
THX
How do I use/add the loot tables to blocks? I created a loot table. How can I assign a loot table to, lets say a chest?
I tried to do it with a command in a procedure but I am to stupid to get it working ^^´. I use 1.12.2 as selected version.
Or maybe you can add a "assign loot table" procedure block? :P
LootTable:"chests/simple_dungeon" works, but how do I define my custom loot table?
You to write blocks/regristry_name_of_the_block.
More information here: https://mcreator.net/wiki/how-make-loot-table
/setblock ~ ~ ~ minecraft:chest 2 replace {LootTable:"dungeonmod:testloot"} isn´t working
so do you mean...
/setblock ~ ~ ~ minecraft:chest 2 replace {LootTable:"blocks:testloot"} ?? :/
I am not sure if it will work in 1.12.2, update to 1.14.4.
I already got it easy working for 1.14.4 with
data merge block ~ ~ ~ {LootTable:"dungeonmod:testloot"}
but in 1.12.2 this command does not exist. So I need a other way ;)
I am not sure how you would do it in 1.12.2, I suggest you to stick with 1.14.4, 1.12.2 was marked as legacy by Forge developers.
Works for me if you add the type of loot it is <example: chests> and then /<name> like this: /setblock ~ ~ ~ minecraft:chest 1 replace {LootTable:"modid:loottype/lootname"}
Replace modid with your mod id, loottype with whatever kind of loot it is, and lootname with the name you put after the slash.
Options for loot type are:
blocks/
chests/
entities/
gameplay/
Alright, let's say I set my loot table type to chest. Where do I have to put my loot table file? Which folder? Do you use 1.12.2?
So the command should be:
/setblock ~ ~ ~ minecraft:chest 1 replace {LootTable:"dungeonmod:chests/testloot"}
What must be the path of the testloot.json?
still nothing works for me :(
This topic is a bit old but for thoses who still not kno what to use : This video explain all ! (Found here)
- So you make a loot table, give a chest and a command block.
- Put the chest on the floor, the command block above and inside you type "/data merge block ~ ~-1 ~ {LootTable:"loot_table_name"}".
=>Now your chest will generate rand items sets in your loot table when you'll open it.
-> So if you want the loot to be randomised in a structure DO NOT OPEN the chest. Just sneak + click wheel to get the chest with the loot table's NBT tag.
/setblock ~ ~ ~ chest{LootTable:"dungeonmod:testloot"} works for me