Select Page

Structure spawner

Download

scoreboard objectives add spawn dummy
#Adds a scoreboard called spawn that can only be changed by commands

execute @e[type=pig] ~ ~ ~ scoreboard players add @r[type=pig] spawn 1
#Every pig adds 1 to the score of a random pig

execute @e[type=pig,score_spawn_min=1000] ~ ~ ~ setblock ~ ~ ~ structure_block 1
#Makes a pig with the score higher than 1000 place a structure block
execute @e[type=pig,score_spawn_min=1000] ~ ~ ~ blockdata ~ ~ ~ {mode:"LOAD",posX:0,posY:0,PosZ:0,name:"Beacon"}
#Changes the data of the structure block to a desired name/position
execute @e[type=pig,score_spawn_min=1000] ~ ~ ~ setblock ~1 ~ ~ redstone_block 1
#The pig places a redstone block to activate the structure block
execute @e[type=pig,score_spawn_min=1000] ~ ~ ~ scoreboard players set @e[type=pig] spawn 0
#Resets the score of all pigs

execute @e[type=bat] ~ ~ ~ scoreboard players add @r[type=bat] spawn 1
execute @e[type=bat,score_spawn_min=100000] ~ ~ ~ setblock ~ ~ ~ structure_block 1
execute @e[type=bat,score_spawn_min=100000] ~ ~ ~ blockdata ~ ~ ~ {mode:"LOAD",posX:0,posY:0,PosZ:0,name:"Gate"}
execute @e[type=bat,score_spawn_min=100000] ~ ~ ~ setblock ~ ~1 ~ redstone_block 1
execute @e[type=bat,score_spawn_min=100000] ~ ~ ~ scoreboard players set @e[type=bat] spawn 0
#Same thing, but with a bat and more time to wait until the structure spawns