moonscript
Search…
Packets
Credits: https://wiki.vg/index.php?title=Protocol&oldid=7368#Serverbound_2

Keepalive Packet (0x00)

The server will frequently send out a keep-alive, each containing a random ID. The client must respond with the same packet.
Field
Object
Description
id
Number
The random ID mentioned above

Use Entity (0x02)

This packet is sent from the client to the server when the client attacks or right-clicks another entity (a player, minecart, etc).
A Notchian server only accepts this packet if the entity being attacked/used is visible without obstruction and within a 4-unit radius of the player's position.
There are 3 options to send this packet, every option has different arguments
Field
Object
Description
entityId
Number
ID of the entity being used
action
Number
Action being made (see below)
Field
Object
Description
entityId
Number
ID of the entity being used
x
Number
Pos x
y
Number
Pos y
z
Number
Pos z
Field
Object
Description
entityId
Number
ID of the entity being used
action
Number
Action being made (see below)
x
Number
Pos x
y
Number
Pos y
z
Number
Pos z
Here are all actions you can execute:
Interact (0) Attack (1) Interact at (this requires the type with positions supplied) (2)

Player (0x03)

This packet as well as Player Position (Play, 0x04, serverbound), Player Look (Play, 0x05, serverbound), and Player Position And Look (Play, 0x06, serverbound) are called the “serverbound movement packets”. At least one of them must be sent on each tick to ensure that servers will update things like player health correctly. Vanilla clients will send Player Position once every 20 ticks even for a stationary player, and Player on every other tick.
This packet is used to indicate whether the player is on ground (walking/swimming), or airborne (jumping/falling).
When dropping from sufficient height, fall damage is applied when this state goes from false to true. The amount of damage applied is based on the point where it last changed from true to false. Note that there are several movement related packets containing this state.
Field
Object
Description
ground
Boolean
Ground state

Player Position (0x04)

