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

Executing a function as an entity doesn't use new sender

XMLWordPrintable

    • Confirmed

      Add a function with a command such as setblock ~ ~2 ~ stone or say @s.

      In the world place a command block and run the function as a player (or other entity):
      /execute @p ~ ~ ~ function foo:bar

      The expected behaviour is that a stone block is placed above the nearest player, however, it is placed at the command block instead. As well, using @s in the function does nothing, as the command block is the sender.

      Affects similar commands in other contexts as well.

        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. 1.12pre4FunctionHi.PNG
          242 kB
          Tyruswoo
        7. Hi function.PNG
          15 kB
          Tyruswoo

            dinnerbone [Mojang] Nathan Adams
            Misterx7772 Misterx7772
            Votes:
            27 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: