Mojira Archive
MC-267194

/return run function in combination with a fork and a function that doesn't return has inconsistent behavior

The /return run when applied to a fork and a /function that doesn't return causes different behavior depending whether it is run in chat, inside of a function or using /debug function.

How to reproduce:
The attached data pack contains a function called bugtest:test with the following command:

execute as @e[tag=selected] run return run function bugtest:test2

The function bugtest:test2 is a small function that just contains the command "say Test" and doesn't return.

Now spawn multiple entities with the tag "selected", e.g. using the following command:

summon armor_stand ~ ~ ~ {Tags:["selected"]}

Then run the following commands:

  1. The command above directly in chat (the one with /return run)
  2. /function bugtest:test
  3. /debug function bugtest:test

Observed behavior:
1. and 3. The message "Test" appears for every entity spawned.
2. The message "Test" appears once and the function returns.

Expected behavior:
In all of the cases the message should only be shown once and return since /return run is supposed to always return.

Fixed

Rob23

2023-12-06, 04:18 PM

2023-12-14, 01:45 PM

2023-12-13, 08:22 AM

2

3

Community Consensus

Normal

Platform

Commands, Data Packs

1.20.4 Release Candidate 1, 1.20.4

23w51a