tintin10

square generator minecraft

Apr 24th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 3.27 KB | None | 0 0
  1. //generates square by makkie_master
  2.  
  3. //You have to use command combiner pro for this to work
  4. //block = what kind of block you want "wool" would make it white wool "wool 4" will make it yellow wool
  5. //limit = How many steps an armorstand is going to make. How far it is going to go.
  6. //detectblock = trigger block. You have to put the armorstand on top of this block to trigger the square
  7. //radius = How big is one step
  8.  
  9. //formula for how to calculate square size is: $limit*2*$radius
  10. //the formula above only applies when $radius < $limit
  11. $block = "bone_block"
  12. $radius = 1
  13. $limit = 40
  14. $detectblock = "diamond_block"
  15. $moving = $radius*2
  16. $result = $limit*2*$radius
  17.  
  18. /tellraw @a ["",{"text":"Make sure $limit is bigger than $radius\nIf this is true your square is $result by $result","color":"red"},{"text":"\nMade by Quinten Cabo","color":"green"}]
  19. //init + makes sure you only get one
  20. /scoreboard players tag @a[r=20] add givetrigger
  21. /clear @a[r=20,tag=givetrigger] armor_stand 0 1728 {display:{Lore:["sq"]}}
  22. /give @a[tag=givetrigger] minecraft:armor_stand 1 0 {display:{Lore:["Made by makkie_master","sq"],Name:"Place me on $detectblock to make a $result by $result square"},EntityTag:{CustomName:"Start",CustomNameVisible:1,Tags:["start_qc"]}}
  23. /scoreboard players tag @a[tag=givetrigger] remove givetrigger
  24. //add objective
  25. /scoreboard objectives remove counter
  26. /scoreboard objectives add counter dummy
  27.  
  28. repeat main{
  29. /execute @e[tag=start_qc] ~ ~ ~ detect ~ ~-1 ~ $detectblock 0 /entitydata @e[c=1] {Tags:["start_up"]}
  30. //summon them
  31. /execute @e[tag=start_up] ~ ~ ~ /summon armor_stand ~ ~ ~ {Tags:["posx","count_add","s"],NoGravity:1b}
  32. /execute @e[tag=start_up] ~ ~ ~ /summon armor_stand ~ ~ ~ {Tags:["posz","count_add","s"],NoGravity:1b}
  33. /execute @e[tag=start_up] ~ ~ ~ /summon armor_stand ~ ~ ~ {Tags:["negx","count_add","s"],NoGravity:1b}
  34. /execute @e[tag=start_up] ~ ~ ~ /summon armor_stand ~ ~ ~ {Tags:["negz","count_add","s"],NoGravity:1b}
  35. /kill @e[tag=start_qc]
  36. cond:/tellraw @a ["",{"text":"$detectblock not found!","color":"dark_red"}]
  37. /kill @e[tag=start_up]
  38.  
  39. //make the movers summon the fillers
  40. /execute @e[tag=posx] ~ ~ ~ /summon armor_stand ~ ~ ~ {Tags:["posx_fill","filler","count_add"],NoGravity:1b}
  41. /execute @e[tag=negx] ~ ~ ~ /summon armor_stand ~ ~ ~ {Tags:["negx_fill","filler","count_add"],NoGravity:1b}
  42. /execute @e[tag=posz] ~ ~ ~ /summon armor_stand ~ ~ ~ {Tags:["posz_fill","filler","count_add"],NoGravity:1b}
  43. /execute @e[tag=negz] ~ ~ ~ /summon armor_stand ~ ~ ~ {Tags:["negz_fill","filler","count_add"],NoGravity:1b}
  44.  
  45. //the action
  46. /execute @e[tag=filler] ~ ~ ~ /fill ~$radius ~-1 ~$radius ~-$radius ~-1 ~-$radius $block
  47.  
  48. //the movement
  49. /tp @e[tag=posx] ~$moving ~ ~
  50. /tp @e[tag=negx] ~-$moving ~ ~
  51. /tp @e[tag=posz] ~ ~ ~$moving
  52. /tp @e[tag=negz] ~ ~ ~-$moving
  53. /tp @e[tag=posx_fill] ~ ~ ~$moving
  54. /tp @e[tag=negx_fill] ~ ~ ~-$moving
  55. /tp @e[tag=posz_fill] ~-$moving ~ ~
  56. /tp @e[tag=negz_fill] ~$moving ~ ~
  57.  
  58. //adding score
  59. /scoreboard players add @e[tag=count_add] counter 1
  60.  
  61. //end when 10 is reached
  62. /kill @e[tag=filler,score_counter_min=$limit]
  63. /kill @e[tag=s,score_counter_min=$limit]
  64. cond:/tellraw @a ["",{"text":"$result by $result square generated!","color":"dark_green"}]
  65. }
  66.  
  67. /summon falling_block ~ ~10 ~ {Block:command_block,Data:0,Time:1,DropItem:0}
Add Comment
Please, Sign In to add comment