From 10d820cdca8ce984c4bfc2cb47664252742be93b Mon Sep 17 00:00:00 2001 From: Jayly <65847850+JaylyDev@users.noreply.github.com> Date: Sun, 26 May 2024 17:05:04 +0100 Subject: [PATCH] Update initialization.ts --- src/terminator/initialization.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/terminator/initialization.ts b/src/terminator/initialization.ts index c0dc4f7..0dcad9b 100644 --- a/src/terminator/initialization.ts +++ b/src/terminator/initialization.ts @@ -12,7 +12,8 @@ import { MinecraftColor } from "../minecraft-color"; // naming tag terminatorSpawn.subscribe(({ entity }) => { system.runTimeout(() => { - const nameTag = entity.nameTag ?? "Terminator"; + const nameTag = entity.nameTag || "Terminator"; + entity.nameTag = nameTag; const terminators = entity.dimension.getEntities({ type: "entity:terminator", }); @@ -27,8 +28,8 @@ terminatorSpawn.subscribe(({ entity }) => { ); if (terminatorsWithSameName.length > 0) entity.nameTag = `${nameTag} (${terminatorsWithSameName.length})`; - else entity.nameTag = nameTag; } + // broadcast to world const rawtext: RawText = { rawtext: [