Skip to content

GameEntity

STBrian edited this page Nov 9, 2026 · 1 revision

GameEntity represents an in-game entity (such as mobs, animals, or projectiles) loaded into the current Minecraft world.

Properties

X number The entity's coordinate on the X axis
Y number The entity's coordinate on the Y axis
Z number The entity's coordinate on the Z axis
EntityID integer Read-only entity type identifier

Example

local target = Game.World.getTargetEntity()
if target then
    Core.Debug.message("Target entity ID: " .. tostring(target.EntityID))
    Core.Debug.message(string.format("Position: %.2f, %.2f, %.2f", target.X, target.Y, target.Z))
end

See also

Clone this wiki locally