UNPKG

@minecraft/creator-tools

Version:

Minecraft Creator Tools command line and libraries.

54 lines (53 loc) 1.63 kB
import NbtBinaryTag from "./NbtBinaryTag"; /** * Represents an entity stored in a chunk's entity data. * This is a lightweight representation used for world map rendering. */ export default class ChunkEntity { /** The entity type identifier (e.g., "minecraft:cow", "minecraft:zombie") */ identifier: string; /** Entity position (absolute world coordinates) */ x: number; y: number; z: number; /** Entity rotation (yaw, pitch) */ yaw?: number; pitch?: number; /** Whether the entity is a baby */ isBaby?: boolean; /** Whether the entity is tamed */ isTamed?: boolean; /** Entity variant (for entities with visual variants) */ variant?: number; /** Entity's unique ID */ uniqueId?: bigint; /** Custom name if set */ customName?: string; /** Entity definitions (component groups) */ definitions?: string[]; constructor(identifier: string, x: number, y: number, z: number); /** * Creates a ChunkEntity from an NBT compound tag. */ static fromNbtTag(root: NbtBinaryTag): ChunkEntity | undefined; /** * Gets a short, human-readable name for this entity type. */ get shortName(): string; /** * Checks if this is a hostile mob. */ get isHostile(): boolean; /** * Checks if this is a passive/friendly mob. */ get isPassive(): boolean; /** * Checks if this is a player entity. */ get isPlayer(): boolean; /** * Gets a category for this entity (for icon selection). */ get category(): "hostile" | "passive" | "player" | "item" | "other"; }