import { world } from "@minecraft/server";
import { getScore } from "../utils/score";



world.afterEvents.itemStartUse.subscribe((eventData) => {
    const { source, itemStack, useDuration } = eventData;
    if(itemStack.getTags().includes('minecraft:is_spear'))
    {
        source.triggerEvent("no_knockback")
        const s = world.scoreboard.getObjective('Spear_use_time');
        s.setScore(source, 16)
    }
})