#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#
#    This function has been created by Skilendarz Group.
#             https://skilendarz.com
#
#      GIVE MAP MAKERS THE CREDIT THEY DESERVE!
#             COPYING IS PROHIBITED!
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

playsound minecraft:ui.button.click master @a[distance=..6] ~ ~ ~ 1 0.5
kill @e[tag=info_as,type=!villager]
tp @e[tag=info_as,type=villager] ~ ~-300 ~
fill 321 111 -287 321 113 -290 air
scoreboard players set info time 0
scoreboard players set info carrot 0

execute if score info main matches 0 run data merge entity @e[tag=info-title,limit=1] {CustomName:'{"translate":"lobby.info.0.top","bold":true}'}
execute if score info main matches 1 run data merge entity @e[tag=info-title,limit=1] {CustomName:'{"translate":"lobby.info.1.top","bold":true}'}
execute if score info main matches 2 run data merge entity @e[tag=info-title,limit=1] {CustomName:'{"translate":"lobby.info.2.top","bold":true}'}
execute if score info main matches 3 run data merge entity @e[tag=info-title,limit=1] {CustomName:'{"translate":"lobby.info.3.top","bold":true}'}
execute if score info main matches 4 run data merge entity @e[tag=info-title,limit=1] {CustomName:'{"translate":"lobby.info.4.top","bold":true}'}
execute if score info main matches 5 run data merge entity @e[tag=info-title,limit=1] {CustomName:'{"translate":"lobby.info.5.top","bold":true}'}
execute if score info main matches 6 run data merge entity @e[tag=info-title,limit=1] {CustomName:'{"translate":"lobby.info.6.top","bold":true}'}
execute if score info main matches 7 run data merge entity @e[tag=info-title,limit=1] {CustomName:'{"translate":"lobby.info.7.top","bold":true}'}

execute if score info main matches 0 run data merge entity @e[tag=info-line1,limit=1] {CustomName:'{"translate":"lobby.info.0"}'}
execute if score info main matches 1 run data merge entity @e[tag=info-line1,limit=1] {CustomName:'{"translate":"lobby.info.1"}'}
execute if score info main matches 2 run data merge entity @e[tag=info-line1,limit=1] {CustomName:'{"translate":"lobby.info.2"}'}
execute if score info main matches 3 run data merge entity @e[tag=info-line1,limit=1] {CustomName:'{"translate":"lobby.info.3"}'}
execute if score info main matches 4 run data merge entity @e[tag=info-line1,limit=1] {CustomName:'{"translate":"lobby.info.4"}'}
execute if score info main matches 5 run data merge entity @e[tag=info-line1,limit=1] {CustomName:'{"translate":"lobby.info.5"}'}
execute if score info main matches 6 run data merge entity @e[tag=info-line1,limit=1] {CustomName:'{"translate":"lobby.info.6"}'}
execute if score info main matches 7 run data merge entity @e[tag=info-line1,limit=1] {CustomName:'{"translate":"lobby.info.7"}'}

execute if score info main matches 0 run summon armor_stand 321 111 -289.3 {DisabledSlots:2039552,Invisible:1,NoGravity:1,ShowArms:1,Silent:1,Pose:{Head:[20f,0f,0f],RightArm:[-60f,-20f,0f]},Tags:["info_as","info_player"],ArmorItems:[{id:"leather_boots",Count:1b,tag:{display:{color:12099684}}},{id:"leather_leggings",Count:1b,tag:{display:{color:13415025}}},{id:"leather_chestplate",Count:1b,tag:{display:{color:3949738}}},{id:"player_head",Count:1b}],HandItems:[{id:"lime_dye",Count:1b,tag:{CustomModelData:27}},{id:"lime_dye",Count:1b,tag:{CustomModelData:28}}]}
execute if score info main matches 0 run summon armor_stand 321 111 -289.3 {DisabledSlots:2039552,Invisible:1,NoGravity:1,Pose:{RightArm:[-60f,-20f,0f]},Tags:["info_as"],HandItems:[{id:"compass",Count:1b},{}]}
execute if score info main matches 0 run summon armor_stand 321 109.6 -287 {DisabledSlots:2039552,Invisible:1,NoGravity:1,Tags:["info_as"],ArmorItems:[{},{},{},{id:"lime_dye",Count:1b,tag:{CustomModelData:9}}],Rotation:[90.0f,0.0f]}

