// priority: 0

global.common = [
    "poop",
    "broom",
    "alumite_ingot",
	"cake_mould",
    "carminite",
    "charred_meat",
    
];
global.foods = [
    "eggnoodle",
    "meatnoodle",
    "noodle",
    "vegesnoodle",
	
    
];
global.rare = [
    "blue_loot_bag",
    "green_loot_bag",
    "advanced_alga_essences_ingot",
    "singularity",
    "runes_ingot",
    "bismuth_ingot",
    "gelatum",

    "red_aurum_ingot",
    "recast_shadow_steel",
    "dark_energy_ingot",

    
    
];
global.epic = [

    "purple_loot_bag",
    "orange_loot_bag",
    "coin_point",
    "magical_ingot",
    "sky_cake",
    "medal",
    "rainbow_nugget",
    "universe_energy_ingot",
    "energy_superconductivity_ingot",
    "shadow_ingot",
    "magic_crystal",
    "sky_gem",
    "focus_singularity",
    "rainbow_crystal",
    "unlock_all_progressions_book",
    "unlock_all_fragment_book",
    "skykeyroll",

    
];

StartupEvents.registry('item', event => {

    global.common.forEach((c) => {
        event.create("nwtc:" + c.toLowerCase());
       
    });
    global.rare.forEach((r) => {
        event.create("nwtc:" + r.toLowerCase()).rarity("RARE");
       
    });
    global.epic.forEach((e) => {
        event.create("nwtc:" + e.toLowerCase()).rarity("EPIC");
       
    });
    event.create("nwtc:keyroll").maxDamage(50).rarity("EPIC").maxStackSize(1);
    event.create("nwtc:void_keys").maxDamage(100).rarity("EPIC").maxStackSize(1);
    event.create("nwtc:mining_keys").maxDamage(100).rarity("EPIC").maxStackSize(1);
    event.create("nwtc:tpfeather").maxDamage(10).rarity("EPIC").maxStackSize(1);
    global.foods.forEach((f) => {
        event.create("nwtc:" + f.toLowerCase()).rarity("RARE").maxStackSize(64)
    });
    

})
ItemEvents.modification(event => {
    event.modify('pamhc2foodcore:freshwateritem', item => {
        item.foodProperties = food => {
            food.hunger(0)
            food.effect("hunger", 600, 0, 1)
        }
    })
    event.modify('nwtc:eggnoodle', item => {
        item.foodProperties = food => {
            food.hunger(5)
            food.saturation(1)
            food.alwaysEdible(true)//不饿的时候也可以吃
            food.fastToEat(true)    //吃的快
            food.effect('minecraft:night_vision', 360, 1, 0.125)    //夜视buff
            food.effect('minecraft:haste', 180, 1, 0.125)           //急迫buff
            food.effect('minecraft:strength', 120, 2, 0.325)        //力量2buff
            food.effect('minecraft:regeneration', 200, 1, 0.5)     //生命再生buff
        }
    })
    event.modify('nwtc:meatnoodle', item => {
        item.foodProperties = food => {
            food.hunger(9)
            food.saturation(1.5)
            food.alwaysEdible(true)//不饿的时候也可以吃
            food.fastToEat(true)    //吃的快
            food.effect('minecraft:night_vision', 360, 1, 0.125)    //夜视buff
            food.effect('minecraft:haste', 180, 1, 0.125)           //急迫buff
            food.effect('minecraft:strength', 120, 2, 0.725)        //力量2buff
            food.effect('minecraft:regeneration', 200, 1, 1)     //生命再生buff
        }
    })
    event.modify('nwtc:noodle', item => {
        item.foodProperties = food => {
            food.hunger(4)
            food.saturation(1)
            food.alwaysEdible(true)//不饿的时候也可以吃
            food.fastToEat(true)    //吃的快
            food.effect('minecraft:hunger', 360, 1, 0.425)    //饥饿
            food.effect('minecraft:haste', 180, 1, 0.125)           //急迫buff
            food.effect('minecraft:strength', 120, 2, 0.725)        //力量2buff
        }
    })
    event.modify('nwtc:vegesnoodle', item => {
        item.foodProperties = food => {
            food.hunger(6)
            food.saturation(1.3)
            food.alwaysEdible(true)//不饿的时候也可以吃
            food.fastToEat(true)    //吃的快
            food.effect('minecraft:haste', 480, 1, 0.425)           //急迫buff
            food.effect('minecraft:strength', 420, 2, 0.725)        //力量2buff
        }
    })


    
  })

