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

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Duplicate
    • Affects Version/s: Minecraft 1.12 Pre-Release 3
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Windows 10 operating system
      Java Version 8 Update 131 (build 1.8.0_131-b11)
    • Confirmation Status:
      Unconfirmed

      Description

      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!

        Attachments

        1. 1.12pre1FunctionHi.PNG
          232 kB
          Tyruswoo
        2. 1.12pre2FunctionHi.PNG
          257 kB
          Tyruswoo
        3. 1.12pre3FunctionHi.PNG
          244 kB
          Tyruswoo
        4. 1.12pre3 mcfunction file and txt file for pre1 and pre2.PNG
          7 kB
          Tyruswoo
        5. 1.12pre3 within the functions folder I have a Tyruswoo folder.PNG
          4 kB
          Tyruswoo
        6. Hi function.PNG
          15 kB
          Tyruswoo

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: