
//纳米修复
PlayerEvents.tick(event => {
    let player = event.entity;
    // 每秒执行一次
    if (player.age % 22 != 0 || !player) return
    let armor = [
        player.getHeadArmorItem(),
        player.getChestArmorItem(),
        player.getLegsArmorItem(),
        player.getFeetArmorItem(),
    ]
    armor.forEach(armor => {
        if (armor.id.toString().startsWith('tetra')) {
            let level = simpleGetTetraEffectLevel(armor, 'nanorepair')
            if (level > 0) {
                let damage = armor.nbt.armorplates_damage_value
                if (damage != null) {
                    armor.nbt.armorplates_damage_value = Math.max(armor.nbt.armorplates_damage_value -1,0)
                }
            }
        }
    })
})