# ------------ Global --------------------
scoreboard objectives add motion_calc dummy
scoreboard objectives add items_generic dummy
scoreboard objectives add clock dummy

# --------------- Stats -----------------
# stats death update
scoreboard objectives add inv_death deathCount
# Stats calc
scoreboard objectives add stats_calc dummy
scoreboard objectives add stats_num dummy
# Mana
scoreboard objectives add mana dummy
scoreboard players set factor mana 100
scoreboard players operation @a mana = @a mana
scoreboard objectives add mana_speed dummy
scoreboard objectives add mana_capacity dummy
scoreboard objectives add mana_cost dummy
scoreboard objectives add mana_count dummy
# Souls
scoreboard objectives add souls dummy
scoreboard players operation @a souls = @a souls
scoreboard objectives add souls_capacity dummy
# Other specific
scoreboard objectives add curse dummy
scoreboard objectives add luck dummy
scoreboard objectives add dmg dummy
# Selected item
scoreboard objectives add selected_item dummy
# Display mana, kills and coins
tag @a add display_M+K


#----------Spells------------
#Spells casting
scoreboard objectives add cast minecraft.used:minecraft.carrot_on_a_stick
scoreboard objectives add cast_cost dummy
# click and hold cooldown
scoreboard objectives add ch_cooldown dummy


# -------------- Items ------------------
# Passives
scoreboard objectives add vampire_fangs minecraft.custom:minecraft.damage_dealt
scoreboard players set half_heart vampire_fangs 200
scoreboard objectives add food_craving dummy
scoreboard objectives add rat_boots dummy
# Weapons
scoreboard objectives add ice_sword dummy
scoreboard objectives add hexblade dummy
scoreboard objectives add previous_hp dummy
scoreboard objectives add wierd_feather dummy
scoreboard objectives add lightning_hammer dummy
# Armor
scoreboard objectives add creeper_legs dummy
scoreboard objectives add rage_glasses dummy
scoreboard objectives add ice_chestplate dummy
scoreboard objectives add steampunk_armor dummy
# Shard
scoreboard objectives add spinning_shard dummy
# obj
scoreboard objectives add ec_calc dummy
scoreboard players set range ec_calc 18
scoreboard objectives add fd_slot dummy
scoreboard objectives add shadow_clone dummy
# Set
scoreboard objectives add heavy_set dummy
scoreboard objectives add mage_set dummy
scoreboard objectives add life_set dummy
scoreboard objectives add scaled_set dummy
scoreboard objectives add berserker_set dummy
scoreboard objectives add cactus_set dummy
scoreboard objectives add greed_set dummy
scoreboard players set num heavy_set 3
scoreboard players set num mage_set 2
scoreboard players set num life_set 2
scoreboard players set num scaled_set 2
scoreboard players set num berserker_set 2
scoreboard players set num cactus_set 2
scoreboard players set num greed_set 2
# Times times_appeared
scoreboard objectives add times_appeared dummy
scoreboard players set factor times_appeared 5
function items_py:times_appeared_init
# Shop
scoreboard objectives add shop dummy
scoreboard players operation mcoins shop = mcoins shop
scoreboard players operation coins shop = coins shop
execute unless score active shop matches ..0 unless score active shop matches 0.. run scoreboard players set active shop 1
function items_py:mshop/init


# ------- No Colision team ----------------
team add no_colision
team modify no_colision collisionRule never


# -------------- Triggers ------------------
advancement revoke @a only items:inv_update
advancement revoke @a only items:player_hit_entity
advancement revoke @a only items:player_took_dmg
advancement revoke @a only items:player_was_hit
advancement revoke @a only items:player_hit_entity
advancement grant @a only items:inv_update lock

function items:stats_calc/0_schedule
