Posted June 15, 20178 yr 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 June 15, 20178 yr by American2050
June 15, 20178 yr 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 June 15, 20178 yr by American2050
June 15, 20178 yr That seems very odd that Mojang would hard code in values for that, it just doesn't seem like something they would do.
June 15, 20178 yr 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/
June 15, 20178 yr 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.