-
Bug
-
Resolution: Unresolved
-
None
-
1.21.30.23 Preview, 1.21.21 Hotfix
-
None
-
Community Consensus
-
Multiple
Any failure in a branch breaks/jumps out of the whole /execute command with /loot.
When executing /loot with multiple branches, it jumps out the whole /execute command when any branch fails.
This bug happens only with loot command (/execute ... run loot ...). Other commands work correctly.
Steps to reproduce:
- Summon some pigs in the world.
- Execute the following three commands in chat.
- /execute as @e[type=pig] run loot give @a kill @s
- Gives items to the player.
- Gives items to the player.
- /execute as @e if entity @s[type=pig] run loot give @a kill @s
- "@e" selects the player (the nearest entity) first, so the first branch is faild.(Message: Execute subcommand if entity test failed)
- Then "@e" selects a pig, so the second branch should be successful. However, it fails.
- The subsequent branches are ALL failed, as if /execute was jumped out by the first branch.
- "@e" selects the player (the nearest entity) first, so the first branch is faild.(Message: Execute subcommand if entity test failed)
- /execute as @e run loot give @a kill @s[type=pig]
- "@e" selects the player (the nearest entity) first, so the first branch is faild.(Message: No targets matched selector)
- Then "@e" selects a pig, so the second branch should be successful. However, it fails.
- The subsequent branches are ALL failed, as if /execute was jumped out by the first branch.
- "@e" selects the player (the nearest entity) first, so the first branch is faild.(Message: No targets matched selector)
- /execute as @e[type=pig] run loot give @a kill @s
Expected behaviors:
All of the three commands above should give items to the player, since there are pigs in the world.