Advertisement
Skylinerw

@lemoesh @slicedlime

Sep 17th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. For the following command, even though the end-result is a score of always 1 (the /scoreboard command is executed twice per player), the number of commands processed is great. Obviously it's not something you'd want to do, but I have seen some folks use this:
  2.  
  3. /execute @a ~ ~ ~ execute @a ~ ~ ~ scoreboard players set @a[c=1] OBJ 1
  4.  
  5. For example, there are 2 players online: the first /execute must be processed 2 times (once per player), the second /execute is processed 2 times PER /execute command run (2 players found, 2 initial /executes, 4 times total), and /scoreboard is processed 1 time (since only 1 target) PER /execute run (4 times total). The result is 10 commands processed for 2 players being online.
  6.  
  7. Another situation, where /execute is used unnecessarily (I see this particular case much more often):
  8.  
  9. /execute @a[score_OBJ_min=1] ~ ~ ~ scoreboard players set @a[c=1] OBJ 0
  10.  
  11. Two commands must be processed every time this is run: /execute and /scoreboard. Only one command is needed instead to process it once per player instead of twice:
  12.  
  13. /scoreboard players set @a[score_OBJ_min=1] OBJ 1
  14.  
  15. Of course, these sort of things won't be a problem if you know you'll only be targeting single, specific entities (the following has 3 possible commands processed per target found in the initial /execute):
  16.  
  17. /execute @e[type=Item,tag=iron] ~ ~ ~ execute @e[type=Item,tag=stone,r=3,c=1] ~ ~ ~ summon Creeper
  18.  
  19. However, one must consider the new command sender. For example, while the intention for some "custom crafting" methods is to have all items in one location, you can instead lead the items away since the command sender is being changed:
  20.  
  21. /execute @e[type=Item,tag=iron] ~ ~ ~ execute @e[type=Item,tag=stone,r=3,c=1] ~ ~ ~ execute @e[type=Item,tag=stick,r=3,c=1] ~ ~ ~ summon Creeper
  22.  
  23. See this image for an example of the issue: http://i.imgur.com/qkZLwKu.png
  24.  
  25. The stick is quite far from the iron, but because of the command sender chain, it ends up being found and the creeper is summoned at its location. This isn't really important though for custom crafting, but it's just an example.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement