const scoreboardArtifacts = [
  "ring_of_swiftness",
  "slimy_boots",
  "shield_of_ashes",
  "eye_of_sight",
  "amulet_of_attraction",
  "silver_shovel",
  "skull",
];

/**
 * @param {import("@minecraft/server").Player} player
 */
export function toggleArtifacts(player) {
  for (const objective of scoreboardArtifacts) {
    player.runCommandAsync(`scoreboard players reset @s ${objective}`);
  }
  if (player.getProperty("myth:forest_amulet")) {
    player.triggerEvent("myth:forest_amulet.toggle");
  }
  if (player.getProperty("myth:leam_hammer")) {
    player.triggerEvent("myth:leam_hammer.toggle");
  }
  if (player.getProperty("myth:shield_of_shadow")) {
    player.triggerEvent("myth:shield_of_shadow.toggle");
  }
  if (player.getProperty("myth:torch")) {
    player.triggerEvent("myth:torch.toggle");
  }
}
