Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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:
- 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.
- 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.
- Why is the order important?
- First, allow me to describe how to create the fastest clock, a redstone block clock (RBC):
- One command block (CB) has this command:
- /fill ~ ~-1 ~ ~9 ~-1 ~2 redstone_block
- Another CB 2 blocks below the first has this command:
- /fill ~ ~1 ~ ~9 ~1 ~2 stone
- 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.)
- 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.
- Here's where order becomes important.
- EXAMPLE
- ---------------------------
- Let's say you have a scoreboard objective looking for a player with an OnlySword score of 1.
- 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.
- These commands would need to be played in order, or else it would not work.
- First, a CB sets all players who have TNT in their inventory to an OnlySword score of 1:
- /scoreboard players set @a OnlySword 1 {Inventory:[{id:"minecraft:tnt"}]}
- Next, these commands are triggered in order:
- /clear @a[score_OnlySword_min=1]
- /give @a[score_OnlySword_min=1] wooden_sword
- /scoreboard players set @a[score_OnlySword_min=1] OnlySword 0
- 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.
- END OF EXAMPLE
- ---------------------------
- Hopefully this is useful.
Advertisement
Add Comment
Please, Sign In to add comment