mojira.dev
MC-231642

Nested /execute command does not work properly

 

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 ~

 

Linked issues

Comments 3

it works as intended, Because the subcommands of /execute command are always executed sequentially one by one.

 

at @s is executed before all the tp commands' execution, so the meaning of "~" won't changed between each execution of tp.

You also interpreted the command after omitting "run execute". I already know why such results come out. What I want to say is that "run execute" should mean something.

The execute-execute command must behave the same as the execute-function-execute command.

Just like the execute-something command works the same as execute-function-something.

Thank you for your report!
We're tracking this issue in MC-125067, so this ticket is being resolved and linked as a duplicate.

If you would like to add a vote and any extra information to the main ticket it would be appreciated.

If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
-- I am a bot. This action was performed automatically! The ticket was resolved by one of our moderators, and I left this message to give more information to you.

Triton365

(Unassigned)

Unconfirmed

(Unassigned)

1.17.1

Retrieved