Posted September 4, 20196 yr When a custom block is broken in survival, it doesn't drop and is just destroyed. I create a block like this: public static final Block CUSTOM_BLOCK = new Block(Block.Properties.create(Material.ROCK).hardnessAndResistance(3.0F, 3.0F)).setRegistryName(id, "custom_block"); And register inside of getRegistry#registerAll, so the block appears and functions 'normally' but doesn't drop on break. I think I saw somewhere that block breaks are something to do with getLootTable but not 100 percent sure. Also looking at the docs for 1.13.x, and not sure if it changed in 1.14.4, there's a function called onBlockDestroyedByPlayer but I'm not sure if I need to implement this into each class for the block. If there's something else I'm missing that would be causing my confusion then please let me know - I've never had this issue before. Thanks. Edited September 4, 20196 yr by Blu_Nighttime title edit
September 4, 20196 yr Author Ah ha, so the loot tables that I saw mentioned somewhere else is the way that blocks are now dropped. I looked up in the reference library once you said, if I did have a loot table, and found out how to do it. Once I added the loot table for my mod and custom block to it, the block dropped when broken in survival. Thanks again.
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.