Jump to content

Recommended Posts

Posted (edited)

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

Posted
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?

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

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

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

Posted

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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