Quote from NoBanForFantoz
Bedrock has an 18 million BLAST RESISTANCE, meaning no explosion in the game can break it. It also has a hardness of -1, a special value which makes it unmineable. But one can theoretically explode his or her way through.
The way explosions are handled in regards to destroying blocks is fairly complicated, and it turns out that TNT at point-blank range will break a block with blast resistance of ~77.67. Meaning, it would take an explosion roughly 231,750 times more powerful than TNT to destroy said block. And I'm fairly sure no computer in the world could handle that.
(Note: Blocks do not have "health". When there's an explosion, the block calculates whether it should be destroyed by that explosion, and each explosion is calculated separately. 200K TNT, even during the exact same game tick, would not have the effect of one gigantic explosion; instead, they would be 200K explosions, all of which are far too weak.)
Code for bedrock. hardness determines how hard it is to mine with the correct tool, and resistance is how hard it is to destroy with an explosion. It's impossible to mine -1 because damage starts at 0 and only counts up..bedrock = (new Block(7, 17, Material.rock)).setHardness(-1F).setResistance(6000000F).setStepSound(soundStoneFootstep).setBlockName("bedrock");
Also, a fun fact: If a mod was made that created a powerful enough explosive, and a computer was able to handle it, it's incredibly unlikely that the bedrock would drop as an item, since the odds decrease as explosions get more powerful.
Bonus fun fact: TNT is not the strongest explosive in the game. Charged creepers are. Blue wither skulls actually have a pitiful explosion, but they treat most blocks as having an equally pitiful blast resistance.