Started by
JarikTSM
on
Topic category: Help with Minecraft modding (Java Edition)
How do i get the flammability of block/item using proceedures?
If i cant normaly then what custom code snippet i need to use?
Topic category: Help with Minecraft modding (Java Edition)
How do i get the flammability of block/item using proceedures?
If i cant normaly then what custom code snippet i need to use?
Code in the snippet:
BlockPos pos = BlockPos.containing(x, y, z); // Get the block position
BlockGetter blockGetter = (BlockGetter) world; // Cast LevelAccessor to BlockGetter
flammability = blockGetter.getBlockState(pos).getFlammability(blockGetter, pos, Direction.UP);
I had to use the get hardness first just to get it to generate the code so it was getting the block position. If you lock the code you can make it neater. I bound this to the when block placed and it accurately displayed the blocks flammability each time. ChatGPT and BingAi are your friends here I did this in like 10minutes using those.