The_SlayerMC Posted March 12, 2022 Share Posted March 12, 2022 Hi I have a custom chest that is lockable and unlockable, I have found how to change the explosion resistance depending if its locked or not: @Override public float getExplosionResistance(BlockState state, BlockGetter world, BlockPos pos, Explosion explosion) { return state.getValue(IS_LOCKED) ? 1000000F : super.getExplosionResistance(state, world, pos, explosion); } But can't find a method like there used to be to adjust the block hardness (i believe it was called getBlockHardnessLevel or something) which has obviously been removed in 1.18 Is there anything that has replaced it? Quote Former developer for DivineRPG, Pixelmon and now the maker of Essence of the Gods Link to comment Share on other sites More sharing options...
poopoodice Posted March 13, 2022 Share Posted March 13, 2022 You will probably need to change the value through getDestroyProgress. Quote Link to comment Share on other sites More sharing options...
The_SlayerMC Posted March 13, 2022 Author Share Posted March 13, 2022 Looks like that was the way to go, cheers 👍 Quote Former developer for DivineRPG, Pixelmon and now the maker of Essence of the Gods Link to comment Share on other sites More sharing options...
Recommended Posts
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.