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

Nested /execute command does not work properly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 1.17.1
    • None
    • Unconfirmed
    • (Unassigned)

       

      Let's suppose there are at least five armor stands.

      /summon armor_stand ~ ~ ~
      /summon armor_stand ~ ~ ~
      /summon armor_stand ~ ~ ~
      /summon armor_stand ~ ~ ~
      /summon armor_stand ~ ~ ~
      

      What I want to do is repeat the command to tp the player up 1 block 5 times. So that we can move up a total of five blocks. ()

      /execute as @a at @s run tp @s ~ ~1 ~
      /execute as @a at @s run tp @s ~ ~1 ~
      /execute as @a at @s run tp @s ~ ~1 ~
      /execute as @a at @s run tp @s ~ ~1 ~
      /execute as @a at @s run tp @s ~ ~1 ~
      

      So I made 5 entities use that command each.

      /execute as @e[limit=5] run execute as @a at @s run tp @s ~ ~1 ~

      The command was executed five times as intended, but was not properly positioned and eventually moved up only one block. () I think it's probably because "run execute" is omitted automatically.
       
      This is inconsistent with the case of the function. If you make a function with a command "execute as @a at @s run tp @s ~ ~1 ~"

      # main command
      execute as @e[limit=5] run function test:test
      
      # test:test function
      execute as @a at @s run tp @s ~ ~1 ~

      The command moves the player up five blocks () and that's what I wanted.
       
       
      Anyway, the point is, there shouldn't be a difference between the two.

      /execute as @e[limit=5] run execute as @a at @s run tp @s ~ ~1 ~
      
      # main command
      execute as @e[limit=5] run function test:test
      
      # test:test function
      execute as @a at @s run tp @s ~ ~1 ~
      

       

            Unassigned Unassigned
            Triton365 Triton365
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: