mojira.dev
MC-279191

Running '/debug function' from inside a function run with the '/function' command causes an error

Using /function to run a function containing a debug function command causes an error.
It is worth noting that using /debug function to run the function instead correctly causes the command to fail with the message "Can't trace from inside of function" instead of throwing an error.

How to reproduce:

The /debug command requires a permission level of 3, and since functions normally run on a permission level of 2, we need to use a dedicated server, since it allows for changing the permission level functions run on. The attached data pack (

[media]

) contains a function with a simple say command, and another that runs debug function on the first function.

  1. On a dedicated server setup, open the server.properties file, change the value of the property function-permission-level to 3 and save the file.

  2. Install the attached data pack.

  3. Start the server and join it.

  4. Make sure that you are an operator with a permission level of at least 3.

  5. Execute the following command:

    /function mc-279191:debug_function

Expected result:

Running /debug function from inside a function run with the /function command would cause it to fail with the message "Can't trace from inside of function."

Observed result:

Running /debug function from inside a function run with the /function command causes it to throw an error and print the message "An unexpected error occurred trying to execute that command" to the chat, with the following hover event:

Cannot invoke "net.minecraft.server.MinecraftServer.aE()" because the return value of "ex.l()" is null

Attachments

Comments 1

[Mod] ManosSef

(Unassigned)

Community Consensus

Platform

Low

Commands, Debug

1.21.4

Retrieved