execute if score info main matches 1 run summon armor_stand 321 111 -289.5 {DisabledSlots:2039552,Invisible:1,NoGravity:1,ShowArms:1,Silent:1,Pose:{Head:[20f,0f,0f],RightArm:[-60f,0f,0f]},Tags:["info_as","info_player"],ArmorItems:[{id:"leather_boots",Count:1b,tag:{display:{color:12099684}}},{id:"leather_leggings",Count:1b,tag:{display:{color:13415025}}},{id:"leather_chestplate",Count:1b,tag:{display:{color:3949738}}},{id:"player_head",Count:1b}],HandItems:[{id:"lime_dye",Count:1b,tag:{CustomModelData:27}},{id:"lime_dye",Count:1b,tag:{CustomModelData:28}}]}
execute if score info main matches 1 run summon armor_stand 321 111 -289.5 {DisabledSlots:2039552,Invisible:1,NoGravity:1,Pose:{RightArm:[-60f,0f,0f]},Tags:["info_as"],HandItems:[{id:"iron_pickaxe",Count:1b},{}]}
execute if score info main matches 1 run setblock 321 111 -289 minecraft:gold_ore
execute if score info main matches 1 run summon villager 321 111 -287 {NoAI:1,Tags:["info_as"],Rotation:[180.0f,0.0f],CustomNameVisible:1,CustomName:'{"translate":"store.npc","color":"green","bold":true}',VillagerData:{profession:"leatherworker",type:"jungle"},Silent:1}

execute if score info main matches 2 run summon armor_stand 321 111 -288.5 {DisabledSlots:2039552,Invisible:1,NoGravity:1,ShowArms:1,Silent:1,Pose:{Head:[30f,0f,0f],RightArm:[0f,0f,0f]},Tags:["info_as","info_player"],ArmorItems:[{id:"leather_boots",Count:1b,tag:{display:{color:12099684}}},{id:"leather_leggings",Count:1b,tag:{display:{color:13415025}}},{id:"leather_chestplate",Count:1b,tag:{display:{color:3949738}}},{id:"player_head",Count:1b}],HandItems:[{id:"lime_dye",Count:1b,tag:{CustomModelData:27}},{id:"lime_dye",Count:1b,tag:{CustomModelData:28}}]}
execute if score info main matches 2 run summon armor_stand 321 109.6 -288 {DisabledSlots:2039552,Invisible:1,NoGravity:1,Tags:["info_as","info_pumpkin"],ArmorItems:[{},{},{},{id:"lime_dye",Count:1b,tag:{CustomModelData:9}}],Rotation:[90.0f,0.0f]}

execute if score info main matches 3 run summon armor_stand 321 111 -289.5 {DisabledSlots:2039552,Invisible:1,NoGravity:1,ShowArms:1,Silent:1,Pose:{Head:[30f,0f,0f],RightArm:[0f,0f,0f]},Tags:["info_as","info_player"],ArmorItems:[{id:"leather_boots",Count:1b,tag:{display:{color:12099684}}},{id:"leather_leggings",Count:1b,tag:{display:{color:13415025}}},{id:"leather_chestplate",Count:1b,tag:{display:{color:11546150}}},{id:"player_head",Count:1b}],HandItems:[{id:"lime_dye",Count:1b,tag:{CustomModelData:27}},{id:"lime_dye",Count:1b,tag:{CustomModelData:28}}]}
execute if score info main matches 3 run summon armor_stand 321 111 -286.5 {DisabledSlots:2039552,Rotation:[180.0f,0.0f],Invisible:1,NoGravity:1,ShowArms:1,Silent:1,Pose:{Head:[30f,0f,0f],RightArm:[-60f,-20f,0f]},Tags:["info_as","info_player2","info_sensor"],ArmorItems:[{id:"leather_boots",Count:1b,tag:{display:{color:12099684}}},{id:"leather_leggings",Count:1b,tag:{display:{color:13415025}}},{id:"leather_chestplate",Count:1b,tag:{display:{color:3949738}}},{id:"player_head",Count:1b}],HandItems:[{id:"lime_dye",Count:1b,tag:{CustomModelData:27}},{id:"lime_dye",Count:1b,tag:{CustomModelData:28}}]}
execute if score info main matches 3 run summon armor_stand 321 111 -286.5 {DisabledSlots:2039552,Rotation:[180.0f,0.0f],Invisible:1,NoGravity:1,Pose:{RightArm:[-60f,-20f,0f]},Tags:["info_as","info_sensor"],HandItems:[{id:"feather",Count:1b},{}]}
execute if score info main matches 3 run summon armor_stand 321 109.6 -289 {DisabledSlots:2039552,Invisible:1,NoGravity:1,Tags:["info_as","info_pumpkin"],ArmorItems:[{},{},{},{id:"lime_dye",Count:1b,tag:{CustomModelData:9}}],Rotation:[90.0f,0.0f]}

