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.14.4] Custom Block Doesn't Drop When Broken

Featured Replies

Posted

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 by Blu_Nighttime
title edit

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

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.