How to make block drop items from loot table?

Started by EbonyCrow on

Topic category: Help with Minecraft modding (Java Edition)

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?

Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Everytime I Type In The "/"…
Wed, 10/13/2021 - 16:31

Everytime I Type In The "/" In "Blocks/" It says its invalid

Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@Landon_And_Emma I was…
Wed, 12/06/2023 - 06:45

@Landon_And_Emma

I was confused at the start, and I searched the web to get nothing, so I sat there through countless trials and errors, but I did these steps in this order to achieve my end goal.

  1. I hit create new loot table
  2. It will then ask you to create a name, you do not need to name it anything special yet, (That's why you coudn't name it with a '/' or slash). For example my one was Relic_Dirt_Loot_Table
  3. Then hit create
  4. After it opens the page of the loot table creator, at the top is where you change the 'Loot table registry name:', that's where you add your loot table, to "Block/example" or whatever your loot table type is. For example my one was 'Block/Relic_Dirt'
  5. Then click save, however, I found that once saved, you cannot change the directory again, so make sure your spelling and caps are correct, because incorrect capitalized letters do not work.

I hope this helped.

(P.S I made an account just to respond here, lol)