Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-264626

Execute unless function ignores non-zero return value in function

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Awaiting Response
    • None
    • 23w31a
    • None
    • Ubuntu 22.04, kernel: 6.4.3-060403-generic, openjdk 17.0.8
    • Unconfirmed
    • (Unassigned)

      When running a command like

      execute unless function skills:chances/1in3 run scoreboard players add @s skill_carpentry 1

      from inside a function the return value of the tested function is not checked. The command will be executed whether it is 0 or not. Only success is used.
      The called function (skills:chances/1in3) is:

      return run random roll 0..2
      

      When this command is run in chat, it works as expected and the command is only run if the returned value is 0.

            Unassigned Unassigned
            douplofigure David Schulte
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: