
# -> If player is not high enough level builder then return
execute on target \
    unless entity @s[gamemode=creative] \
    unless score @s OverlyRealistic.Player.WisdomStats.Building matches 2.. run \
        return run \
            function overly_realistic:general/custom_blocks/scribing_table/interactions/draft_input/large_ship/draft_error_skill

# -> Get player's items (copper ingot)
scoreboard players set #or.player_item_amount_draft_copper OverlyRealistic.General.ArbitraryData 0
execute store result score #or.player_item_amount_draft_copper OverlyRealistic.General.ArbitraryData \
    on target run \
        clear @s copper_ingot 0

# -> If player does not have enough copper ingots then return
execute if score #or.player_item_amount_draft_copper OverlyRealistic.General.ArbitraryData matches ..4 run \
    return run \
        function overly_realistic:general/custom_blocks/scribing_table/interactions/draft_input/large_ship/draft_error_items

# -> Get player's items (stone bricks)
scoreboard players set #or.player_item_amount_draft_stone_bricks OverlyRealistic.General.ArbitraryData 0
execute store result score #or.player_item_amount_draft_stone_bricks OverlyRealistic.General.ArbitraryData \
    on target run \
        clear @s stone_bricks 0

# -> If player does not have enough stone bricks then return
execute if score #or.player_item_amount_draft_stone_bricks OverlyRealistic.General.ArbitraryData matches ..9 run \
    return run \
        function overly_realistic:general/custom_blocks/scribing_table/interactions/draft_input/large_ship/draft_error_items

# -> Remove items from player
execute on target run \
    clear @s copper_ingot 5
execute on target run \
    clear @s stone_bricks 10

# -> Drop ship setup
loot spawn ~ ~1 ~ loot overly_realistic:blocks/ship_setup
