mojira.dev
MC-124446

No warning message when function is terminated because of maxCommandChainLength gamerule

The bug

When a function is terminated because the maxCommandChainLength gamerule value is reached no warning is printed to the log. For command blocks a warning is printed.

An error message is needed since terminating a function during its execution will likely cause undefined behavior.

How to reproduce

  1. Download the attached file

[media]
  1. and place it in the datapacks folder of your world

  2. Make sure the value for maxCommandChainLength is at least 2

    /gamerule maxCommandChainLength 2
  3. Use the following command to verify that the function is working

    /function custom:test

    → ✔ It runs two commands

  4. Set the value for maxCommandChainLength to 1

    /gamerule maxCommandChainLength 2
  5. Run the function again

    /function custom:test

    → ✔ It runs one command

  6. Look at the log
    → ❌ No warning was logged

Attachments

Comments 3

Is this an issue on 1.12.2?

As we suppress all error messages inside functions, this message would itself be suppressed. It would be inconsistent not to.

This error is 'fatal' to command logic and should be treated specially; silently continuing from a broken program state with no hope of debuggability is a poor choice. This is a foolish "consistency".

marcono1234

Nathan Adams

Unconfirmed

functions, maxCommandChainLength

Minecraft 18w03b

Retrieved