scoreboard players set @a[tag=mafioz,nbt={Inventory:[{components:{"minecraft:custom_data":{questing:1}}}]}] mafiaquest 1
execute as @a[tag=mafioz] if items entity @s player.cursor paper[minecraft:custom_data~{questing:1}] run scoreboard players set @s mafiaquest 2
scoreboard players remove @a[nbt=!{Inventory:[{components:{"minecraft:custom_data":{questing:1}}}]}] mafiaquest 1
execute at @a[tag=mafioz,scores={mafiaquest=..0}] run kill @e[distance=..2,type=minecraft:item,nbt={Item:{count:1,components:{"minecraft:custom_data":{questing:1}}}}]
execute as @a[tag=mafioz,scores={mafiaquest=-1}] run title @s title {"translate":"mafia.cancel"}

execute as @a[nbt={Inventory:[{components:{"minecraft:custom_data":{questing:1}}}]}] run function ws:misc/mafia/quest/check

execute as @a[nbt={Inventory:[{components:{"minecraft:custom_data":{bomjkill:1}}}]}] run title @s actionbar ["",{"translate":"mafia.killed"},{"color":"dark_red","score":{"name":"@s","objective":"bomjkill"}},{"color":"dark_red","text":""}]
scoreboard players add @a[nbt=!{Inventory:[{components:{"minecraft:custom_data":{bomjkill:1}}}]}] bomjkillrequest 1
scoreboard players set @a[scores={bomjkillrequest=60..}] bomjkill 0
scoreboard players set @a[nbt={Inventory:[{components:{"minecraft:custom_data":{bomjkill:1}}}]}] bomjkillrequest 0

execute as @a[nbt={Inventory:[{components:{"minecraft:custom_data":{gorojankill:1}}}]}] run title @s actionbar ["",{"translate":"mafia.killed"},{"color":"dark_red","score":{"name":"@s","objective":"gorojankill"}},{"color":"dark_red","text":""}]
scoreboard players add @a[nbt=!{Inventory:[{components:{"minecraft:custom_data":{gorojankill:1}}}]}] gorojankillrequest 1
scoreboard players set @a[scores={gorojankillrequest=60..}] gorojankill 0
scoreboard players set @a[nbt={Inventory:[{components:{"minecraft:custom_data":{gorojankill:1}}}]}] gorojankillrequest 0