-
Bug
-
Resolution: Unresolved
-
None
-
Minecraft 14w30b, Minecraft 14w30c, 1.16.5, 21w08b, 21w10a, 21w17a, 21w20a, 1.17 Release Candidate 2, 1.17, 1.17.1, 1.18.1, 22w05a, 22w06a, 1.18.2 Release Candidate 1, 1.18.2, 1.19, 1.19.1, 1.19.2, 22w43a, 1.19.3, 23w03a, 1.19.4, 1.20, 1.20.1, 24w11a, 1.21, 1.21.1, 1.21.2 Pre-Release 3, 1.21.3
-
Confirmed
-
Block states
-
Low
-
Platform
The Bug:
Blocks can be placed outside of the world border by placing them against other blocks within the world border.
Steps to Reproduce:
- Set the world border's center to your current position and to seven blocks wide by using the commands provided below
/worldborder center ~ ~
/worldborder set 7
- Place a fence directly adjacent to the edge of the world border.
- While looking at the side face of the fence that's facing the world border, attempt to place another fence.
- Take note as to whether or not blocks can be placed outside of the world border by placing them against other blocks within the world border.
Observed Behavior:
The fence is placed outside of the world border.
Expected Behavior:
Blocks would not be able to be placed outside of the world border at all, regardless of the block they are placed against.
Code Analysis:
Code analysis by TriWonder81 can be found below.
The following is based on a decompiled version of Minecraft 1.16.5 using MCP.
The problem is that the only check for not placing a block outside the border makes sure the position being targeted when the block is placed/an item is used is not outside the border, which doesn't prevent blocks from being placed when used on the side of other blocks that have hitboxes that don't extend to the border's side. At net.minecraft.item.BlockItem in the placeBlock method a check can be added to prevent the block being set if it is outside the world border. The check should be placed there in order to maintain other functionalities such as /setblock outside the border.