mojira.dev
MC-110636

setblock uses incorrect data value for piston_extension

When using the command /setblock ~ ~ ~ piston_extension the invisible block that is created has a data value of 2. Usually the data value defaults to 0, this is for instance the case with air and stone.

Steps to Reproduce:

  1. Execute /setblock ~ ~ ~ piston_extension

  2. Execute /testforblock ~ ~ ~ piston_extension 0

What I expected to happen was...:
The block should have a data value of 0 and the testforblock command should be successful.

What actually happened was...:
The block had a data value of 2 and the testforblock command failed with the message:

The block at -1500, 57, -407 had the data value of 2 (expected: 0)

Workaround

  1. Use /setblock ~ ~ ~ piston_extension 0 to create the block

  2. Use /testforblock ~ ~ ~ piston_extension -1 to detect the block

Comments 4

piston_extension is a technical block and is not intended to be used in game.

Also you should start using blockstates intead, so it won't matter anyway.

Since I can't find information on it, how would I for instance place a granite using block states? This does not work: /setblock ~ ~ ~ minecraft:stone variant:granite

Ah ok I found it, it is: /setblock ~ ~ ~ minecraft:stone variant=granite

Adrodoc55

(Unassigned)

Unconfirmed

Minecraft 1.11

Retrieved