Closed James103 closed 4 years ago
That probably spoiled the fun of the new run command output for you. Should be easy to fix.
@gnembon Just out of my curiosity: Why are most (if not all) of your commits have their commit date set to 3 hours later than when you actually pushed the commit? I presume it's because you are using the wrong time zone on your local machine / Git client.
As of Carpet Mod 1.4.11 for Minecraft 1.16.3, any attempt to execute a
run('...')
function will outputA player is required to run this command here
to stderr and return the following:[null, [], A player is required to run this command here]
. The same is true regardless of which command is put into the run function.Why is it that attempting to run commands from the
__on_tick()
function in any given app always fails and outputsA player is required to run this command here
to stderr, even though the same commands outside that event context runs normally? It all still worked normally when I was on Minecraft 1.16.1 with Carpet mod 1.4.0.There are a couple of workarounds:
__on_statistic
event to run the commands (such as bossbar updates).My testing steps:
/bossbar add test:a
from chat.a.sc
with the following, and put it in thescripts
folder of the world you are reproducing this on./script load a global
from chat./script run __on_player_jumps(p) -> (x = run('give @p stone'); print(x))
from chat.b.sc
with the following, and put it in thescripts
folder of the world you are reproducing this on./script load b
from chat (without the global)./tp @p ~ ~4 ~
from chat./script load b global
from chat./tp @p ~ ~4 ~
from chat.Output from reproduction steps
The output from step 4 looks like this: ``` [16:31:42] [Server thread/INFO]: 1 [16:31:42] [Server thread/INFO]: [null, [], A player is required to run this command here] [16:31:42] [main/INFO]: [CHAT] [Server: 1] [16:31:42] [main/INFO]: [CHAT] [Server: [null, [], A player is required to run this command here]] [16:31:43] [Server thread/INFO]: 1 [16:31:43] [Server thread/INFO]: [null, [], A player is required to run this command here] [16:31:43] [main/INFO]: [CHAT] [Server: 1] [16:31:43] [main/INFO]: [CHAT] [Server: [null, [], A player is required to run this command here]] [16:31:44] [Server thread/INFO]: 2 [16:31:44] [Server thread/INFO]: [null, [], A player is required to run this command here] [16:31:44] [main/INFO]: [CHAT] [Server: 2] [16:31:44] [main/INFO]: [CHAT] [Server: [null, [], A player is required to run this command here]] [16:31:45] [Server thread/INFO]: 1 [16:31:45] [Server thread/INFO]: [null, [], A player is required to run this command here] [16:31:45] [main/INFO]: [CHAT] [Server: 1] [16:31:45] [main/INFO]: [CHAT] [Server: [null, [], A player is required to run this command here]] [16:31:46] [Server thread/INFO]: 1 [16:31:46] [Server thread/INFO]: [null, [], A player is required to run this command here] [16:31:46] [main/INFO]: [CHAT] [Server: 1] [16:31:46] [main/INFO]: [CHAT] [Server: [null, [], A player is required to run this command here]] ``` The output from step 7 looks like this: ``` [16:31:58] [main/INFO]: [CHAT] [1, [Gave 1 [Stone] to Player], null] [16:31:58] [main/INFO]: [CHAT] [1, [Gave 1 [Stone] to Player], null] [16:31:59] [main/INFO]: [CHAT] [1, [Gave 1 [Stone] to Player], null] [16:32:00] [main/INFO]: [CHAT] [1, [Gave 1 [Stone] to Player], null] ``` The output from step 12 looks like this: ``` [16:39:16] [main/INFO]: [CHAT] Teleported James3221 to -167.32679981930409, 67.0, 218.30087855250957 [16:39:17] [main/INFO]: [CHAT] 2 [16:39:17] [main/INFO]: [CHAT] [1, [Gave 1 [Dirt] to James3221], null] [16:39:17] [Server thread/INFO]: [James3221: Teleported James3221 to -167.32679981930409, 67.0, 218.30087855250957] [16:39:17] [main/INFO]: [CHAT] Teleported James3221 to -167.32679981930409, 67.0, 218.30087855250957 [16:39:17] [main/INFO]: [CHAT] 1 [16:39:17] [main/INFO]: [CHAT] [1, [Gave 1 [Stone] to James3221], null] [16:39:17] [Server thread/INFO]: [James3221: Teleported James3221 to -167.32679981930409, 67.0, 218.30087855250957] [16:39:17] [main/INFO]: [CHAT] Teleported James3221 to -167.32679981930409, 67.0, 218.30087855250957 [16:39:18] [main/INFO]: [CHAT] 2 [16:39:18] [main/INFO]: [CHAT] [1, [Gave 1 [Dirt] to James3221], null] [16:39:18] [Server thread/INFO]: [James3221: Teleported James3221 to -167.32679981930409, 67.0, 218.30087855250957] [16:39:18] [main/INFO]: [CHAT] Teleported James3221 to -167.32679981930409, 67.0, 218.30087855250957 [16:39:19] [main/INFO]: [CHAT] 1 [16:39:19] [main/INFO]: [CHAT] [1, [Gave 1 [Stone] to James3221], null] [16:39:19] [Server thread/INFO]: [James3221: Teleported James3221 to -167.32679981930409, 67.0, 218.30087855250957] [16:39:19] [main/INFO]: [CHAT] Teleported James3221 to -167.32679981930409, 67.0, 218.30087855250957 [16:39:19] [main/INFO]: [CHAT] 2 [16:39:19] [main/INFO]: [CHAT] [1, [Gave 1 [Dirt] to James3221], null] ``` Full modlist: * carpet-extra-1.16.3-1.4.11 * clientcommands-2.4.7 * fabric-api-0.21.0+build.407-1.16 * fabric-carpet-1.16.3-1.4.11+v200910 * litematica-fabric-1.16.3-0.0.0-dev.20200913.215807 * lithium-fabric-mc1.16.3-0.5.5 * malilib-fabric-1.16.3-0.10.0-dev.21+arne.1 * NoFog-1.16.2b1-Fabric