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

execute store result ... run function inside of a function doesn't output correct result

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • None
    • Minecraft 1.13, Minecraft 18w31a, Minecraft 1.13.1-pre2, Minecraft 1.14.1 Pre-Release 1, 1.15.2, 20w08a, 1.16.3, 1.17.1, 1.18 Pre-release 1, 1.18.2, 1.19, 1.19.3, 1.19.4
    • None
    • Community Consensus
    • Commands, Data Packs
    • Low
    • Platform

      The bug

      Using execute store result to get the number of commands ran in a function always outputs 1 if ran inside of another function.

      Setup

      scoreboard objectives add my_objective dummy
      
      scoreboard objectives setdisplay sidebar my_objective
      

      Use attached datapack containing two functions:

      my_function.mcfunction

      say 1
      say 2
      say 3
      say 4
      say 5
      

      test.mcfunction

      execute store result score player my_objective run function store:my_function

      How to reproduce

      1. Run the following command in chat, notice score gets set to 1

      /function store:test

      2. Run this command in chat or in a command block, notice score gets set to the amount of commands ran

      /execute store result score player my_objective run function store:my_function

      Expected output

      I expected the execute store result to behave the same way inside of a function as it does in chat or in a command block.

      Actual output

      The store gets set to 1 if the execute store command is inside of a function regardless of the amount of commands ran.

        1. MC-135636.png
          56 kB
          MMK21

            Unassigned Unassigned
            Maxaxik M
            Votes:
            27 Vote for this issue
            Watchers:
            19 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: