
# --> (@EVENT: applied mold to a clay mold /// ID: 100,000)

# -> Remove dialog
tag @s add OverlyRealistic.UI.NeedsDialogUiCleared
schedule function overly_realistic:players/non_setting_triggers/events/event_100000/clear_ui 1t append

# -> Globalize clay mold ID
scoreboard players operation #or.current_clay_mold_id OverlyRealistic.General.ArbitraryData = @s OverlyRealistic.Player.UseItem_ClayMold

# -> Set mold type for clay mold
execute as @e[type=interaction,tag=OverlyRealistic.Block.ClayMold,distance=..16] \
    if score @s OverlyRealistic.General.ArbitraryData = #or.current_clay_mold_id OverlyRealistic.General.ArbitraryData run \
        function overly_realistic:players/non_setting_triggers/events/event_100000/get_mold_type

# -> Message
tellraw @s \
    [\
        {text:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"},\
        {text:"Molded a piece of clay!\nCheck your advancements tab to check clay mold recipes!\n",color:"#5e5e5e"}\
    ]

# -> Particles
execute anchored eyes run \
    particle block{block_state:"clay"} ^ ^ ^0.7 0 0 0 0.1 3 normal @a

# -> Sound
playsound block.gravel.break block @a ~ ~ ~ 0.3 1
