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 (
) contains a function with a simple say
command, and another that runs debug function
on the first function.
On a dedicated server setup, open the
server.properties
file, change the value of the propertyfunction-permission-level
to 3 and save the file.Install the attached data pack.
Start the server and join it.
Make sure that you are an operator with a permission level of at least 3.
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
Can confirm.