mojira.dev
MC-264092

Functions execute commands out of order when containing /say

When running a function that contains /say commands, the order of execution is incorrect - specifically, commands involving /say 

 

To reproduce:

Start a new world, with a datapack that contains this function:

 

say a
tellraw @s "a"
say b
tellraw @s "b"
say c
tellraw @s "c"

Run this function, you will get these results:

a
b
c
Executed 6 command(s) from function 'foo:bar'
[Player] a
[Player] b
[Player] c

You would expect to get:

[Player] a
a
[Player] b
b
[Player] c
c
Executed 6 command(s) from function 'foo:bar'

 

Attachments

Comments 3

Just for reference, an impractical workaround is to use /reload to block the server and force it to process the pending tasks.

When you run the following function:

say a
reload
say b

You will likely get the following output:

[Player] a
Executed 3 command(s) from function 'foo:bar'
[Player] b

Seems to still be a thing in 23w32a, despite being marked as fixed.

ThePyroGuy_

gegy

Confirmed

Platform

Normal

Commands

command, execution, function

1.20.1, 23w32a

23w32a, 23w35a

Retrieved