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.

Featured Replies

Posted

So... I'm having a problem with a block I made. I set it as "unbreakable" so it's like Bedrock.

However a Wither can still destroy it, not with a regular attack, but if the Wither can't see me and starts shooting enchanted heads, those break my blocks.

 

What could the problem be?

 

PS: I'm now adding the method canEntityDestroy but that's a temporary fix, as it still means that my block is somehow still breakable by other means.

PS2: Not even having that method helps.

Edited by American2050

  • Author
10 minutes ago, ZombieHDGaming said:

You have to increase explosion resistance.

I went from this.setResistance(6000000.0F); to this.setResistance(600000000.0F); (adding two 0) that didn't do it...

 

I now added this other method:

 

@Override
	public boolean canDropFromExplosion(Explosion explosion) {
		return false;
	}

and apparently does the trick. From what I saw on the Wither code itself, it's there where it says that Wither can't destroy certain blocks, so it's not because block is set as unbreakable, but because of those lines on the Wither Code.

 

Wither code:

public static boolean canDestroyBlock(Block blockIn)
    {
        return blockIn != Blocks.BEDROCK && blockIn != Blocks.END_PORTAL && blockIn != Blocks.END_PORTAL_FRAME && blockIn != Blocks.COMMAND_BLOCK && blockIn != Blocks.REPEATING_COMMAND_BLOCK && blockIn != Blocks.CHAIN_COMMAND_BLOCK && blockIn != Blocks.BARRIER;
    }

 

Edited by American2050

Did you try the Block#setBlockUnbreakable method in combination with the Block#canEntityDestroy method? 

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

  • Author
3 minutes ago, larsgerrits said:

Did you try the Block#setBlockUnbreakable method in combination with the Block#canEntityDestroy method? 

Yes, that combination was still making so that special Wither attack, destroyed the block.

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.