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

Functions Are Run by Executor, Not By Target of Execute

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • Minecraft 1.12 Pre-Release 3
    • None
    • Windows 10 operating system
      Java Version 8 Update 131 (build 1.8.0_131-b11)
    • Unconfirmed

      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!

            Unassigned Unassigned
            Tyruswoo Tyruswoo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: