
# -> Tag player
#tag @s add OverlyRealistic.Player.TempPlayer

# --> Interaction checks

# -> If the player is shifting then remove all items
execute if score @s OverlyRealistic.PredicateValue.IsSneaking matches 1 run \
    return run \
        scoreboard players set #or.preparation_plate_interaction_type OverlyRealistic.General.ArbitraryData 4

# -> If the player is not holding any items then craft items
execute unless items entity @s weapon.mainhand * run \
    return run \
        scoreboard players set #or.preparation_plate_interaction_type OverlyRealistic.General.ArbitraryData 1

# -> Store currently used item
item replace entity 00000001-0000-002b-0000-00010000002b contents from entity @s weapon.mainhand overly_realistic:items/set_1_count

# -> If has_specialized_item = true then return and do detections for that
execute if score #or.preparation_plate_has_special_item OverlyRealistic.General.ArbitraryData matches 1 run \
    return run \
        scoreboard players set #or.preparation_plate_interaction_type OverlyRealistic.General.ArbitraryData 2

# -> Add items
scoreboard players set #or.preparation_plate_interaction_type OverlyRealistic.General.ArbitraryData 3