Updates the player's XYZ position on the server.
If the distance between the last known position of the player on the server and the new position set by this packet is greater than 100 units, this will result in the client being kicked for “You moved too quickly :( (Hacking?)”
If the distance is greater than 10 units, the server will log the warning message "<name> moved too quickly!", followed by two coordinate triples (maybe movement delta?), but will not kick the client.
Also if the fixed-point number of X or Z is set greater than 3.2×107 the client will be kicked for “Illegal position”.
Field
Object
Description
x
Number
Pos x
y
Number
Pos y
z
Number
Pos z
ground
Boolean
Ground state

Player Look (0x05)

Updates the direction the player is looking in.
Yaw is measured in degrees, and does not follow classical trigonometry rules. The unit circle of yaw on the XZ-plane starts at (0, 1) and turns counterclockwise, with 90 at (-1, 0), 180 at (0,-1) and 270 at (1, 0). Additionally, yaw is not clamped to between 0 and 360 degrees; any number is valid, including negative numbers and numbers greater than 360.
Pitch is measured in degrees, where 0 is looking straight ahead, -90 is looking straight up, and 90 is looking straight down.
Field
Object
Description
yaw
Number
Rotation yaw
pitch
Number
Rotation pitch
ground
Boolean
Ground state

Player Position and Look (0x06)

A combination of Player Look and Player Position.
Field
Object
Description
x
Number
Pos x
y
Number
Pos y
z
Number
Pos z
yaw
Number
Rotation yaw
pitch
Number
Rotation pitch
ground
Boolean
Ground state

Player Digging (0x07)

Sent when the player mines a block. A Notchian server only accepts digging packets with coordinates within a 6-unit radius of the player's position.
Field
Object
Description
status
Number
The action the player is taking against the block (see below)
x
Number
Pos x of the action
y
Number
Pos y of the action
z
Number
Pos z of the action
facing
Number
The facing being hit (see below)
These are all actions you can take against a block
Meaning
Value
Started digging
0
Cancelled digging
1
Finished digging
2
Drop item stack
3
Drop item
4
Shoot arrow / finish eating
5
Notchian clients send a 0 (started digging) when they start digging and a 2 (finished digging) once they think they are finished. If digging is aborted, the client simply send a 1 (cancel digging).
Status code 4 (drop item) is a special case. In-game, when you use the Drop Item command (keypress 'q'), a dig packet with a status of 4, and all other values set to 0, is sent from client to server. Status code 3 is similar, but drops the entire stack.
Status code 5 (shoot arrow / finish eating) is also a special case. The x, y and z fields are all set to 0 like above, with the exception of the face field, which is set to 255.
The face can be one of six values, representing the face being hit:
Offset
Value
-Y
0
+Y
1
-Z
2
+Z
3
-X
4
+X
5
Not supplying any arguments to this packet will just release your current item.

Player Block Placement (0x08)

Field
Object
Description
x
Number
Pos x
y
Number
Pos y
z
Number
Pos z
playedBlockDirection
Number
Enum facing ordinal number
slot
Number
Slot number of the item being used
facingX
Number
Facing x
facingY
Number
Facing y
facingZ
Number
Facing z
In normal operation (i.e. placing a block), this packet is sent once, with the values set normally.
This packet has a special case where X, Y, Z, and Face are all -1. (Note that Y is unsigned so set to 255.) This special packet indicates that the currently held item for the player should have its state updated such as eating food, pulling back bows, using buckets, etc.
In a Notchian Beta client, the block or item ID corresponds to whatever the client is currently holding, and the client sends one of these packets any time a right-click is issued on a surface, so no assumptions can be made about the safety of the ID. However, with the implementation of server-side inventory, a Notchian server seems to ignore the item ID, instead operating on server-side inventory information and holding selection. The client has been observed (1.2.5 and 1.3.2) to send both real item IDs and -1 in a single session.
Special note on using buckets: When using buckets, the Notchian client might send two packets: first a normal and then a special case. The first normal packet is sent when you're looking at a block (e.g. the water you want to scoop up). This normal packet does not appear to do anything with a Notchian server. The second, special case packet appears to perform the action — based on current position/orientation and with a distance check — it appears that buckets can only be used within a radius of 6 units.

Held Item Change (0x09)

Sent when the player changes the slot selection
Field
Object
Description
slot
Number
The slot which the player has selected (0–8)

Animation (0x0A)

Sent when the player's arm swings

Entity Action (0x0B)

Sent by the client to indicate that it has performed certain actions: sneaking (crouching), sprinting, exiting a bed, jumping with a horse, and opening a horse's inventory while riding it.
Field
Object
Description
entityId
Number
Player ID
action
Number
The ID of the action, see below
auxData
Number
Only used by Horse Jump Boost, in which case it ranges from 0 to 100. In all other cases it is 0.
Action ID can be one of the following values:
ID
Action
0
Start sneaking
1
Stop sneaking
2
Leave bed
3
Start sprinting
4
Stop sprinting
5
Jump with horse
6
Open ridden horse inventory
Leave Bed is only sent when the "Leave Bed" button is clicked on the sleep GUI, not when waking up due today time.
Open ridden horse inventory is only sent when pressing the inventory key on a horse - all other methods of opening a horse's inventory (involving right-clicking or shift-right-clicking it) do not use this packet.

Close Window (0x0D)

This packet is sent by the client when closing a window.
Notchian clients send a Close Window packet with Window ID 0 to close their inventory even though there is never an Open Window packet for the inventory.
Field
Object
Description
windowId
Number
This is the ID of the window that was closed. 0 for player inventory.

Confirm Transaction (0x0F)

If a transaction sent by the client was not accepted, the server will reply with a Confirm Transaction (Play, 0x32, clientbound) packet with the Accepted field set to false. When this happens, the client must reflect the packet to apologize (as with movement), otherwise the server ignores any successive transactions.
Field
Object
Description
windowID
Number
The ID of the window that the action occurred in
actionNumber
Number
Every action that is to be accepted has a unique number. This field corresponds to that number.
accepted
Boolean
Whether the action was accepted

Server Packets

Confirm Transaction (0x32)

A packet from the server indicating whether a request from the client was accepted, or whether there was a conflict (due to lag).
Field
Object
Description
windowId
Number
The ID of the window that the action occurred in
actionNumber
Number
Every action that is to be accepted has a unique number. This field corresponds to that number.

Player Position And Look

Updates the player's position on the server. This packet will also close the "Downloading Terrain" screen when joining/respawning.
If the distance between the last known position of the player on the server and the new position set by this packet is greater than 100 meters, the client will be kicked for “You moved too quickly :( (Hacking?)”.
Also if the fixed-point number of X or Z is set greater than 3.2E7D the client will be kicked for “Illegal position”.
Yaw is measured in degrees, and does not follow classical trigonometry rules. The unit circle of yaw on the XZ-plane starts at (0, 1) and turns counterclockwise, with 90 at (-1, 0), 180 at (0, -1) and 270 at (1, 0). Additionally, yaw is not clamped to between 0 and 360 degrees; any number is valid, including negative numbers and numbers greater than 360.
Pitch is measured in degrees, where 0 is looking straight ahead, -90 is looking straight up, and 90 is looking straight down.
The yaw and pitch of player (in degrees), standing at point (x0, y0, z0) and looking towards point (x, y, z) one can be calculated with:
Field
Object
Description
x
Number
Absolute or relative position, depending on Flags
y
Number
Absolute or relative position, depending on Flags
z
Number
Absolute or relative position, depending on Flags
yaw
Number
Absolute or relative rotation on the X Axis, in degrees
pitch
Number
Absolute or relative rotation on the X Axis, in degrees

Any packets missing?

More packets will be added in future versions of moonscript, these are the most necessary ones to make bypasses.
Last modified 6mo ago