Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-210810

Additional candles cannot be added to the same block as candles if they have non-solid blocks below them

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 20w51a, 21w03a, 21w05b, 21w06a, 21w11a, 21w14a, 21w17a, 1.17, 1.17.1, 1.18, 1.18.1, 1.18.2, 1.19, 1.19.2, 1.19.3, 1.19.4, 1.20.1, 1.21, 1.21.3, 1.21.4
    • Confirmed
    • Block states
    • Normal
    • Platform

      The Bug:

      Additional candles cannot be added to the same block as candles if they have non-solid blocks below them.

      Just for clarification reasons, non-solid blocks are blocks such as air, leaves, honey blocks, etc...

      Steps to Reproduce:

      1. Place a candle on top of a block, and then destroy the block that's under the candle.
      2. Attempt to add additional candles to the same block as the candle you just placed.
      3. Take note as to whether or not additional candles can be added to the same block as candles if they have non-solid blocks below them.

      Observed Behavior:

      Additional candles cannot be added to the same block as candles if they have non-solid blocks below them.

      Expected Behavior:

      Additional candles would be able to be added to the same block as candles even if they have non-solid blocks below them.

      Code Analysis:

      Code analysis by Avoma can be found below.

      The following is based on a decompiled version of Minecraft 1.19.2 using MCP-Reborn.

      net.minecraft.world.level.block.CandleBlock.java
      public class CandleBlock extends AbstractCandleBlock implements SimpleWaterloggedBlock {
         ...
         public boolean canSurvive(BlockState blockState, LevelReader levelReader, BlockPos blockPos) {
            return Block.canSupportCenter(levelReader, blockPos.below(), Direction.UP);
         }
         ...

      Looking above, we can see that the canSurvive() method is present within the CandleBlock.java class. This method basically restricts candles from being able to be placed unless certain requirements are met. In this particular case, only one requirement is needed, and this is that the block below the desired location of placement must be solid and able to support the center of a candle block. With this being said, additional candles cannot be added to the same block as a candle if it has a non-solid block below it, thus resulting in this problem occurring.

      Fix:

      Simply removing the canSurvive() method from the CandleBlock.java class will allow additional candles to be added to the same block as a candle regardless of the block below it, thus fixing this issue.

        1. MC-210810.mp4
          3.50 MB
        2. MC-210810.png
          MC-210810.png
          485 kB
        3. Screenshot 2021-01-07 103044.jpg
          Screenshot 2021-01-07 103044.jpg
          41 kB

            Unassigned Unassigned
            Avoma [Mod] Avoma
            Votes:
            7 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              CHK: