Started by
EbonyCrow
on
Topic category: Help with Minecraft modding (Java Edition)
I have some custom leaves in my mod and I want them to randomly drop sticks or saplings when they are broken or decay. From old forum topics, I learned that loot tables are the best way to do this, but none of those topics actually mentioned how to connect the loot table to the block being broken. So, how do I connect loot tables to the block being broken/decaying?
You create the block then you create your loottable and choose your modded block, if you don't know how is just like vanilla blocks,, and if you don't know how to make loot tables, here is the tutorial:
https://mcreator.net/wiki/how-make-loot-table
I've been struggling with the same problem today, but I finally figured it out.
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".
Did this help?
I already figured it out, but the detailed explanation would have really helped me when I was still struggling! Thanks, Qsome.
You're welcome, sorry I was too late! Lol
Strange. when I looked at this, i saw that you must put upper case letters , butt when i did it the box turned red
You should not use uppercase letters. If your block has uppercase letters in its name you must make them lowercase and place a underscore before them (don't put a underscore at the beginning, even if the first letter of the block is capitalized though).
For example, my block "BlockJoltLeaves" (with capital letters) had to be written as "blocks/block_jolt_leaves" (with underscores and no capital letters) in the input slot because capital letters aren't allowed when you are creating a loot table.
I have the same issue. It won't let me have a name starting with a lowercase letter, so it says it's invalid, because I can't write "blocks".
What is the name of your block?
"ancient_log"
It should be named "blocks/ancient_log" in the loot table.
It won't let me name it that; it keeps capitalizing "blocks".
Never mind, I got it! It won't let me delete my pos though...
i still don't know how to do it, name of my block is VoidiumOre btw
still dont know how to do it, is the reply by Qsome for an older version of MCreator (the block i'm making is CloverPatch)