Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[SOLVED][1.15.2] Loot table for block not recognized

Featured Replies

Posted

Let's say my block is called mod_block for a new_block mod.

 

According to the documentation, Forge says I should use "LootTableList.register(new ResourceLocation("new_block", "mod_block"))" asuming that "mod_block" is a json file inside /assets/new_block/loot_tables/mod_block.json. The problem is that this method does not exist, and I've seen a lot of solutions stating that instead, just place the loot table under /data/new_block/loot_tables/blocks/ as one would do for a datapack, without the need of writing code (on a side note, I've tried placing it just under loot_tables/ too). Doing so, does not work for me, having a loot table like this.

 

I have looked at vanilla loot tables, and most (if not all) look like that. So why does Forge still have the instruction of using that method if it does not exist, and that location if it's suggested to do it under another one? Is there something else I need to add, so that Forge recognizes that loot table? (at least, it does recognize a recipe for that block under data/recipes/).

Edited by tubi_carrillo
solved

52 minutes ago, tubi_carrillo said:

The problem is that this method does not exist,

I don't know where you got the information that you have to use that method, but you don't it is automatic now. And it uses your registry name as the file name.

55 minutes ago, tubi_carrillo said:

/assets/new_block/loot_tables/mod_block.json

It's not supposed to be assets/ it's data/modid/loot_tables/blocks/mod_block.json.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

  • Author
Just now, Animefan8888 said:

I don't know where you got the information that you have to use that method, but you don't it is automatic now.

It says so in the documentation: https://mcforge.readthedocs.io/en/1.15.x/items/loot_tables/#registering-a-modded-loot-table

 

 

1 minute ago, Animefan8888 said:

It's not supposed to be assets/ it's data/modid/loot_tables/blocks/mod_block.json.

I know, I've tried that too and did not work for me. Could it be something about the file itself?

Just now, tubi_carrillo said:

That's meant for other things. like entities and chests. not blocks. It doesn't say that it's required for blocks under the blocks section.

 

2 minutes ago, tubi_carrillo said:

I know, I've tried that too and did not work for me. Could it be something about the file itself?

If it  is something about the file itself there will likely be an error in the console when you load up Minecraft.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

  • Author
1 minute ago, Animefan8888 said:

That's meant for other things. like entities and chests. not blocks. It doesn't say that it's required for blocks under the blocks section.

I see now, thanks for clarifying that.

 

1 minute ago, Animefan8888 said:

If it  is something about the file itself there will likely be an error in the console when you load up Minecraft.

I searched through the logs, but there were no errors related to this. So I guess that too.

 

Could this be a problem related to having a lot of block states? Vanilla doesn't have different loot tables for each block state, so I don't think this could be the case. 

 

Otherwise, I don't see what else could be the problem nor how to fix it.

1 minute ago, tubi_carrillo said:

Could this be a problem related to having a lot of block states? Vanilla doesn't have different loot tables for each block state, so I don't think this could be the case.

No it shouldn't be can you post your project as a github repo.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

  • Author

I just found out, that I could actually get the item. The thing is that very time I tried before, I did it bear-handed (for the time being, I only tried with a pickaxe).

  • Author

Ok so, the problem was that I set the material of my block to be rock (Material.ROCK) and it was meant to be broken without the need of any other items. I changed it and it was solved, thanks for the fast responses.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.