Mojira Archive
MC-220232

Lightning that strikes a lightning rod facing into weathering copper does not de-oxidize it

The bug

A lightning rod facing into some oxidized copper (any stage) doesn't de-oxidize it.

How to reproduce

  1. Have a downward facing lightning rod
  2. Place some oxidized copper under it
  3. Strike it with lightning

Observed Result

It doesn't de-oxidize the copper.

Expected Result

It would de-oxidize the copper.

Code analysis

The lightning bolt has a check on clearCopperOnLightningStrike(...) which only checks the block facing the opposite way from it, so if the lightning rod is placed facing into the copper (upside down or laterally outwards) it will not work.

net.minecraft.world.entity.LightningBolt.java (1.18-rc3, Mojang mappings)
...
private static void clearCopperOnLightningStrike(Level level, BlockPos blockPos) {
        ...
        BlockState blockState = level.getBlockState(blockPos);
        if (blockState.is(Blocks.LIGHTNING_ROD)) {
            BlockPos blockPos2 = blockPos.relative(blockState.getValue(LightningRodBlock.FACING).getOpposite());
            BlockState blockState2 = level.getBlockState(blockPos2);
        }
        ...
}
...

Unresolved

[Mod] Anthony Cicinelli

2021-03-20, 12:36 AM

2024-08-02, 07:24 PM

5

5

Confirmed

Low

Gameplay

Block states

21w11a - 1.2121w11a, 21w13a, 21w14a, 21w15a, 21w17a, 1.17, 1.17.1, 21w39a, 1.18 Release Candidate 3, 1.18.1, 22w15a, 22w18a, 1.19 Pre-release 5, 1.19, 1.19.2, 1.19.3 Pre-release 1, 1.19.3, 1.21

-