Skip to content

Commit

Permalink
Added PE 0.1.3 and below Level and Player format docs
Browse files Browse the repository at this point in the history
  • Loading branch information
BJTMastermind committed Sep 29, 2024
1 parent 8c2dad8 commit 02aa41f
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Bedrock/PE_0.1.3_and_below_Level_Format.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Pocket Edition 0.1.3 and Below `level.dat` Format

## Byte Order

level.dat is stored in **Big Endian** byte order.

## Parsing level.dat

| 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). |
| 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 |
| Estimated World Size | 8 | The world size represented in bits |
| Last Played | 4 | Unix timestamp indicating when the level was last saved.[\[1\]](#1) |
| World Name Length | 2 | The length of the world name. |
| World Name | Variable | A [CP437](https://en.wikipedia.org/wiki/Code_page_437) encoded string. |

## Notes

1. <a id="1"></a> Will overflow and become negative at **03:14:08 UTC on 19 January 2038** due to [the year 2038 problem](https://en.wikipedia.org/wiki/Year_2038_problem) and will overflow every ~136 years after that.
25 changes: 25 additions & 0 deletions Bedrock/PE_0.1.3_and_below_Player_Format.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Pocket Edition 0.1.3 and Below `player.dat` Format

## Byte Order

level.dat is stored in **Little Endian** byte order.

## Parsing level.dat

| 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. |
| 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. |
| Motion X | 4 | The players motion in the X direction. |
| Motion Y | 4 | The players motion in the Y direction. |
| Motion Z | 4 | The players motion in the Z direction. |
| Pitch | 4 | The players looking pitch. |
| Yaw | 4 | The players looking yaw. |
| Unknown | 4 | |
| 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. |

2 comments on commit 02aa41f

@genericpnpmonit0r
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

player format still refers to itself as level.dat
and i am not sure if the byte order is correct on the level format (arent all MCPE files LE order?)

@BJTMastermind
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I separated them since they are separate files in 0.1.0 - 0.1.3. (level.dat and player.dat)

I got the info for these from https://minecraft.wiki/w/Bedrock_Edition_level_format/v0.1.0_alpha

I am currently working on getting a 0.1.3 PE world to verify everything. if anything is wrong ill fix it once i verify it from the real files.

Please sign in to comment.