I don't know why this isn't working, I've also never used scripts
// Event triggered when an item is used
Minecraft.world.afterEvents.itemUse.subscribe(({ itemStack, source }) => {
// Add a tag to the player using the item, marking the item with its name tag
const tagName = `leftClick:${itemStack.nameTag}`;
source.addTag(tagName);
// Run a timeout to remove the tag after a short period
Minecraft.system.runTimeout(() => {
source.runCommandAsync(`tag @s remove ${tagName}`);
});
});
// Event triggered when the world is initialized
Minecraft.world.afterEvents.worldInitialize.subscribe(() => {
console.warn("<System> Creator; §oTooOzzy§r.");
});```