## Run by prisoners
## Run from animation.ender_prisoner.duplication_check
## @s = ldz:ender_charger, ldz:ender_chef, ldz:ender_gardener, ldz:ender_hydro

#scoreboard objectives setdisplay sidebar PCharger
#scoreboard objectives setdisplay sidebar PChef
#scoreboard objectives setdisplay sidebar PGardener
#scoreboard objectives setdisplay sidebar PHydro

execute as @s[type=ldz:ender_charger] run scoreboard players add @e[type=ldz:ender_charger] PCharger 0
execute as @s[type=ldz:ender_chef] run scoreboard players add @e[type=ldz:ender_chef] PChef 0
execute as @s[type=ldz:ender_gardener] run scoreboard players add @e[type=ldz:ender_gardener] PGardener 0
execute as @s[type=ldz:ender_hydro] run scoreboard players add @e[type=ldz:ender_hydro] PHydro 0

execute as @e[type=ldz:ender_charger,scores={PCharger=0}] run event entity @s despawn
execute as @e[type=ldz:ender_chef,scores={PChef=0}] run event entity @s despawn
execute as @e[type=ldz:ender_gardener,scores={PGardener=0}] run event entity @s despawn
execute as @e[type=ldz:ender_hydro,scores={PHydro=0}] run event entity @s despawn

scoreboard players add @s[scores={PCharger=1..}] PCharger 1
scoreboard players add @s[scores={PChef=1..}] PChef 1
scoreboard players add @s[scores={PGardener=1..}] PGardener 1
scoreboard players add @s[scores={PHydro=1..}] PHydro 1

execute as @s[scores={PCharger=3..}] run event entity @s remove_duplication_check_toggle
execute as @s[scores={PChef=3..}] run event entity @s remove_duplication_check_toggle
execute as @s[scores={PGardener=3..}] run event entity @s remove_duplication_check_toggle
execute as @s[scores={PHydro=3..}] run event entity @s remove_duplication_check_toggle


execute at @s[type=ldz:ender_charger] run setblock -533 167 -159 light_block ["block_light_level": 9]
execute at @s[type=ldz:ender_chef] run setblock 82 153 -484 light_block ["block_light_level": 9]
execute at @s[type=ldz:ender_gardener] run setblock 33 165 446 light_block ["block_light_level": 9]
execute at @s[type=ldz:ender_hydro] run setblock 595 166 50 light_block ["block_light_level": 9]

#say check duplication