Mojira Archive
MC-117360

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

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

Works As Intended

Emlyn

[Mojang] Searge (Michael Stoyke)

2017-05-12, 05:41 AM

2020-01-06, 12:33 PM

2017-05-19, 11:21 AM

0

5

Confirmed

command_block, entity, function, gameLoopFunction

Minecraft 1.12 Pre-Release 1, Minecraft 1.12 Pre-Release 2

-