execute if score info main matches 4 run summon armor_stand 321 110.7 -288.0 {DisabledSlots:2039552,Invisible:1,NoGravity:1,ShowArms:1,Silent:1,Pose:{RightArm:[25.0f,0.0f,5.0f],LeftArm:[25.0f,0.0f,-5.0f],Head:[15f,0f,0f],Body:[30f,0f,0f]},Tags:["info_as","info_player","info_particles"],ArmorItems:[{},{},{id:"leather_chestplate",Count:1b,tag:{display:{color:3949738}}},{id:"player_head",Count:1b}],HandItems:[{id:"lime_dye",Count:1b,tag:{CustomModelData:27}},{id:"lime_dye",Count:1b,tag:{CustomModelData:28}}],Rotation:[90.0f,0.0f]}
execute if score info main matches 4 run summon armor_stand 321 110.7 -288.0 {DisabledSlots:2039552,Invisible:1,NoGravity:1,Pose:{RightArm:[25.0f,0.0f,5.0f]},Tags:["info_as","info_player"],HandItems:[{id:"lime_dye",Count:1b,tag:{CustomModelData:9}},{}],Rotation:[90.0f,0.0f]}
execute if score info main matches 4 run summon armor_stand 321.8 110.7 -288.0 {DisabledSlots:2039552,Invisible:1,NoGravity:1,ShowArms:1,Silent:1,Pose:{Head:[25f,0f,0f],Body:[0f,0f,0f]},Tags:["info_as"],ArmorItems:[{id:"leather_boots",Count:1b,tag:{display:{color:12099684}}},{id:"leather_leggings",Count:1b,tag:{display:{color:13415025}}},{},{}],Rotation:[90.0f,0.0f]}

execute if score info main matches 5 run summon armor_stand 321 111 -289.3 {DisabledSlots:2039552,Invisible:1,NoGravity:1,ShowArms:1,Silent:1,Pose:{Head:[10f,0f,0f],RightArm:[-10f,0f,10f]},Tags:["info_as","info_player"],ArmorItems:[{id:"leather_boots",Count:1b,tag:{display:{color:12099684}}},{id:"leather_leggings",Count:1b,tag:{display:{color:13415025}}},{id:"leather_chestplate",Count:1b,tag:{display:{color:3949738}}},{id:"player_head",Count:1b}],HandItems:[{id:"lime_dye",Count:1b,tag:{CustomModelData:27}},{id:"lime_dye",Count:1b,tag:{CustomModelData:28}}]}
execute if score info main matches 5 run summon armor_stand 321 111 -287 {DisabledSlots:2039552,Invisible:1,NoGravity:1,ShowArms:1,Silent:1,Pose:{Head:[10f,20f,0f],LeftArm:[-40f,0f,10f]},Tags:["info_as","info_player2"],ArmorItems:[{id:"leather_boots",Count:1b,tag:{display:{color:12099684}}},{id:"leather_leggings",Count:1b,tag:{display:{color:13415025}}},{id:"leather_chestplate",Count:1b,tag:{display:{color:11546150}}},{id:"player_head",Count:1b}],HandItems:[{id:"lime_dye",Count:1b,tag:{CustomModelData:27}},{id:"lime_dye",Count:1b,tag:{CustomModelData:28}}]}

execute if score info main matches 6 run setblock 321 111 -288 minecraft:rail[shape=east_west]
execute if score info main matches 6 run summon armor_stand 321 111 -289.3 {DisabledSlots:2039552,Invisible:1,NoGravity:1,ShowArms:1,Silent:1,Pose:{Head:[10f,0f,0f],RightArm:[0.01f,0.01f,0.01f],LeftArm:[0.01f,0.01f,0.01f]},Tags:["info_as","info_player"],ArmorItems:[{id:"leather_boots",Count:1b,tag:{display:{color:12099684}}},{id:"leather_leggings",Count:1b,tag:{display:{color:13415025}}},{id:"leather_chestplate",Count:1b,tag:{display:{color:3949738}}},{id:"player_head",Count:1b}],HandItems:[{id:"lime_dye",Count:1b,tag:{CustomModelData:27}},{id:"lime_dye",Count:1b,tag:{CustomModelData:28}}]}

execute if score info main matches 7 run summon armor_stand 321 111 -289.3 {DisabledSlots:2039552,Invisible:1,NoGravity:1,ShowArms:1,Silent:1,Pose:{Head:[10f,0f,0f]},Tags:["info_as","info_player"],ArmorItems:[{id:"leather_boots",Count:1b,tag:{display:{color:12099684}}},{id:"leather_leggings",Count:1b,tag:{display:{color:13415025}}},{id:"leather_chestplate",Count:1b,tag:{display:{color:3949738}}},{id:"player_head",Count:1b}],HandItems:[{id:"lime_dye",Count:1b,tag:{CustomModelData:27}},{id:"lime_dye",Count:1b,tag:{CustomModelData:28}}]}
execute if score info main matches 7 run summon armor_stand 321 109 -288 {DisabledSlots:2039552,Tags:["info_as","fake_powerup"],Invisible:1,NoGravity:1,ArmorItems:[{},{},{},{id:"minecraft:gold_block",Count:1b}]}