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

functions triggered by "load" function tag can't found any entities while the world is starting

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 1.17.1
    • None
    • Unconfirmed
    • (Unassigned)

      The bug

      While the world is starting, functions that are triggered by #load can't find any entities by using the target selector, this didn't happen in Minecraft 1.16.5.

      How to reproduce

      1. Create a world without any other entities (because the function will print all entities' names).
      2. Install the data pack attached to this report.
      3. Run the following command to summon an armor stand tagged as "bug_reproduce.dummy" at your location:
        /summon minecraft:armor_stand ~ ~ ~ {Tags:["bug_reproduce.dummy"]}
        
      4. Reload data pack(s)
        /reload

        →  The tagged armor stand has been killed, and the server print all entities' names.

        [14:02:27] [Server thread/INFO]: [Server] [bug_reproduce] start
        [14:02:27] [Server thread/INFO]: [Server] Found: bill96012, Armor Stand <end>
        [14:02:27] [Server thread/INFO]: [Server] killed bug_reproduce.dummy
        [14:02:27] [Server thread/INFO]: [Server] [bug_reproduce] end
        
      5. Summon tagged armor stand again(step 3), then quit to title.
      6. Re-enter the world.
        →  The tagged armor stand is still alive, and the server didn't find any entities to print.
        [14:02:33] [Server thread/INFO]: [Server] [bug_reproduce] start
        [14:02:33] [Server thread/INFO]: [Server] Found: <end>
        [14:02:33] [Server thread/INFO]: [Server] [bug_reproduce] end
        

        →  In Minecraft 1.16.5, it works as step 4 does.

      Data pack

      #minecraft:load

      load.json
      {
          "values":[
              "bug_reproduce:test1"
          ]
      }
      

      bug_reproduce:test1

      test1.mcfunction
      say [bug_reproduce] start
      
      scoreboard objectives add test dummy
      
      say Found: @e <end>
      
      execute store result score #killed_dummy test run kill @e[tag=bug_reproduce.dummy]
      execute if score #killed_dummy test matches 1.. run say killed bug_reproduce.dummy
      
      say [bug_reproduce] end
      

            Unassigned Unassigned
            bill96012 william bill
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: