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
/setblock ~ 256 ~ stone/setblock ~ 257 ~ stoneCompare 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
relates to 1
Comments 6
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.
Relates to MC-122828
Confirmed for
16w20a
Applies to all block position related commands, for example
/fill,/setblock...