Skip to content

Commit

Permalink
Updated PE 0.1.3 Level and Player format docs
Browse files Browse the repository at this point in the history
  • Loading branch information
BJTMastermind committed Sep 30, 2024
1 parent 02aa41f commit a16dfc5
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
14 changes: 11 additions & 3 deletions Bedrock/PE_0.1.3_and_below_Level_Format.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,22 @@

## Byte Order

level.dat is stored in **Big Endian** byte order.
level.dat is stored in **Big Endian** byte order unless mentioned otherwise.

## Parsing level.dat

***Header***

| Name | Size (in bytes) | Description |
|------|-----------------|-------------|
| Version | 4 | The version used to save the file. Always 1. Stored in **Little Endian** |
| Size | 4 | The size of the file subtracting the header. Stored in **Little Endian** |

***Global World Data***

| Name | Size (in bytes) | Description |
|------|-----------------|-------------|
| Version | 4 | The version used to save the file. Always 1. |
| Size | 4 | The size of the file subtracting the header(Version and Size). |
| Seed | 4 | The seed of the world |
| Spawn X | 4 | The X coordinate of the world spawn point |
| Spawn Y | 4 | The Y coordinate of the world spawn point |
| Spawn Z | 4 | The Z coordinate of the world spawn point |
Expand Down
24 changes: 21 additions & 3 deletions Bedrock/PE_0.1.3_and_below_Player_Format.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@ level.dat is stored in **Little Endian** byte order.

## Parsing level.dat

***Header***

| Name | Size (in bytes) | Description |
|------|-----------------|-------------|
| Version | 4 | The version used to save the file. Always 1. |
| Size | 4 | The size of the file subtracting the header(Version and Size). Always 80. |
| Size | 4 | The size of the file subtracting the header. Always 80. |

***Player Data***

| Name | Size (in bytes) | Description |
|------|-----------------|-------------|
| Pos X | 4 | The X coordinate of the players position. |
| Pos Y | 4 | The Y coordinate of the players position. |
| Pos Z | 4 | The Z coordinate of the players position. |
Expand All @@ -18,8 +25,19 @@ level.dat is stored in **Little Endian** byte order.
| Motion Z | 4 | The players motion in the Z direction. |
| Pitch | 4 | The players looking pitch. |
| Yaw | 4 | The players looking yaw. |
| Unknown | 4 | |
| Unknown | 4 | Maybe an unused Roll value[\[needs testing\]](.) |
| Fire | 2 | The number of ticks until the fire is put out. Negative values reflect how long the player can stand in fire before burning. Default -20. |
| Air | 2 | How much air the player has, in ticks. Fills to a maximum of 300 in air. Decreases while underwater. |
| Unknown | 4 | |
| Hotbar | 36 | 9 slots that take up 4 bytes each, the first 2 bytes is the item ID, The next 2 bytes is the items data value. The last slot is always saved as `0xFF` for every byte. |

***Hotbar***

Loop the next section `9` times until you have parsed all slots of the hotbar.

| Name | Size (in bytes) | Description |
|------|-----------------|-------------|
| Item Id | 4 | The [ID](https://minecraft.wiki/w/Pocket_Edition_data_values_Pre-v0.2.0_alpha) of the item. |

The 9th slot is always `0xFFFFFFFF` representing the open inventory button with the 3 dots (`•••`).

Depending on the device some slots may not be shown in game but all 9 slots are still saved to the file. For example if in game only shows 3 item slots they will be stored as the first 3 items in the hotbar.

0 comments on commit a16dfc5

Please sign in to comment.