mojira.dev
MC-91459

/setblock at Y=256 shows unique message compared to using other outside-world setblock commands / Using /setblock at Y>256 says max building height is 256

The bug

Using the /setblock command at exactly Y=256 is the only command that shows the message "The block couldn't be placed". Using /setblock at all other Y-coordinates that are outside of the building range of the world shows the message "The number you have entered (Y) is too (big/small), it must be at (most/least) 256". This message also states that the max height for building is 256, which is false.

To reproduce

  1. /setblock ~ 256 ~ stone
  2. /setblock ~ 257 ~ stone
  3. Compare the messages gotten from performing previous steps

Code analysis

By @unknown

The following is based on a decompiled version of Minecraft 1.9 using MCP 9.24 beta.

The reason for this is that the method net.minecraft.command.CommandBase.parseBlockPos(ICommandSender, String[], int, boolean) defines 256 as maximum y value.

Suggested fix

Making so attempting to place a block by not using /setblock at Y=256 shows the text "The block couldn't be placed", or more fitting, "You can't build this high" over the hotbar, just like when trying to sleep at day. Using /setblock at Y=256 should show the message "The number you have entered (256.00) is too big, it must be at most 255".

Linked issues

Comments 6

Confirmed for

  • 16w20a

Applies to all block position related commands, for example /fill, /setblock...

Please link to this comment in the description

The following is based on a decompiled version of Minecraft 1.9 using MCP 9.24 beta.

The reason for this is that the method net.minecraft.command.CommandBase.parseBlockPos(ICommandSender, String[], int, boolean) defines 256 as maximum y value.

Can confirm for MC 1.12.1.

This has been fixed in 1.13.1 due the change of the messages itself.

It actually was fixed in 1.13 the message now says "That position is out of the world!".

Swekob

(Unassigned)

Confirmed

/setblock, chat, command, message, messages, output, outside-world, setblock, y-coordinate

Minecraft 1.8.8, Minecraft 15w43c, Minecraft 15w44a, Minecraft 15w44b, Minecraft 15w45a, ..., Minecraft 1.11.2, Minecraft 17w14a, Minecraft 17w16b, Minecraft 1.12, Minecraft 1.12.1

Minecraft 17w45a

Retrieved