event entity @e[type=ldz:dungeon_lever] despawn

scoreboard objectives remove DungeonLever
scoreboard objectives add DungeonLever dummy

summon ldz:dungeon_lever ~ ~ ~ 0 0 portal_room

summon ldz:dungeon_lever ~ ~ ~ 0 0 beast_hub
summon ldz:dungeon_lever ~ ~ ~ 0 0 mystic_hub
summon ldz:dungeon_lever ~ ~ ~ 0 0 scourge_hub
summon ldz:dungeon_lever ~ ~ ~ 0 0 wraith_hub

summon ldz:dungeon_lever ~ ~ ~ 0 0 beast_dungeon
summon ldz:dungeon_lever ~ ~ ~ 0 0 mystic_dungeon
summon ldz:dungeon_lever ~ ~ ~ 0 0 scourge_dungeon
summon ldz:dungeon_lever ~ ~ ~ 0 0 wraith_dungeon

scoreboard players add @e[type=ldz:dungeon_lever,r=2] DungeonLever 1

teleport @e[type=ldz:dungeon_lever,family=portal_room_lever] 106 168 55

teleport @e[type=ldz:dungeon_lever,family=beast_lever_hub] 102 150 12
teleport @e[type=ldz:dungeon_lever,family=mystic_lever_hub] 75 158 33
teleport @e[type=ldz:dungeon_lever,family=scourge_lever_hub] 106 150 50
teleport @e[type=ldz:dungeon_lever,family=wraith_lever_hub] 133 158 29

teleport @e[type=ldz:dungeon_lever,family=beast_lever_dungeon] 88 183 -469
teleport @e[type=ldz:dungeon_lever,family=mystic_lever_dungeon] -549 179 -159
teleport @e[type=ldz:dungeon_lever,family=scourge_lever_dungeon] 23 184 432
teleport @e[type=ldz:dungeon_lever,family=wraith_lever_dungeon] 576 180 50


scoreboard objectives remove BeastBarrier
scoreboard objectives remove MysticBarrier
scoreboard objectives remove ScourgeBarrier
scoreboard objectives remove WraithBarrier