Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-63578

Blocks can be placed outside of the world border by placing them against other blocks within the world border

XMLWordPrintable

    • Icon: Bug 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
    • 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:

      1. 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
      2. Place a fence directly adjacent to the edge of the world border.
      3. While looking at the side face of the fence that's facing the world border, attempt to place another fence.
      4. 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.

        1. MojiraSBorder.mp4
          6.64 MB
        2. MC-63578.png
          MC-63578.png
          780 kB
        3. MC-63578.mp4
          5.16 MB
        4. 2014-07-24_12.51.48.png
          2014-07-24_12.51.48.png
          235 kB
        5. 2014-07-24_12.51.37.png
          2014-07-24_12.51.37.png
          312 kB
        6. 2014-07-24_12.30.46.png
          2014-07-24_12.30.46.png
          364 kB
        7. 2014-07-24_12.04.25.png
          2014-07-24_12.04.25.png
          279 kB
        8. 2014-07-24_12.04.15.png
          2014-07-24_12.04.15.png
          126 kB

            Unassigned Unassigned
            Avoma [Mod] Avoma
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              CHK: