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

Dragon egg can teleport outside the world

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reopened
    • Resolution: Unresolved
    • Affects Version/s: Minecraft 1.8.2-pre4, Minecraft 1.11.2, Minecraft 1.12 Pre-Release 5, 1.15.2, 20w06a, 20w07a, 20w48a, 20w51a, 21w03a, 1.16.5, 21w05b, 21w06a, 21w07a, 21w08b
    • Fix Version/s: None
    • Confirmation Status:
      Confirmed
    • Category:
      (Unassigned)

      Description

      The bug

      Right clicking a dragon egg near y = 0 or y = 255 can result in it being deleted.

      How to reproduce

      1. Create a Superflat world completely filled with a block
        3;256*minecraft:stone;127;
        
      2. Replace one block at y = 255 and place a dragon egg
      3. Right click the dragon egg

      Code analysis

      Based on 1.11.2 decompiled using MCP 9.35 rc1

      The method net.minecraft.block.BlockDragonEgg.teleport(World, BlockPos) does not test if the y-coordinate of the randomly chosen position is inside the valid building height range. Since the method World.getBlockState(BlockPos) returns for positions < 0 and >= 256 air the dragon egg tries to place itself there.

      Note: It would be great if the dragon egg would not try to teleport outside the worldborder or at least the 30,000,000 blocks area as well.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            KingSupernova KingSupernova
            Votes:
            5 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              CHK: