int id = block.getRawId();
if (block instanceof CustomBlock) {
id = ((CustomBlock) block).getBlockId();
}
// Access the protected strength field in Block
Block mBlock = Block.byId[id];
float hardness = 999999999f; // Probably useless safeguard
try {
Field field = Block.class.getDeclaredField("strength");
field.setAccessible(true);
hardness = field.getFloat(mBlock);