mojira.dev
MC-136470

Buckets' CanPlaceOn NBT check is applied to the block behind

The bug

When using a bucket in adventure mode, the logic that checks that the clicked block is listed in the bucket's CanPlaceOn tag is applied to the block behind the one the player clicked. For example, if the player clicked the top face of a block, the check is applied to the block below.

How to reproduce

/gamemode adventure
/give @p water_bucket{CanPlaceOn:["minecraft:grass_block"]}

→ ❌ Clicking on a grass block that does not have a grass block behind it does not place water.
→ ❌ Clicking on any block that has a grass block behind it places water.

/give @p bucket{CanPlaceOn:["minecraft:water"]}

→ ❌ Clicking on water that does not have water behind it does not pick up the water.

Linked issues

Attachments

Comments 6

Okay I did a bunch of testing and I've figured out what is going on with this bug. The tags do technically work, but they are not being applied to the proper location. You can place water on a grass block with the tag, if you place it 2 blocks away. You can also remove water, if you are removing water 2 blocks away from the nbt block type.

/give @p water_bucket{CanPlaceOn:["minecraft:grass_block"]}

This will work on any block if that block is touching a grass block.

/give @p bucket{CanPlaceOn:["minecraft:water"]}

This will work on any block if that block is touching a water block.

I'd recommend renaming the bug title to include this information

Confirmed for 18w43c.

Confirmed for 18w44a

Damn, nobody's looked at this for 7 months?

Confirmed for 1.14.

Confirmed for 1.14.2 and 1.14.3 pre-2

Bug still present in 1.14.4 pre-7

Christie N

coschevi

Confirmed

(Unassigned)

Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 18w43b, Minecraft 18w43c, 1.14.4 Pre-Release 7, 1.14.4

19w37a

Retrieved