execute store result score .chefplayers maid.values if entity @a[team=povar]
execute if score .chefplayers maid.values matches 3.. run return run title @a[team=povar] actionbar {"translate":"toomanyplayers","color":"red"}

execute store result storage time sec short 0.05 run scoreboard players get .chef chef.time
data modify entity @n[tag=chef.timer] text set string storage minecraft:time sec
scoreboard players remove .chef chef.time 1
execute if score .chef chef.time matches 1 run function ws:work/misc/chef/random

scoreboard players add .chef chef.refill 1
execute if score .chef chef.refill matches 1200.. as @e[tag=refill,type=marker] at @s run function ws:work/misc/chef/refill
execute if score .chef chef.refill matches 1200.. run scoreboard players set .chef chef.refill 0

execute as @a[team=povar] if predicate ws:ring run title @s actionbar {"translate":"chef.serve"}
clear @a[team=povar] glass_bottle
clear @a[team=povar] bucket
kill @e[type=egg]

execute as @e[tag=chef.serve] on target run function ws:work/misc/chef/serve with entity @e[tag=chef.display,limit=1] item
data remove entity @e[tag=chef.serve,limit=1] interaction