How to make block drop items from loot table?

Started by EbonyCrow on

Topic category: Help with modding (Java Edition)

Last seen on 03:28, 23. Mar 2024
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make block drop items from loot table?

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 13:11, 23. Jan 2022
Joined Sep 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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 21:12, 25. Jul 2022
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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 03:28, 23. Mar 2024
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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 21:12, 25. Jul 2022
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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 21:44, 26. Oct 2023
Joined Sep 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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 21:12, 25. Jul 2022
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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 03:55, 21. May 2022
Joined Nov 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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 21:12, 25. Jul 2022
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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 03:55, 21. May 2022
Joined Nov 2020
Points:

User statistics:

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

"ancient_log"

Last seen on 21:12, 25. Jul 2022
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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.

Last seen on 03:55, 21. May 2022
Joined Nov 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It won't let me name it that…
Thu, 04/15/2021 - 17:04

It won't let me name it that; it keeps capitalizing "blocks".

Last seen on 03:55, 21. May 2022
Joined Nov 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Never mind, I got it! It won…
Thu, 04/15/2021 - 17:06

Never mind, I got it! It won't let me delete my pos though...

Last seen on 06:40, 5. May 2021
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i still don't know how to do…
Wed, 05/05/2021 - 06:42

i still don't know how to do it, name of my block is VoidiumOre btw

Last seen on 02:24, 22. Aug 2021
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
still dont know how to do it…
Sun, 08/22/2021 - 02:24

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)