how to make a random items in my custom structure?

Started by kur35k on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how to make a random items in my custom structure?

I created a loot table for random loot in my structure. I watched tutorials, and to create a chest in the structure with random loot, I needed to write this command in the command block:

/data merge block ~ ~-2 ~ {LootTable:"(loot table name)"}

but this command was added only in version 1.13
After which I found another command (it works for a person who was also looking for a way to create a structure with random loot):

/setblock ~ ~ ~ chest 0 replace {LootTable:"loot table name"}

This command also doesn't work (where I found it, it said about adding a file with a loot table to the loot_tables folder, which is or should be located in the path saves/world name/data) I'm simply not getting loot in the chest the command creates.

Just in case, I'm using mcreator 2020.2 and creating the mod on Forge 1.12.2.