import { world} from '@minecraft/server'
import './bosses/bosses'
import './bosses/scriptevent'
import './items/items'

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.itemComponentRegistry.registerCustomComponent('ns_ab:potion_regeneration', {
        onConsume(arg) {
          arg.source.addEffect("regeneration", 22*20,{showParticles:true, amplifier:1});
        }
      });
    initEvent.itemComponentRegistry.registerCustomComponent('ns_ab:potion_instant_health', {
        onConsume(arg) {
            arg.source.addEffect("instant_health", 20,{showParticles:true, amplifier:1});
        }
    });
})
