HypermodeHippie

Minecraft - Redstone Blocks in /fill Commands

Mar 8th, 2014
1,377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. When filling an area with redstone blocks (using /fill commands) to run multiple command blocks at the same time, the game determines the order to process them like so:
  2.  
  3. It starts at the lowest X and Y and Z value block, processes commands across the positive X direction, then moves to the next row by +1 Z.
  4.  
  5. After processing all commands at a particular Y, if there are still command blocks being powered in the same tick, it will move up by +1 Y and run the commands on that horizontal slice.
  6.  
  7. Why is the order important?
  8.  
  9. First, allow me to describe how to create the fastest clock, a redstone block clock (RBC):
  10.  
  11. One command block (CB) has this command:
  12. /fill ~ ~-1 ~ ~9 ~-1 ~2 redstone_block
  13. Another CB 2 blocks below the first has this command:
  14. /fill ~ ~1 ~ ~9 ~1 ~2 stone
  15.  
  16. So the game places stone in the area then fills it with redstone blocks, all in a 10x1x2 area between the CBs, creating a clock that cycles every game tick, or 20 times a second. (Keep in mind these will not "flicker"; they will appear to be only look like redstone blocks, since that's what it looks like at the end of processing within the game tick.)
  17.  
  18. In the area 1 block above and 1 block below this area of cycling blocks, you can place CBs to do whatever task you want them to 20 times a second.
  19.  
  20. Here's where order becomes important.
  21.  
  22. EXAMPLE
  23. ---------------------------
  24.  
  25. Let's say you have a scoreboard objective looking for a player with an OnlySword score of 1.
  26.  
  27. This example objective is triggered when a person has TNT in their inventory. It would remove everything from their inventory and give them a wooden sword.
  28. These commands would need to be played in order, or else it would not work.
  29.  
  30. First, a CB sets all players who have TNT in their inventory to an OnlySword score of 1:
  31. /scoreboard players set @a OnlySword 1 {Inventory:[{id:"minecraft:tnt"}]}
  32.  
  33. Next, these commands are triggered in order:
  34. /clear @a[score_OnlySword_min=1]
  35. /give @a[score_OnlySword_min=1] wooden_sword
  36. /scoreboard players set @a[score_OnlySword_min=1] OnlySword 0
  37.  
  38. NOTE: There is a small display glitch where the TNT will still appear to be in the inventory, but when you try to place it, it will instantly disappear.
  39.  
  40. END OF EXAMPLE
  41. ---------------------------
  42.  
  43. Hopefully this is useful.
Advertisement
Add Comment
Please, Sign In to add comment