1
0
mirror of https://github.com/Mojang/bedrock-protocol-docs.git synced 2025-10-17 22:45:29 +00:00
Files
bedrock-protocol-docs/docs/CorrectPlayerMovePredictionPacket.html

314 lines
7.8 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CorrectPlayerMovePredictionPacket (161)</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
margin: 0;
padding: 20px;
background-color: #f5f5f5;
line-height: 1.6;
}
.container {
max-width: 1200px;
margin: 0 auto;
background-color: white;
padding: 30px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
h1 {
color: #2c3e50;
border-bottom: 3px solid #3498db;
padding-bottom: 10px;
margin-top: 0;
}
h2 {
color: #34495e;
border-bottom: 2px solid #3498db;
padding-bottom: 5px;
margin-top: 30px;
}
h3 {
color: #555;
margin-top: 20px;
margin-bottom: 10px;
}
h4 {
color: #666;
margin-top: 15px;
margin-bottom: 8px;
}
table {
background-color: white;
font-size: 14px;
margin-bottom: 10px;
}
th {
font-weight: bold;
text-align: left;
padding: 8px !important;
}
td {
padding: 8px !important;
}
tr:nth-child(even) {
background-color: #f9f9f9;
}
tr:hover {
background-color: #e8f4f8;
}
.description {
color: #555;
font-style: italic;
margin: 10px 0 20px 0;
padding: 10px;
background-color: #f8f9fa;
border-left: 4px solid #3498db;
}
a {
color: #3498db;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.packet-list {
columns: 3;
column-gap: 20px;
}
.packet-list li {
margin-bottom: 8px;
break-inside: avoid;
}
@media (max-width: 900px) {
.packet-list {
columns: 2;
}
}
@media (max-width: 600px) {
.packet-list {
columns: 1;
}
}
</style>
</head>
<body>
<div class="container">
<p><a href="index.html">← Back to Index</a></p>
<h1>CorrectPlayerMovePredictionPacket (161)</h1>
<div class="description">Sent to a player when their simulation of movement mismatches enough from the server that it wants to correct the client.</div>
<div class="description">Used only in server authoritative movement mode, see ServerAuthMovementMode documentation.&lt;br&gt;
Since it is sent to the specified client the target player is implied to be the receiver.&lt;br&gt;
It is an optional part of the server authoritative protocol. A server could choose to never send this or do all corrections
through MovePlayerPacket, although doing so would likely provide less smooth results.</div>
<div style="margin-left: 0px; margin-top: 10px;">
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse; width: 100%; max-width: 800px;">
<thead>
<tr style="background-color: #f0f0f0;">
<th>Field Name</th>
<th>Type</th>
<th>Ordinal Index</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2"><strong>PredictionType</strong></td>
<td>uint8</td>
<td>0</td>
<td>Vehicle or Player Prediction</td>
</tr>
<tr>
<td colspan="3"><div style="margin-left: 20px; margin-top: 5px; margin-bottom: 5px;">
<strong>Enum Values:</strong>
<table border="1" cellpadding="3" cellspacing="0" style="border-collapse: collapse; width: 100%; max-width: 760px; font-size: 12px;">
<thead>
<tr style="background-color: #e8e8e8;">
<th style="width: 40px;">Index</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center;">0</td>
<td><code>Player</code></td>
</tr>
<tr>
<td style="text-align: center;">1</td>
<td><code>Vehicle</code></td>
</tr>
</tbody>
</table>
</div></td>
</tr>
<tr>
<td rowspan="2"><strong>Pos</strong></td>
<td>Vec3</td>
<td>1</td>
<td>Corrected position</td>
</tr>
<tr>
<td colspan="3"><div style="margin-left: 20px; margin-top: 10px;">
<h3>Vec3</h3>
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse; width: 100%; max-width: 800px;">
<thead>
<tr style="background-color: #f0f0f0;">
<th>Field Name</th>
<th>Type</th>
<th>Ordinal Index</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>X</strong></td>
<td>float</td>
<td>0</td>
<td></td>
</tr>
<tr>
<td><strong>Y</strong></td>
<td>float</td>
<td>1</td>
<td></td>
</tr>
<tr>
<td><strong>Z</strong></td>
<td>float</td>
<td>2</td>
<td></td>
</tr>
</tbody>
</table>
</div></td>
</tr>
<tr>
<td rowspan="2"><strong>Pos Delta</strong></td>
<td>Vec3</td>
<td>2</td>
<td>Corrected velocity</td>
</tr>
<tr>
<td colspan="3"><div style="margin-left: 20px; margin-top: 10px;">
<h3>Vec3</h3>
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse; width: 100%; max-width: 800px;">
<thead>
<tr style="background-color: #f0f0f0;">
<th>Field Name</th>
<th>Type</th>
<th>Ordinal Index</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>X</strong></td>
<td>float</td>
<td>0</td>
<td></td>
</tr>
<tr>
<td><strong>Y</strong></td>
<td>float</td>
<td>1</td>
<td></td>
</tr>
<tr>
<td><strong>Z</strong></td>
<td>float</td>
<td>2</td>
<td></td>
</tr>
</tbody>
</table>
</div></td>
</tr>
<tr>
<td rowspan="2"><strong>Rotation</strong></td>
<td>Vec2</td>
<td>3</td>
<td>Corrected rotation. Only sent when PredictionType is Vehicle</td>
</tr>
<tr>
<td colspan="3"><div style="margin-left: 20px; margin-top: 10px;">
<h3>Vec2</h3>
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse; width: 100%; max-width: 800px;">
<thead>
<tr style="background-color: #f0f0f0;">
<th>Field Name</th>
<th>Type</th>
<th>Ordinal Index</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>X</strong></td>
<td>float</td>
<td>0</td>
<td></td>
</tr>
<tr>
<td><strong>Y</strong></td>
<td>float</td>
<td>1</td>
<td></td>
</tr>
</tbody>
</table>
</div></td>
</tr>
<tr>
<td><strong>VehicleAngularVelocity</strong></td>
<td>float</td>
<td>4</td>
<td>Angular Velocity for a vehicle. Only sent when PredictionType is Vehicle</td>
</tr>
<tr>
<td><strong>On Ground</strong></td>
<td>boolean</td>
<td>5</td>
<td>Is on ground</td>
</tr>
<tr>
<td rowspan="2"><strong>Tick</strong></td>
<td>PlayerInputTick</td>
<td>6</td>
<td>Which frame we&#x27;re correcting; should match the tick in the Player Auth Input packet</td>
</tr>
<tr>
<td colspan="3"><div style="margin-left: 20px; margin-top: 10px;">
<h3>PlayerInputTick</h3>
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse; width: 100%; max-width: 800px;">
<thead>
<tr style="background-color: #f0f0f0;">
<th>Field Name</th>
<th>Type</th>
<th>Ordinal Index</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Input tick</strong></td>
<td>varuint64</td>
<td>0</td>
<td>In server authoritative movement mode the client supplies this in PlayerAuthInputPacket.
For any client-bound packets containing a tick, the server should supply the tick value corresponding to the most recently processed PlayerAuthInputPacket.
This allows the client to adjust any client predictions made while the packet was in flight.
If the packet is being sent to the client but not relating to data of the player or a client-predicted vehicle, it can be zero.
It is also acceptable to specify zero for players, although this may lead to minor visual flickers and less smooth application of CorrectPlayerMovePredictionPacket.</td>
</tr>
</tbody>
</table>
</div></td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>