mojira.dev
MC-117588

Functions Are Run by Executor, Not By Target of Execute

Summary:
When /execute is used to make an entity run a function, the function is instead run by the source of the /execute command.

Expected outcome:
When /execute is used to make an entity run a function, the function is run by the targeted entity.

Steps to reproduce:
1. Create a function.
2. Run that function as yourself. Note that you run the function.
3. Execute that function to be run by another entity. Note that the entity does not know that it is running the function, as evidenced by @s not working. Instead, the function thinks it is being run by you, because you ran the execute command.

Attached images of this being demonstrated with a Hi function that runs the following command:
say I am @s Hi!

(Note: In Minecraft 1.12 Pre-Release 1 and 1.12 Pre-Release 2, this worked correctly, so that the function would run from the entity targeted by /execute. See attached images.)

This bug greatly reduces the uses of the @s selector. In 1.12 Pre-Release 1 and 1.12 Pre-Release 2, we were able to run the gameLoopFunction to target entities and tell them to run functions. This was great, because it allowed functions to run in an object-oriented fashion, so that commands were executed from their @s source. This bug breaks that feature.

Hoping this can be fixed!

Linked issues

Attachments

Comments 2

Thank you for your report!
However, this issue has been closed as a Duplicate of MC-117562.

It has been linked to this report. If you have additional information, please add it to that report.
Please search before reporting, as it's likely that one exists already.

Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – 📖 Game Wiki

Thanks! Sorry, I performed a search, but for some reason couldn't find the matching bug report.

Tyruswoo

(Unassigned)

Unconfirmed

Minecraft 1.12 Pre-Release 3

Retrieved