Skip to content
mc-protocol
Esc
↑↓navigate↵open⌘Jpreview
On this page

Teleport Entity

Play 0x7D, server → client.

play · 0x7D · clientbound (server → client)

Moves an entity to an absolute or relative position with velocity and rotation. The server sends it when an entity moves too far for delta movement packets or is teleported. flags mark which values are relative; the client applies them and sets onGround.

Sent by the server, read by the client. Listen for it with client.on("TeleportEntity", (data) => …) on the receiving side.

Fields

Field Type Notes
entityId VarInt
x Double
y Double
z Double
velocityX Double
velocityY Double
velocityZ Double
yaw Float
pitch Float
flags UInt32
onGround Boolean

Send it

import { helpers } from "mc-protocol";

await client.sendPacket("TeleportEntity", {
  entityId: 42,
  x: 10, y: 65, z: 10,
  velocityX: 0, velocityY: 0, velocityZ: 0,
  yaw: 90, pitch: 0,
  flags: helpers.teleportFlags({ velocityX: true, velocityY: true, velocityZ: true }),
  onGround: true,
});

flags uses the same bits as SynchronizePlayerPosition. Here the position is absolute and the velocity fields are added to the entity’s current velocity. See Packet flags.

Field aliases listed under Notes are accepted as alternative keys when writing.

Source: src/Core/Versions/776/Packets/play/clientbound/TeleportEntity.ts

Was this page helpful?