mojira.dev
MC-81746

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

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.

Linked issues

Comments 7

Is it a good idea to add in all affected minecraft versions, or is it enough to only add the most current one?

There is no need to add older versions but please don't remove them.

Is this still an issue in the most recent versions (currently that is 1.10.2, or 16w42a) of Minecraft? If so, please update the affected versions and help us keeping this ticket updated from time to time.

Sorry, completely forgot about checking this regularly. Not used to being the one who submitted a bug.

I can confirm for most recent stable release 1.10.2 and last development release that has working redstone 16w41a. Cannot say anything about 16w42a.

Please do not mark unreleased versions as affected.
You don't have access to them yet.

RimaNari

(Unassigned)

Confirmed

block, data-value, falling_block, piston, sand

Minecraft 1.8.7, Minecraft 15w47c, Minecraft 1.10.2, Minecraft 16w41a, Minecraft 16w43a, ..., Minecraft 1.12.2, Minecraft 17w43b, Minecraft 17w45a, Minecraft 17w45b, Minecraft 17w46a

Minecraft 17w47a

Retrieved