import "scripts/morphing_bracelet.js";
import "scripts/mob_items.js";
import "scripts/on_hit.js";
import "scripts/food_eaten.js";
import "scripts/store_nectar.js";
import "scripts/witch_potion.js";

import { world, system } from "mojang-minecraft";

system.events.beforeWatchdogTerminate.subscribe(data => {
  data.cancel = true;
});

if (JSON.parse(world.getDimension("overworld").runCommand("gamerule").details).showtags == true) {
  world.getDimension("overworld").runCommand("gamerule showtags false");
};

world.events.tick.subscribe(data => {
  for (let player of Array.from(world.getPlayers())) {
    if (player.getComponent("minecraft:variant").value != 0) {
      player.nameTag = "";
    } else {
      player.nameTag = player.name;
    };
  };
});