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

Falling block entities don't check for data values: converting sand to red sand



    • Bug
    • Resolution: Fixed
    • Minecraft 17w47a
    • Minecraft 1.8.7, Minecraft 15w47c, Minecraft 1.10.2, Minecraft 16w41a, Minecraft 16w43a, Minecraft 16w44a, Minecraft 1.11 Pre-Release 1, Minecraft 1.11, Minecraft 16w50a, Minecraft 1.11.1, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w13a, Minecraft 17w14a, Minecraft 17w17b, Minecraft 17w18b, Minecraft 1.12 Pre-Release 1, Minecraft 1.12 Pre-Release 2, Minecraft 1.12 Pre-Release 5, Minecraft 1.12 Pre-Release 6, Minecraft 1.12, Minecraft 17w31a, Minecraft 1.12.1, Minecraft 1.12.2 Pre-Release 2, Minecraft 1.12.2, Minecraft 17w43b, Minecraft 17w45a, Minecraft 17w45b, Minecraft 17w46a
    • Confirmed


      The bug

      It appears that when there is a falling sand entity and the block gets replaced by another sand block the data value of the new block isn't checked for, generating a falling sand entity with a data value that is not the data value of the block that is actually falling - therefore converting, by letting fall, data values of sand blocks into each other.
      Especially notable this can be used to convert sand into red sand or vice versa, as red sand is just sand with data value 1 instead of 0.

      Also see this video, which explains the effect (and gives a tutorial for a redstone contraption achieving this): https://youtu.be/wtBS62Xyoa4?t=1m8s (watch from beginning for a demonstration of the effect)

      As of snapshot 17w06a this also applies to the whole palette of the newly added concrete powder blocks. Like sand they are affected by gravity and the different colored versions are distinguished only by a data value like it is the case with sand and red sand. As of course concrete powder can be turned into concrete this bug allows players to make any colored concrete and concrete powder block from one color alone, given that they have one of each color to begin with. This obviously has a larger effect on gameplay then only sand-to-red-sand-conversion, which makes this bug much more important in 1.12.

      Code analysis

      Based on 1.11.2 decompiled using MCP 9.35 rc1

      The problem seems to be that the method net.minecraft.block.BlockFalling.checkFallable(World, BlockPos) does not remove the block but instead has the method net.minecraft.entity.item.EntityFallingBlock.onUpdate() do that some ticks later.

      Lets say we have two sand blocks, a normal one and a red one. The red one is the one which gets "converted". The following probably happens:

      1. The normal sand is pushed in the middle
      2. The normal sand is created as entity
      3. The red sand is pushed in the middle pushing the normal sand block back
      4. The normal sand starts falling and replace the red sand

      Therefor the red sand was actually deleted and the normal sand duplicated.


        Issue Links



              Unassigned Unassigned
              RimaNari RimaNari
              10 Vote for this issue
              6 Start watching this issue