import { system, world } from '@minecraft/server';
import { decrementStack, getOppositeDirection, DirectionType, cardinalSides, randomFunction } from './utils/helper';
import { directionToVector3 } from './utils/math';

system.beforeEvents.startup.subscribe(initEvent => { initEvent.itemComponentRegistry.registerCustomComponent('steve_cursed_heart:trigger', {
  onUse: e => { e.source.runCommand("function cursedheart"); },
});

initEvent.itemComponentRegistry.registerCustomComponent('steve_darkness_heart:trigger', {
  onUse: e => { e.source.runCommand("function darkheart"); },
});

initEvent.itemComponentRegistry.registerCustomComponent('steve_heart_of_genesis:trigger', {
  onUse: e => { e.source.runCommand("function genesisheart"); },
});

initEvent.itemComponentRegistry.registerCustomComponent('steve_heart_of_friendship:trigger', {
  onConsume: e => {
  e.source.addEffect("minecraft:regeneration", 120, {amplifier: 2});
  
},

  
});

initEvent.itemComponentRegistry.registerCustomComponent('steve_heart_of_winter:trigger', {
  onUse: e => { e.source.runCommand("function winterspawn"); },
});

initEvent.itemComponentRegistry.registerCustomComponent('steve_nightmare_heart:trigger', {
  onUse: e => { e.source.runCommand("function nightmare"); },
});

initEvent.itemComponentRegistry.registerCustomComponent('steve_shadow_sword:trigger', {
  
  onUseOn: e => { e.source.runCommand("function darksword"); },
  
  
});
 });

