Posted January 2, 20205 yr Hi (I am kinda new to this) Simply my answer is: How do I make that my custom block* drops "itself" (BlockItem) when I mine it. Block and BlockItem are registered and they works in game (by "works" I mean they can exists). *My custom block doesn't have anything. It can be placed, it can be dropped from inventory, it can be destroyed, it can be found in tab in creative mode - basically it acts as cobblestone except the fact, it doesn't drop itself when it is destroyed* I found out that I need some "loot tables". So I created "chopping_block_loot_table.json" in src/main/resources/assets/automation/loot_tables/blocks/ and filled it with (my custom block has "chopping_block" as register name and my MODID is "automation"): "pools": [ { "rolls": 1, "entries": [ { "type": "minecraft:item", "name": "automation:chopping_block" } ] } ] and it doesn't work - It doesn't even detect that it was loaded when I did this: @EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.FORGE) public static class RegistryEventsForge { @SubscribeEvent public static void onLootTableLoad(LootTableLoadEvent evt) { System.out.println(evt.getName()); } } It shows all loot tables except my own. I couldn't find where I make mistake. I think I have to somehow register my loot table, but I don't know where should I do this in this 1.15.1 version. Probably I have to put somewhere " new ResourceLocation("automation:chopping_block_loot_table") ", but I don't know where (MODID = automation, chopping_block_loot_table is name of that json file)
January 2, 20205 yr isn't there a data directory for server side stuff like loot tables? change src/main/resources/assets/automation/loot_tables/blocks to src/main/resources/data/automation/loot_tables/blocks and it should work
January 2, 20205 yr Use the data directory in resources. Here's a sample loot table. https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/resources/data/harderores/loot_tables/blocks/millstone.json Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
January 3, 20205 yr Author Thank you! It works. Just one more thing you missed so I will write it here for others who has the problem. The json file that I named "chopping_block_loot_table.json" I had to rename to "chopping_block.json" because that is my register name for my custom block. There is no registration for loot tables that you need to have in your code. That's it thx you guys!
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.