Files
data
pack.mcmeta
Code
28 603
data/skywars/functions/cosmetics.mcfunction
execute as @a[distance=..5] if block 18 151 47 minecraft:chest unless data block 18 151 47 Items[{Slot:0b,id:"minecraft:lightning_rod",tag:{CustomModelData:1001}}] run scoreboard players set @s sw.cosmetic 1
execute as @a[distance=..5] if block 18 151 47 minecraft:chest unless data block 18 151 47 Items[{Slot:0b,id:"minecraft:lightning_rod",tag:{CustomModelData:1001}}] run tag @s add sw_cosmetic_pick
execute as @a[distance=..5] if block 18 151 47 minecraft:chest unless data block 18 151 47 Items[{Slot:1b,id:"minecraft:wither_skeleton_skull",tag:{CustomModelData:1002}}] run scoreboard players set @s sw.cosmetic 2
execute as @a[distance=..5] if block 18 151 47 minecraft:chest unless data block 18 151 47 Items[{Slot:1b,id:"minecraft:wither_skeleton_skull",tag:{CustomModelData:1002}}] run tag @s add sw_cosmetic_pick
execute as @a[distance=..5] if block 18 151 47 minecraft:chest unless data block 18 151 47 Items[{Slot:2b,id:"minecraft:blaze_powder",tag:{CustomModelData:1003}}] run scoreboard players set @s sw.cosmetic 3
execute as @a[distance=..5] if block 18 151 47 minecraft:chest unless data block 18 151 47 Items[{Slot:2b,id:"minecraft:blaze_powder",tag:{CustomModelData:1003}}] run tag @s add sw_cosmetic_pick
execute as @a[distance=..5] if block 18 151 47 minecraft:chest unless data block 18 151 47 Items[{Slot:3b,id:"minecraft:dragon_head",tag:{CustomModelData:1004}}] run scoreboard players set @s sw.cosmetic 4
execute as @a[distance=..5] if block 18 151 47 minecraft:chest unless data block 18 151 47 Items[{Slot:3b,id:"minecraft:dragon_head",tag:{CustomModelData:1004}}] run tag @s add sw_cosmetic_pick
execute as @a[distance=..5] if block 18 151 47 minecraft:chest unless data block 18 151 47 Items[{Slot:4b,id:"minecraft:tnt",tag:{CustomModelData:1005}}] run scoreboard players set @s sw.cosmetic 5
execute as @a[distance=..5] if block 18 151 47 minecraft:chest unless data block 18 151 47 Items[{Slot:4b,id:"minecraft:tnt",tag:{CustomModelData:1005}}] run tag @s add sw_cosmetic_pick
execute as @a[distance=..5] if block 18 151 47 minecraft:chest unless data block 18 151 47 Items[{Slot:5b,id:"minecraft:note_block",tag:{CustomModelData:1006}}] run scoreboard players set @s sw.cosmetic 6
execute as @a[distance=..5] if block 18 151 47 minecraft:chest unless data block 18 151 47 Items[{Slot:5b,id:"minecraft:note_block",tag:{CustomModelData:1006}}] run tag @s add sw_cosmetic_pick
execute as @a[distance=..5] if block 18 151 47 minecraft:chest unless data block 18 151 47 Items[{Slot:6b,id:"minecraft:water_bucket",tag:{CustomModelData:1007}}] run scoreboard players set @s sw.cosmetic 7
execute as @a[distance=..5] if block 18 151 47 minecraft:chest unless data block 18 151 47 Items[{Slot:6b,id:"minecraft:water_bucket",tag:{CustomModelData:1007}}] run tag @s add sw_cosmetic_pick
execute as @a[tag=sw_cosmetic_pick,scores={sw.cosmetic=1}] run clear @s minecraft:lightning_rod{CustomModelData:1001} 1
execute as @a[tag=sw_cosmetic_pick,scores={sw.cosmetic=2}] run clear @s minecraft:wither_skeleton_skull{CustomModelData:1002} 1
execute as @a[tag=sw_cosmetic_pick,scores={sw.cosmetic=3}] run clear @s minecraft:blaze_powder{CustomModelData:1003} 1
execute as @a[tag=sw_cosmetic_pick,scores={sw.cosmetic=4}] run clear @s minecraft:dragon_head{CustomModelData:1004} 1
execute as @a[tag=sw_cosmetic_pick,scores={sw.cosmetic=5}] run clear @s minecraft:tnt{CustomModelData:1005} 1
execute as @a[tag=sw_cosmetic_pick,scores={sw.cosmetic=6}] run clear @s minecraft:note_block{CustomModelData:1006} 1
execute as @a[tag=sw_cosmetic_pick,scores={sw.cosmetic=7}] run clear @s minecraft:water_bucket{CustomModelData:1007} 1
execute as @a[tag=sw_cosmetic_pick,scores={sw.cosmetic=1}] run tellraw @s {"text":"Kill effect potvrđen: Lightning","color":"green"}
execute as @a[tag=sw_cosmetic_pick,scores={sw.cosmetic=2}] run tellraw @s {"text":"Kill effect potvrđen: Wither","color":"green"}
execute as @a[tag=sw_cosmetic_pick,scores={sw.cosmetic=3}] run tellraw @s {"text":"Kill effect potvrđen: Blaze","color":"green"}
execute as @a[tag=sw_cosmetic_pick,scores={sw.cosmetic=4}] run tellraw @s {"text":"Kill effect potvrđen: Dragon","color":"green"}
execute as @a[tag=sw_cosmetic_pick,scores={sw.cosmetic=5}] run tellraw @s {"text":"Kill effect potvrđen: TNT","color":"green"}
execute as @a[tag=sw_cosmetic_pick,scores={sw.cosmetic=6}] run tellraw @s {"text":"Kill effect potvrđen: Sound Box","color":"green"}
execute as @a[tag=sw_cosmetic_pick,scores={sw.cosmetic=7}] run tellraw @s {"text":"Kill effect potvrđen: Water","color":"green"}
execute as @a[tag=sw_cosmetic_pick] run playsound minecraft:ui.button.click master @s ~ ~ ~ 1 1
execute if entity @a[tag=sw_cosmetic_pick] run setblock 18 151 47 air
execute if entity @a[tag=sw_cosmetic_pick] run schedule function skywars:setup_cosmetics 1t replace
tag @a remove sw_cosmetic_pick
advancement revoke @a only skywars:cosmetic_click