import {
  world,
  system
} from "@minecraft/server";

world.beforeEvents.worldInitialize.subscribe(initEvent => {
  initEvent.itemComponentRegistry.registerCustomComponent('auxillium:auxillium_apple', {
    onConsume(e) {
      const player = e.source;
      
      player.addEffect('resistance', 100, {amplifier: 4, showParticles: true});
      player.addEffect('regeneration', 300, {amplifier: 2, showParticles: true});
      player.addEffect('speed', 6000, {amplifier: 1, showParticles: true});
      player.addEffect('jump_boost', 6000, {amplifier: 1, showParticles: true});

    }
  });
});