import './config/item.js'
import './jutsu/jutsuparticle/amaterasu.js'
import './jutsu/jutsuparticle/bola_de_fogo.js'
import './jutsu/jutsuparticle/bala_de_terra.js'
import './jutsu/jutsuparticle/dragao_de_crystal.js'
import './jutsu/jutsuparticle/shuriken_papel.js'
import './jutsu/jutsuparticle/aurela_de_papel.js'
import './jutsu/jutsuparticle/bomba_c1.js'
import './jutsu/jutsuparticle/bala_de_crystal.js'
import './jutsu/jutsuparticle/yagura_staff.js'
import './jutsu/jutsuparticle/jutsu_ondas_furiosas.js'
import './jutsu/jutsuparticle/dragao_de_agua.js'
import './jutsu/jutsuparticle/dragao_de_fogo.js'
import './jutsu/jutsuparticle/inseto_aburame.js'
import './jutsu/jutsuparticle/flor_de_fenix.js'
import './jutsu/jutsuparticle/arco_kindomaro.js'
import './jutsu/jutsuparticle/bijuudama.js'
import './jutsu/jutsuparticle/shinra_tensei.js'
import './jutsu/jutsuparticle/rasen_shuriken.js'
import './jutsu/jutsuparticle/cano_bolha.js'
import './jutsu/jutsuparticle/kirin.js'
import './config/indicatordmg.js'
import './trade/config.js'
import './trade/trade.js'
import './modos/modo.js'
import './jutsu/bijuudama.js'
import './jutsu/mobs.js'
import './jutsu/hiraishin.js'
import './jutsu/dragao_de_crystal.js'
import './jutsu/shuriken_papel.js'
import './jutsu/bomba_c1.js'
import './jutsu/aurela_de_papel.js'
import './jutsu/kamui.js'
import './jutsu/yagura_staff.js'
import './jutsu/jutsu_bola_de_fogo.js'
import './jutsu/inseto_aburame.js'
import './jutsu/dragao_de_fogo.js'
import './jutsu/cano_bolha.js'
import './jutsu/arco_kindomaro.js'
import './jutsu/shinra_tensei.js'
import './jutsu/rasen_shuriken.js'
import './jutsu/kirin.js'
import './jutsu/jutsu_ondas_furiosas.js'
import './jutsu/jutsu_clone_de_madeira.js'
import './jutsu/jutsu_amaterasu.js'
import './jutsu/dragao_de_agua.js'
import './jutsu/flor_de_fenix.js'
import './jutsu/bala_de_terra.js'
import './jutsu/bala_de_crystal.js'
import './jutsuconfig/projectil.js'
import './jutsuconfig/genjutsu.js'
import './jutsuconfig/jutsuattack.js'
import './hit/hit.js'
import './hit/gumbai.js'
import './modos/config.js'
import './menu/config.js'
import './menu/main.js'
import './menu/system.js'
import './menu/menus.js'
import './menu/custom/custom.js'
import './dash.js';
import './agua.js';
import './anti_lag.js';
import './attack.js';
import './fly.js';
import './text.js';
import './chakra_consumir.js';

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

const OBJETIVOS = [
  "chakra",
  "ryo",
  "chakraRoubado",
  "chakraMax",
  "level",
  "xp",
  "Tp",
  "saga",
  "choose",
  "upuchiha",
  "uphyuuga",
  "cabelo",
  "chakra_max",
  "bonus_forca",
  "mission",
  "bonus_speed",
  "bonus_vida"
];
function garantirScoreboards() {
  system.run(() => {
    for (const obj of OBJETIVOS) {
      try {
        world.scoreboard.getObjective(obj);
      } catch {
        try {
          world.scoreboard.addObjective(obj, obj);
        } catch {}
      }
    }
  });
}
world.beforeEvents.playerJoin.subscribe(() => {
  garantirScoreboards();
});

system.runInterval(() => {
  garantirScoreboards();
}, 200);