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

system.runInterval(() => {
    const players = world.getAllPlayers();
    for (const player of players) {
        if (player.isValid() && player.dimension) {
            player.runCommandAsync("function addon_tick").catch(() => {});
        }
    }
}, 10);

system.runInterval(() => {
    const players = world.getAllPlayers();
    for (const player of players) {
        if (player.isValid() && player.dimension) {
            player.runCommandAsync("event entity @e[family=bullet] entity:despawn").catch(() => {});
        }
    }
}, 100);