Mojira Archive
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 Marcono1234

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".