import { world, system } from "@minecraft/server";
import * as utils from "./utils";
import * as Vector3 from "./vector3";

export async function onScriptEventReceive(event) {
	const source = event.sourceEntity;
    if (event.message === "spawned") {
        source.nameTag = "Interact on the §dTreasure Chest§f to loot it";
        // if (source.typeId === "goe_bos:lair_chest")
        //     source.nameTag = "Use §9Lair Chest Key§r to unlock it";
        // else if (source.typeId === "goe_bos:treasure_chest")
        //     source.nameTag = "Use §5Treasure Chest Key§r to unlock it";
    }
    else if (event.message === "opened") {
        source.nameTag = "";
    }
}