How to make block drop items from loot table?

Started by EbonyCrow on Tue, 07/21/2020 - 06:51

Topic category: Help with modding (Java Edition)

Last seen on 00:55, 8. Apr 2021
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How to make block drop items from loot table?
Tue, 07/21/2020 - 06:51

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?

Last seen on 17:24, 21. Dec 2020
Joined Sep 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
You  create the block then…
Tue, 07/21/2020 - 07:25

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

 

Last seen on 23:12, 21. Mar 2021
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I've been struggling with…
Thu, 07/23/2020 - 07:03

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?

Last seen on 00:55, 8. Apr 2021
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I already figured it out,…
Thu, 07/23/2020 - 16:12

I already figured it out, but the detailed explanation would have really helped me when I was still struggling! Thanks, Qsome.

Last seen on 23:12, 21. Mar 2021
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
You're welcome, sorry I was…
Thu, 07/23/2020 - 18:40

You're welcome, sorry I was too late! Lol

Last seen on 02:52, 3. Apr 2021
Joined Sep 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Strange. when I looked at…
Mon, 02/08/2021 - 20:45

Strange. when I looked at this, i saw that you must put upper case letters , butt when i did it the box turned red

 

Last seen on 23:12, 21. Mar 2021
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
You should not use uppercase…
Mon, 02/08/2021 - 22:45

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.

Last seen on 22:37, 9. Apr 2021
Joined Nov 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I have the same issue. It…
Wed, 03/03/2021 - 17:16

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".

Last seen on 23:12, 21. Mar 2021
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
What is the name of your…
Wed, 03/03/2021 - 18:38

What is the name of your block?

Last seen on 22:37, 9. Apr 2021
Joined Nov 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
"ancient_log"
Tue, 03/09/2021 - 03:28

"ancient_log"

Last seen on 23:12, 21. Mar 2021
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
It should be named "blocks…
Tue, 03/09/2021 - 05:36

It should be named "blocks/ancient_log" in the loot table.