Advertisement
tintin10

Making command blocks loop

Apr 26th, 2017
442
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 2.83 KB | None | 0 0
  1. //adds the UpdateLastExecution:0b and TrackOutput nbt tag to commandblocks to make a loop happen, by tintin10 aka makkie_master aka Quinten Cabo has to be run in cmd combiner pro
  2.  
  3. //Paste this in to https://mrgarretto.com/cmdcombinerpro/ and hit the generate button
  4.  
  5. //area
  6. $x = 5
  7. $y = 2
  8. $z = 5
  9.  
  10. /kill @e[tag=lag_prevention]
  11. /kill @e[tag=update_ex]
  12. /setblock ~19 ~-3 ~ minecraft:chain_command_block facing=south replace
  13. /fill ~19 ~-3 ~1 ~4 ~-3 ~1 minecraft:chain_command_block facing=west replace
  14. /setblock ~3 ~-3 ~1 minecraft:chain_command_block facing=north replace
  15. /scoreboard players tag @a[r=20] add givetrigger
  16. /scoreboard players tag @a[r=20,tag=givetrigger] remove givetrigger {Inventory:[{tag:{display:{Lore:["sq"]}}}]}
  17. /give @a[tag=givetrigger] minecraft:armor_stand 1 0 {Invisible:1,display:{Lore:["Made by tintin10 aka makkie_master aka Quinten Cabo","sq"],Name:"Place me down to update a $x by $y by $z square"},EntityTag:{Tags:["update_ex"]}}
  18. /scoreboard players tag @a[tag=givetrigger] remove givetrigger
  19. //lag prevention patch
  20. /summon area_effect_cloud ~2 ~-3 ~ {Tags:["lag_prevention"],Particle:mobSpell,Duration:100000000}
  21. /setblock ~2 ~-3 ~1 minecraft:repeating_command_block facing=up replace {TrackOutput:0b,auto:1b,Command:/blockdata ~ ~ ~-1 {auto:0b}}
  22. /setblock ~2 ~-2 ~1 minecraft:chain_command_block facing=up replace {TrackOutput:0b,auto:1b,Command:/execute @e[tag=update_ex] ~ ~ ~ /execute @e[tag=lag_prevention] ~ ~ ~ /blockdata ~ ~ ~ {auto:1b}}
  23. /setblock ~2 ~-1 ~1 minecraft:chain_command_block facing=up replace {TrackOutput:0b,auto:1b,Command:/blockdata ~ ~ ~ {UpdateLastExecution:1b}}
  24.  
  25. /scoreboard objectives add x dummy
  26. /scoreboard objectives add y dummy
  27. /scoreboard objectives add z dummy
  28.  
  29. repeat main{
  30. /blockdata ~ ~ ~ {TrackOutput:0b}
  31. /scoreboard players add @e[tag=update_ex] x 0
  32. /scoreboard players add @e[tag=update_ex] y 0
  33. /scoreboard players add @e[tag=update_ex] z 0
  34. /execute @e[tag=update_ex] ~ ~ ~ /blockdata ~ ~ ~ {UpdateLastExecution:0b,TrackOutput:0b}
  35. /execute @e[tag=update_ex] ~ ~ ~ /particle angryVillager ~ ~ ~ 1 1 1 1
  36. /tp @e[tag=update_ex,score_x=$x] ~1 ~ ~
  37. /scoreboard players add @e[tag=update_ex] x 1
  38. /tp @e[tag=update_ex,score_x_min=$x] ~-$x ~ ~1
  39. /scoreboard players add @e[tag=update_ex,score_x_min=$x] z 1
  40. /scoreboard players set @e[tag=update_ex,score_x_min=$x] x 0
  41. /tp @e[tag=update_ex,score_z_min=$z] ~ ~1 ~-$z
  42. /scoreboard players add @e[tag=update_ex,score_z_min=$z] y 1
  43. /scoreboard players set @e[tag=update_ex,score_z_min=$z] z 0
  44. /execute @e[tag=update_ex,score_y_min=$y] ~ ~ ~ /tellraw @a ["",{"text":"$x by $y by $z box updated!","color":"dark_green"}]
  45. /execute @e[tag=update_ex,score_y_min=$y] ~ ~ ~ /playsound minecraft:block.anvil.use master @a ~ ~ ~ 1000000 2
  46. /kill @e[tag=update_ex,score_y_min=$y]
  47. }
  48.  
  49.  
  50. /summon falling_block ~ ~10 ~ {Block:command_block,Data:1,Time:1,DropItem:0}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement