I created a loot table with the latest snapshot version of mcreator and I cannot figure out how to apply it to anything.
Issue comments
Sorry for the late response , didn’t see that you replayed until now, here is a screenshot: https://drive.google.com/file/d/1Pg79-FK7ZCZmliHQ9SzgHsYpC6MvjUrc/view?…
https://mcreator.net/forum/64252/how-make-block-drop-items-loot-table
If you go inside the Loot Table element, the very top input slot says "Loot table registry name:". You first need to set that input to the "blocks/stone" in the drop-down box.
Next, delete everything after the "/", leaving only "blocks/".
Finally, leaving the "blocks/" untouched, add the ENTIRE name of your block to the end, with all the uppercase letters lowercase, and a "_" before each of where the uppercase letters were (except if the first letter was uppercase. don't put a underscore before that). This step is the problematic one.
For example, my leaf block element was named "BlockJoltLeaves" (as in that's what the name showed up as on the main workspace screen, not the in-game gui name), so to get this to work for my leaf block, that top input slot had to say "blocks/block_jolt_leaves". Note that I had to add "block" after the "/", because that was what my element's name started with, and I put a "_" before where each of the uppercase letters had been (except the first "b" of course).
Also, the other two drop down slots are set to "mod" and "block".
For 1.12.2, he solution is very simple:
1 - Open the code of your custom chest
2 - Go to the very bottom to this method: @Override
public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) {
return new GuiContainergui.GuiContainerMod(this.getWorld(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), playerIn);
}
3 - Add this before the return:this.fillWithLoot(playerIn);
(it should look like this) @Override
public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) {
this.fillWithLoot(playerIn);
return new GuiContainergui.GuiContainerMod(this.getWorld(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), playerIn);
}
4 - Lock the code and save
5 - Profit
Note: This extra line is inserted when the code for recovering items from the container is initialized and tries to fill the container accordingly to the loot table in its NBT data like the vanilla chest. You can find the same line in TileEntityChest.java at line 433.
You can apply it to custom blocks or entities by using mod namespace and same registry name as the registry name of the element, or use minecraft namespace to override existing loot tables.