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

gameLoopFunction function runs after entities were updated while command blocks run before

XMLWordPrintable

    • Confirmed

      The bug

      The gameLoopFunction function runs after entities were updated while command blocks run before entities are updated. This makes it difficult to convert command block commands to function commands and vice versa.

      How to reproduce

      1. Place a repeating command block with the following command
        /scoreboard players tag @e add hurt {HurtTime:10s}
        
      2. Place two always active chain command blocks with the following commands behind it
        /say @e[tag=hurt]
        /scoreboard players tag @e[tag=hurt] remove hurt
        
      3. Power the repeating command block and hit a mob
        → The command block says the name of the mob you hit
      4. Place the attached function hurt_test.txt in the following directory of your world folder
        data/functions/custom
        
      5. Set the function custom:hurt_test as gameLoopFunction
        /gamerule gameLoopFunction custom:hurt_test
        
      6. Hit a mob
        → The function does not say the name of the mob; changing the NBT test to HurtTime:9s solves this

            searge [Mojang] Searge (Michael Stoyke)
            emes4 Emlyn
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: