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

/execute if loaded does not guarantee entities are loaded


    • Icon: Bug Bug
    • Resolution: Fixed
    • 1.20 Pre-release 2
    • 1.19.4
    • None
    • Confirmed
    • Commands
    • Important
    • Platform

      The bug

      According to the changelog, the execute if loaded command "checks if the position given is fully loaded (in regard to both blocks and entities)". However in some cases entities have not finished loading.

      How to reproduce

      1. Create a new flat world
      2. Place a repeating command block at world spawn with the following command. Set it to always active.
        /execute if loaded 1000 0 0 unless entity @e[type=pig] run say Chunk is loaded but entity is not!
      3. Teleport to 1000 0 0 and summon a pig there
        /teleport @s 1000 0 0
        /summon pig 1000 0 0 {NoAI:1b}
      4. Leave and rejoin the world
      5. Teleport to the nether and a bit later teleport back
        Notice that in both cases for one tick the chunk was loaded but the pig wasn't. In more complex worlds with more entities this can take an unpredictable amount of ticks.

            slicedlime [Mojang] slicedlime
            Misoloo [Helper] Misode
            15 Vote for this issue
            11 Start watching this issue