Jump to content

Unbreakable Block is Breakable


American2050

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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/

Link to comment
Share on other sites

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.