How to make a block's item drop/item entity resistant to fire/lava?

Started by MetoolMan on

Topic category: Help with Minecraft modding (Java Edition)

Joined Mar 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a block's item drop/item entity resistant to fire/lava?

I asked an AI model for an example (embarrassing, I know) and it spat this out - no testing has been done, but does this work? Any experts here? I doubt it, somehow, lol.

 

@Override
	public ItemStack getCloneItemStack(BlockGetter world, BlockPos pos, BlockState state) {
        ItemStack stack = new ItemStack(this.asItem());
        stack.fireResistant(); // Makes the dropped item fire-resistant
        return stack;
    }

    public static class FireResistantBlockItem extends BlockItem {
        public FireResistantBlockItem(Block block) {
            super(block, new Item.Properties().fireResistant());
        }
	}

 

Joined Mar 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This has been done in the…
Thu, 03/20/2025 - 01:41

This has been done in the block's .java file.

Joined Mar 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
HEADS UP: DIDN'T WORK! What…
Thu, 03/20/2025 - 01:43

HEADS UP: DIDN'T WORK! What an unexpected suprise! So the question still stands - how does one do this?