# More Utilities in One Command
# By MrGarretto
INIT:/tellraw @a[r=300] {"color":"green","bold":true,"text":"More Utilites has been installed!"}
INIT:/tellraw @a[r=300] {"color":"red","text":"Command by MrGarretto"}
# Custom Crafting
INIT:/scoreboard objectives add MoUt_I dummy
/scoreboard players set @e[type=Item] MoUt_I 1 {Item:{id:"minecraft:stick"},OnGround:1b}
/scoreboard players set @e[type=Item] MoUt_I 2 {Item:{id:"minecraft:prismarine_crystals"},OnGround:1b}
/execute @e[score_MoUt_I_min=1,score_MoUt_I=1] ~ ~ ~ execute @e[r=1,score_MoUt_I_min=2,score_MoUt_I=2] ~ ~ ~ summon Item ~ ~ ~ {Item:{id:"minecraft:spawn_egg",Count:1,tag:{EntityTag:{id:CaveSpider},display:{Name:"Mob_Repellent"}}}}
/execute @e[score_MoUt_I_min=1,score_MoUt_I=1] ~ ~ ~ execute @e[r=1,score_MoUt_I_min=2,score_MoUt_I=2] ~ ~ ~ particle smoke ~ ~ ~ 0 0 0 0.2 100
/execute @e[score_MoUt_I_min=1,score_MoUt_I=1] ~ ~ ~ execute @e[r=1,score_MoUt_I_min=2,score_MoUt_I=2] ~ ~ ~ kill @e[type=Item,r=3,score_MoUt_I_min=1,score_MoUt_I=2]
/scoreboard players set @e[type=Item] MoUt_I 3 {Item:{id:"minecraft:gunpowder"},OnGround:1b}
/scoreboard players set @e[type=Item] MoUt_I 4 {Item:{id:"minecraft:iron_trapdoor"},OnGround:1b}
/execute @e[score_MoUt_I_min=3,score_MoUt_I=3] ~ ~ ~ execute @e[r=1,score_MoUt_I_min=4,score_MoUt_I=4] ~ ~ ~ summon Item ~ ~ ~ {Item:{id:"minecraft:spawn_egg",Count:1,tag:{EntityTag:{id:Silverfish},display:{Name:"Smoke_Detector"}}}}
/execute @e[score_MoUt_I_min=3,score_MoUt_I=3] ~ ~ ~ execute @e[r=1,score_MoUt_I_min=4,score_MoUt_I=4] ~ ~ ~ particle smoke ~ ~ ~ 0 0 0 0.2 100
/execute @e[score_MoUt_I_min=3,score_MoUt_I=3] ~ ~ ~ execute @e[r=1,score_MoUt_I_min=4,score_MoUt_I=4] ~ ~ ~ kill @e[type=Item,r=3,score_MoUt_I_min=3,score_MoUt_I=4]
/scoreboard players set @e[type=Item] MoUt_I 9 {Item:{id:"minecraft:iron_block"},OnGround:1b}
/scoreboard players set @e[type=Item] MoUt_I 10 {Item:{id:"minecraft:anvil"},OnGround:1b}
/execute @e[score_MoUt_I_min=9,score_MoUt_I=9] ~ ~ ~ execute @e[r=1,score_MoUt_I_min=10,score_MoUt_I=10] ~ ~ ~ summon Item ~ ~ ~ {Item:{id:"minecraft:spawn_egg",Count:1,tag:{EntityTag:{id:Squid},display:{Name:"Icebox"}}}}
/execute @e[score_MoUt_I_min=9,score_MoUt_I=9] ~ ~ ~ execute @e[r=1,score_MoUt_I_min=10,score_MoUt_I=10] ~ ~ ~ particle smoke ~ ~ ~ 0 0 0 0.2 100
/execute @e[score_MoUt_I_min=9,score_MoUt_I=9] ~ ~ ~ execute @e[r=1,score_MoUt_I_min=10,score_MoUt_I=10] ~ ~ ~ kill @e[type=Item,r=3,score_MoUt_I_min=9,score_MoUt_I=10]
/scoreboard players set @e[type=Item] MoUt_I 11 {Item:{id:"minecraft:stone_slab"},OnGround:1b}
/scoreboard players set @e[type=Item] MoUt_I 12 {Item:{id:"minecraft:comparator"},OnGround:1b}
/execute @e[score_MoUt_I_min=11,score_MoUt_I=11] ~ ~ ~ execute @e[r=1,score_MoUt_I_min=12,score_MoUt_I=12] ~ ~ ~ summon Item ~ ~ ~ {Item:{id:"minecraft:spawn_egg",Count:1,tag:{EntityTag:{id:Squid},display:{Name:"Motion_Detector"}}}}
/execute @e[score_MoUt_I_min=11,score_MoUt_I=11] ~ ~ ~ execute @e[r=1,score_MoUt_I_min=12,score_MoUt_I=12] ~ ~ ~ particle smoke ~ ~ ~ 0 0 0 0.2 100
/execute @e[score_MoUt_I_min=11,score_MoUt_I=11] ~ ~ ~ execute @e[r=1,score_MoUt_I_min=12,score_MoUt_I=12] ~ ~ ~ kill @e[type=Item,r=3,score_MoUt_I_min=11,score_MoUt_I=12]
# Mob repellent torches
INIT:/scoreboard objectives add MoUt_Rep dummy
/scoreboard players set @e[type=Item] MoUt_I 13 {Item:{id:"minecraft:redstone_torch"}}
/execute @e[type=CaveSpider,name=Mob_Repellent] ~ ~ ~ summon ArmorStand ~ ~ ~ {CustomName:"MoUtRep",Marker:1,Invisible:1,NoGravity:1}
/execute @e[type=CaveSpider,name=Mob_Repellent] ~ ~ ~ summon ArmorStand ~ ~-.65 ~ {Marker:1,CustomName:"MoUtRepRot",Invisible:1,NoGravity:1,Small:1,ArmorItems:[{},{},{},{id:stained_glass,Damage:15}]}
/tp @e[type=ArmorStand,name=MoUtRepRot] ~ ~ ~ ~6 ~
/execute @e[type=CaveSpider,name=Mob_Repellent] ~ ~ ~ setblock ~ ~ ~ redstone_torch 0 destroy
/tp @e[type=CaveSpider,name=Mob_Repellent] ~ ~-500 ~
/execute @e[type=ArmorStand,name=MoUtRep] ~ ~ ~ particle portal ~ ~ ~ 0 0 0 0.4 10
/execute @e[type=ArmorStand,name=MoUtRep] ~ ~ ~ detect ~ ~ ~ air 0 kill @e[type=Item,r=3,score_MoUt_I_min=13,score_MoUt_I=13]
/execute @e[type=ArmorStand,name=MoUtRep] ~ ~ ~ detect ~ ~ ~ air 0 summon Item ~ ~ ~ {Item:{id:"minecraft:spawn_egg",Count:1,tag:{EntityTag:{id:CaveSpider},display:{Name:"Mob_Repellent"}}}}
/execute @e[type=ArmorStand,name=MoUtRep] ~ ~ ~ detect ~ ~ ~ air 0 kill @e[type=ArmorStand,name=MoUtRepRot,r=1,c=1]
/execute @e[type=ArmorStand,name=MoUtRep] ~ ~ ~ detect ~ ~ ~ air 0 kill @e[type=ArmorStand,name=MoUtRep,r=1,c=1]
/scoreboard players set @e[type=!Player] MoUt_Rep 1
/scoreboard players reset @e[type=Item] MoUt_Rep
/scoreboard players reset @e[type=Painting] MoUt_Rep
/scoreboard players reset @e[type=ItemFrame] MoUt_Rep
/scoreboard players reset @e[type=ArmorStand] MoUt_Rep
INIT:/scoreboard objectives add MoUtMoTo dummy
INIT:/scoreboard objectives add MoUtMove dummy
/kill @e[type=ArmorStand,score_MoUtMoTo_min=1]
/execute @e[type=ArmorStand,name=MoUtRep] ~ ~ ~ summon ArmorStand ~0.3827 250 ~-0.9239 {Marker:1,Invisible:1,NoGravity:1,CustomName:"MoUtMoveTowards1",ActiveEffects:[{Id:5,Amplifier:3,Duration:1000}]}
/execute @e[type=ArmorStand,name=MoUtRep] ~ ~ ~ summon ArmorStand ~0.9239 250 ~-0.3827 {Marker:1,Invisible:1,NoGravity:1,CustomName:"MoUtMoveTowards2",ActiveEffects:[{Id:5,Amplifier:3,Duration:1000}]}
/execute @e[type=ArmorStand,name=MoUtRep] ~ ~ ~ summon ArmorStand ~0.9239 250 ~0.3827 {Marker:1,Invisible:1,NoGravity:1,CustomName:"MoUtMoveTowards3",ActiveEffects:[{Id:5,Amplifier:3,Duration:1000}]}
/execute @e[type=ArmorStand,name=MoUtRep] ~ ~ ~ summon ArmorStand ~0.3827 250 ~0.9239 {Marker:1,Invisible:1,NoGravity:1,CustomName:"MoUtMoveTowards4",ActiveEffects:[{Id:5,Amplifier:3,Duration:1000}]}
/execute @e[type=ArmorStand,name=MoUtRep] ~ ~ ~ summon ArmorStand ~-0.3827 250 ~0.9239 {Marker:1,Invisible:1,NoGravity:1,CustomName:"MoUtMoveTowards5",ActiveEffects:[{Id:5,Amplifier:3,Duration:1000}]}
/execute @e[type=ArmorStand,name=MoUtRep] ~ ~ ~ summon ArmorStand ~-0.9239 250 ~0.3827 {Marker:1,Invisible:1,NoGravity:1,CustomName:"MoUtMoveTowards6",ActiveEffects:[{Id:5,Amplifier:3,Duration:1000}]}
/execute @e[type=ArmorStand,name=MoUtRep] ~ ~ ~ summon ArmorStand ~-0.9239 250 ~-0.3827 {Marker:1,Invisible:1,NoGravity:1,CustomName:"MoUtMoveTowards7",ActiveEffects:[{Id:5,Amplifier:3,Duration:1000}]}
/execute @e[type=ArmorStand,name=MoUtRep] ~ ~ ~ summon ArmorStand ~-0.3827 250 ~-0.9239 {Marker:1,Invisible:1,NoGravity:1,CustomName:"MoUtMoveTowards8",ActiveEffects:[{Id:5,Amplifier:3,Duration:1000}]}
/scoreboard players set @e[type=ArmorStand] MoUtMoTo 1 {ActiveEffects:[{Id:5b,Amplifier:3b}]}
/execute @a ~ ~ ~ execute @e[r=5,c=1,score_MoUt_Rep_min=1] ~ ~ ~ scoreboard players set @e[c=1,type=ArmorStand,score_MoUtMoTo_min=1,score_MoUtMoTo=1] MoUtMove 1
/execute @e[type=ArmorStand,name=MoUtMoveTowards1,score_MoUtMove_min=1,score_MoUtMove=1] ~ ~ ~ execute @e[c=1,type=ArmorStand,name=MoUtRep] ~ ~ ~ entitydata @e[r=5,c=1,score_MoUt_Rep_min=1] {Rotation:[-180.0f,0.0f],Motion:[0.11481d,-0.1d,-0.27717d]}
/execute @e[type=ArmorStand,name=MoUtMoveTowards2,score_MoUtMove_min=1,score_MoUtMove=1] ~ ~ ~ execute @e[c=1,type=ArmorStand,name=MoUtRep] ~ ~ ~ entitydata @e[r=5,c=1,score_MoUt_Rep_min=1] {Rotation:[-135.0f,0.0f],Motion:[0.27717d,-0.1d,-0.11481d]}
/execute @e[type=ArmorStand,name=MoUtMoveTowards3,score_MoUtMove_min=1,score_MoUtMove=1] ~ ~ ~ execute @e[c=1,type=ArmorStand,name=MoUtRep] ~ ~ ~ entitydata @e[r=5,c=1,score_MoUt_Rep_min=1] {Rotation:[-90.0f,0.0f],Motion:[0.27717d,-0.1d,0.11481d]}
/execute @e[type=ArmorStand,name=MoUtMoveTowards4,score_MoUtMove_min=1,score_MoUtMove=1] ~ ~ ~ execute @e[c=1,type=ArmorStand,name=MoUtRep] ~ ~ ~ entitydata @e[r=5,c=1,score_MoUt_Rep_min=1] {Rotation:[-45.0f,0.0f],Motion:[0.11481d,-0.1d,0.27717d]}
/execute @e[type=ArmorStand,name=MoUtMoveTowards5,score_MoUtMove_min=1,score_MoUtMove=1] ~ ~ ~ execute @e[c=1,type=ArmorStand,name=MoUtRep] ~ ~ ~ entitydata @e[r=5,c=1,score_MoUt_Rep_min=1] {Rotation:[0.0f,0.0f],Motion:[-0.11481d,-0.1d,0.27717d]}
/execute @e[type=ArmorStand,name=MoUtMoveTowards6,score_MoUtMove_min=1,score_MoUtMove=1] ~ ~ ~ execute @e[c=1,type=ArmorStand,name=MoUtRep] ~ ~ ~ entitydata @e[r=5,c=1,score_MoUt_Rep_min=1] {Rotation:[45.0f,0.0f],Motion:[-0.27717d,-0.1d,0.11481d]}
/execute @e[type=ArmorStand,name=MoUtMoveTowards7,score_MoUtMove_min=1,score_MoUtMove=1] ~ ~ ~ execute @e[c=1,type=ArmorStand,name=MoUtRep] ~ ~ ~ entitydata @e[r=5,c=1,score_MoUt_Rep_min=1] {Rotation:[90.0f,0.0f],Motion:[-0.27717d,-0.1d,-0.11481d]}
/execute @e[type=ArmorStand,name=MoUtMoveTowards8,score_MoUtMove_min=1,score_MoUtMove=1] ~ ~ ~ execute @e[c=1,type=ArmorStand,name=MoUtRep] ~ ~ ~ entitydata @e[r=5,c=1,score_MoUt_Rep_min=1] {Rotation:[135.0f,0.0f],Motion:[-0.11481d,-0.1d,-0.27717d]}
# Smoke detectors
INIT:/scoreboard objectives add MoUt_SmoDet dummy
INIT:/scoreboard objectives add MoUt_SmoDetFind dummy
/scoreboard players set @e[type=ArmorStand,name=MoUtSmoDet] MoUt_SmoDet 1
/execute @e[type=ArmorStand,name=MoUtSmoDet] ~ ~ ~ detect ~ ~1 ~ air 0 scoreboard players set @e[type=ArmorStand,name=MoUtSmoDet,r=1,c=1] MoUt_SmoDet 0
/execute @e[type=Silverfish,name=Smoke_Detector] ~ ~ ~ summon ArmorStand ~ ~ ~ {CustomName:"MoUtSmoDet",Marker:1,Invisible:1,NoGravity:1}
/execute @e[type=Silverfish,name=Smoke_Detector] ~ ~ ~ summon ArmorStand ~ ~-0.76 ~ {CustomName:"MoUtSmoDetPart",Invisible:1,NoGravity:1,ArmorItems:[{},{},{},{id:stone_slab,Damage:7}],Marker:1}
/execute @e[type=Silverfish,name=Smoke_Detector] ~ ~ ~ summon ArmorStand ~ ~0.2 ~ {CustomName:"MoUtSmoDetPart",Invisible:1,NoGravity:1,Small:1,ArmorItems:[{},{},{},{id:stone_slab,Damage:7}],Marker:1}
/execute @e[type=Silverfish,name=Smoke_Detector] ~ ~ ~ summon ArmorStand ~ ~-.2 ~ {CustomName:"MoUtSmoDetPart",Invisible:1,NoGravity:1,Small:1,ArmorItems:[{},{},{},{id:stone_slab,Damage:7}],Marker:1}
/execute @e[type=ArmorStand,name=MoUtSmoDet,score_MoUt_SmoDet_min=0,score_MoUt_SmoDet=0] ~ ~ ~ summon Item ~ ~ ~ {Item:{id:"minecraft:spawn_egg",Count:1,tag:{EntityTag:{id:Silverfish},display:{Name:"Smoke_Detector"}}}}
/execute @e[type=ArmorStand,name=MoUtSmoDet,score_MoUt_SmoDet_min=0,score_MoUt_SmoDet=0] ~ ~ ~ kill @e[type=ArmorStand,name=MoUtSmoDetPart,r=3,c=3]
/execute @e[type=ArmorStand,name=MoUtSmoDet,score_MoUt_SmoDet_min=0,score_MoUt_SmoDet=0] ~ ~ ~ kill @e[type=ArmorStand,name=MoUtSmoDet,r=1,c=1]
/tp @e[type=Silverfish,name=Smoke_Detector] ~ ~-500 ~
/scoreboard players set @e[type=ArmorStand,name=MoUtSmoDet] MoUt_SmoDetFind 0
/stats entity @e[type=ArmorStand,name=MoUtSmoDet] set SuccessCount @e[type=ArmorStand,name=MoUtSmoDet,r=1] MoUt_SmoDetFind
/execute @e[name=MoUtSmoDet] ~ ~ ~ fill ~-16 ~-20 ~-16 ~16 ~2 ~16 sponge 1 replace fire
/execute @e[name=MoUtSmoDet] ~ ~ ~ fill ~-16 ~-20 ~-16 ~16 ~2 ~16 fire 0 replace sponge 1
/execute @e[score_MoUt_SmoDetFind_min=1] ~ ~ ~ playsound entity.experience_orb.touch neutral @a[r=24] ~ ~ ~ 1 2
# Icebox
INIT:/scoreboard objectives add MoUt_Icebox dummy
INIT:/scoreboard objectives add MoUt_Icebox2 dummy
INIT:/scoreboard objectives add MoUt_IceTime dummy
/scoreboard players set @e[type=Item] MoUt_I 14 {Item:{id:"minecraft:dropper"}}
/execute @e[type=Squid,name=Icebox] ~ ~ ~ summon ArmorStand ~ ~ ~ {CustomName:"MoUtIcebox",Marker:1,Invisible:1,NoGravity:1}
/execute @e[type=Squid,name=Icebox] ~ ~ ~ setblock ~ ~ ~ dropper 1
/tp @e[type=Squid,name=Icebox] ~ ~-500 ~
/execute @e[type=ArmorStand,name=MoUtIcebox] ~ ~ ~ detect ~ ~ ~ dropper 1 blockdata ~ ~ ~ {CustomName:"Icebox"}
/execute @e[type=ArmorStand,name=MoUtIcebox] ~ ~ ~ detect ~ ~ ~ air 0 kill @e[type=Item,score_MoUt_I_min=14,score_MoUt_I=14,r=3]
/execute @e[type=ArmorStand,name=MoUtIcebox] ~ ~ ~ detect ~ ~ ~ air 0 summon Item ~ ~ ~ {Item:{id:"minecraft:spawn_egg",Count:1,tag:{EntityTag:{id:Squid},display:{Name:"Icebox"}}}}
/execute @e[type=ArmorStand,name=MoUtIcebox] ~ ~ ~ detect ~ ~ ~ air 0 kill @e[type=ArmorStand,name=MoUtIcebox,r=1,c=1]
/scoreboard players set @e[type=ArmorStand,name=MoUtIcebox] MoUt_Icebox 0
/scoreboard players set @e[type=ArmorStand,name=MoUtIcebox] MoUt_Icebox2 0
/execute @e[type=ArmorStand,name=MoUtIcebox,score_MoUt_IceTime_min=98] ~ ~ ~ particle cloud ~ ~ ~ 0 0 0 1 10
/execute @e[type=ArmorStand,name=MoUtIcebox,score_MoUt_IceTime_min=98] ~ ~ ~ playsound block.fire.extinguish neutral @a[r=24] ~ ~ ~ 1 1
# 2
/stats entity @e[type=ArmorStand,name=MoUtIcebox] set SuccessCount @e[type=ArmorStand,name=MoUtIcebox,r=1,c=1] MoUt_Icebox2
/execute @e[type=ArmorStand,name=MoUtIcebox] ~ ~ ~ testforblock ~ ~ ~ dropper 1 {Items:[{Slot:0b,id:"minecraft:iron_bars",Count:1b,Damage:0s},{Slot:1b,id:"minecraft:iron_bars",Count:1b,Damage:0s},{Slot:2b,id:"minecraft:iron_bars",Count:1b,Damage:0s},{Slot:4b,id:"minecraft:ice",Count:1b,Damage:0s},{Slot:6b,id:"minecraft:iron_bars",Count:1b,Damage:0s},{Slot:7b,id:"minecraft:iron_bars",Count:1b,Damage:0s},{Slot:8b,id:"minecraft:iron_bars",Count:1b,Damage:0s}]}
/scoreboard players add @e[type=ArmorStand,name=MoUtIcebox,score_MoUt_Icebox2_min=1] MoUt_IceTime 1
/execute @e[type=ArmorStand,name=MoUtIcebox,score_MoUt_Icebox2_min=1,score_MoUt_Icebox2=1,score_MoUt_IceTime_min=100] ~ ~ ~ blockdata ~ ~ ~ {Items:[{Slot:0b,id:"minecraft:iron_bars",Count:1b,Damage:0s},{Slot:1b,id:"minecraft:iron_bars",Count:1b,Damage:0s},{Slot:2b,id:"minecraft:iron_bars",Count:1b,Damage:0s},{Slot:4b,id:"minecraft:packed_ice",Count:1b,Damage:0s},{Slot:6b,id:"minecraft:iron_bars",Count:1b,Damage:0s},{Slot:7b,id:"minecraft:iron_bars",Count:1b,Damage:0s},{Slot:8b,id:"minecraft:iron_bars",Count:1b,Damage:0s}]}
# 1
/stats entity @e[type=ArmorStand,name=MoUtIcebox] set SuccessCount @e[type=ArmorStand,name=MoUtIcebox,r=1,c=1] MoUt_Icebox
/execute @e[type=ArmorStand,name=MoUtIcebox] ~ ~ ~ testforblock ~ ~ ~ dropper 1 {Items:[{Slot:0b,id:"minecraft:iron_bars",Count:1b,Damage:0s},{Slot:1b,id:"minecraft:iron_bars",Count:1b,Damage:0s},{Slot:2b,id:"minecraft:iron_bars",Count:1b,Damage:0s},{Slot:4b,id:"minecraft:water_bucket",Count:1b,Damage:0s},{Slot:6b,id:"minecraft:iron_bars",Count:1b,Damage:0s},{Slot:7b,id:"minecraft:iron_bars",Count:1b,Damage:0s},{Slot:8b,id:"minecraft:iron_bars",Count:1b,Damage:0s}]}
/scoreboard players add @e[type=ArmorStand,name=MoUtIcebox,score_MoUt_Icebox_min=1] MoUt_IceTime 1
/execute @e[type=ArmorStand,name=MoUtIcebox,score_MoUt_Icebox_min=1,score_MoUt_Icebox=1,score_MoUt_IceTime_min=100] ~ ~ ~ blockdata ~ ~ ~ {Items:[{Slot:0b,id:"minecraft:iron_bars",Count:1b,Damage:0s},{Slot:1b,id:"minecraft:iron_bars",Count:1b,Damage:0s},{Slot:2b,id:"minecraft:iron_bars",Count:1b,Damage:0s},{Slot:3b,id:"minecraft:bucket",Count:1b,Damage:0s},{Slot:4b,id:"minecraft:ice",Count:1b,Damage:0s},{Slot:6b,id:"minecraft:iron_bars",Count:1b,Damage:0s},{Slot:7b,id:"minecraft:iron_bars",Count:1b,Damage:0s},{Slot:8b,id:"minecraft:iron_bars",Count:1b,Damage:0s}]}
/scoreboard players reset @e[type=ArmorStand,name=MoUtIcebox,score_MoUt_IceTime_min=100] MoUt_IceTime
# Motion detector
INIT:/scoreboard objectives add MoUt_MotDet dummy
INIT:/scoreboard objectives add MoUt_MotRed dummy
/execute @e[type=Squid,name=Motion_Detector] ~ ~ ~ summon ArmorStand ~ ~ ~ {CustomName:"MoUtMotDet",Marker:1,Invisible:1}
/execute @e[type=Squid,name=Motion_Detector] ~ ~ ~ summon ArmorStand ~ ~-1.349 ~ {CustomName:"MoUtMotDetPart",Invisible:1,NoGravity:1,ArmorItems:[{},{},{},{id:stone_slab,Count:1,tag:{display:{Name:"MoUtMotDetItem"}}}]}
/execute @e[type=Squid,name=Motion_Detector] ~ ~ ~ summon ArmorStand ~ ~-1.07 ~ {CustomName:"MoUtMotDetGlass",Invisible:1,NoGravity:1,ArmorItems:[{},{},{},{id:stained_glass,Damage:14,Count:1,tag:{display:{Name:"MoUtMotDetItem"}}}]}
/tp @e[type=Squid,name=Motion_Detector] ~ ~-500 ~
/scoreboard players set @e[type=ArmorStand,name=MoUtMotDet] MoUt_MotDet 0
/execute @e[type=ArmorStand,name=MoUtMotDet] ~ ~-1 ~ execute @a[r=10] ~ ~ ~ scoreboard players set @e[type=ArmorStand,name=MoUtMotDet,c=1,r=16] MoUt_MotDet 1
/execute @e[type=ArmorStand,name=MoUtMotDet,score_MoUt_MotDet_min=1] ~ ~ ~ tp @e[type=ArmorStand,name=MoUtMotDetGlass,r=2,c=1] ~ ~ ~ ~8 ~
/scoreboard players add @e[type=ArmorStand,name=MoUtMotDet] MoUt_MotRed 0
/scoreboard players add @e[type=ArmorStand,name=MoUtMotDet,score_MoUt_MotRed=10,score_MoUt_MotDet_min=1] MoUt_MotRed 1
/scoreboard players set @e[type=ArmorStand,name=MoUtMotDet,score_MoUt_MotDet=0] MoUt_MotRed 0
/execute @e[score_MoUt_MotRed_min=1,score_MoUt_MotRed=1] ~ ~ ~ detect ~ ~-1 ~ air 0 scoreboard players set @e[score_MoUt_MotRed_min=1,score_MoUt_MotRed=1,r=3,c=1] MoUt_MotRed 0
/execute @e[score_MoUt_MotRed_min=1,score_MoUt_MotRed=1] ~ ~ ~ setblock ~ ~ ~ redstone_torch 0 replace
/execute @e[score_MoUt_MotRed_min=0,score_MoUt_MotRed=0] ~ ~ ~ setblock ~ ~ ~ air 0 replace
/scoreboard players reset @a MoUt_MotDet
/scoreboard players set @a MoUt_MotDet 1 {Inventory:[{tag:{display:{Name:"MoUtMotDetItem"}}}]}
/execute @a[score_MoUt_MotDet_min=1] ~ ~ ~ execute @e[type=ArmorStand,name=MoUtMotDet,r=20,c=1] ~ ~ ~ setblock ~ ~ ~ air
/execute @a[score_MoUt_MotDet_min=1] ~ ~ ~ execute @e[type=ArmorStand,name=MoUtMotDet,r=20,c=1] ~ ~ ~ kill @e[type=ArmorStand,name=MoUtMotDetPart,r=3,c=1]
/execute @a[score_MoUt_MotDet_min=1] ~ ~ ~ execute @e[type=ArmorStand,name=MoUtMotDet,r=20,c=1] ~ ~ ~ kill @e[type=ArmorStand,name=MoUtMotDetGlass,r=3,c=1]
/execute @a[score_MoUt_MotDet_min=1] ~ ~ ~ execute @e[type=ArmorStand,name=MoUtMotDet,r=20,c=1] ~ ~ ~ summon Item ~ ~ ~ {Item:{id:"minecraft:spawn_egg",Count:1,tag:{EntityTag:{id:Squid},display:{Name:"Motion_Detector"}}}}
/execute @a[score_MoUt_MotDet_min=1] ~ ~ ~ kill @e[type=ArmorStand,name=MoUtMotDet,r=20,c=1]
/clear @a stone_slab 0 1 {display:{Name:"MoUtMotDetItem"}}
/clear @a stained_glass 14 1 {display:{Name:"MoUtMotDetItem"}}