PHPackages                             stilling/snbt-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. stilling/snbt-parser

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

stilling/snbt-parser
====================

Turn Minecraft SNBT data into the corresponding PHP data types.

v0.3.0(2mo ago)07[1 PRs](https://github.com/m-stilling/snbt-parser-php/pulls)MITPHPPHP ^8.4CI passing

Since Aug 27Pushed 2mo agoCompare

[ Source](https://github.com/m-stilling/snbt-parser-php)[ Packagist](https://packagist.org/packages/stilling/snbt-parser)[ RSS](/packages/stilling-snbt-parser/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (5)Dependencies (3)Versions (7)Used By (0)

SNBT Parser
===========

[](#snbt-parser)

[![tests](https://github.com/m-stilling/snbt-parser-php/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/m-stilling/snbt-parser-php/actions/workflows/tests.yml) [![Packagist Version](https://camo.githubusercontent.com/4d04758f0bd24ab775a9e78c3e339f522aabb35af4cc1bd6f0e846152f9adbc4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7374696c6c696e672f736e62742d706172736572)](https://packagist.org/packages/stilling/snbt-parser)

Turn [Minecraft SNBT](https://minecraft.wiki/w/NBT_format#SNBT_format) data into the corresponding PHP data types.

```
composer require stilling/snbt-parser

```

Tip

Need to fetch this data from a server first? [`stilling/minecraft-rcon`](https://packagist.org/packages/stilling/minecraft-rcon) is a lightweight Minecraft RCON client that handles multi-packet responses - run commands like `data get ...` and feed the output straight into this parser.

Note

Under the hood this package transposes the SNBT to JSON and decodes it with `json_decode()`. Numeric values keep their full precision, but the NBT type suffixes are not retained - every integer type (`b`/`s`/`i`/`l`) becomes a PHP `int` and every floating-point type (`f`/`d`) becomes a PHP `float`. A potential v2 may parse SNBT directly to preserve type information and skip the JSON round-trip.

Here's an example parsing the SNBT data of a chest using the following command: `data get block -40 73 -11`

```
use Stilling\SNBTParser\SNBTParser;

SNBTParser::parse('{z: -11, x: -40, id: "minecraft:chest", y: 73, Items: [{count: 1, Slot: 0b, id: "minecraft:golden_horse_armor"}, {count: 1, Slot: 1b, id: "minecraft:saddle"}, {count: 1, Slot: 2b, components: {"minecraft:repair_cost": 1, "minecraft:enchantments": {"minecraft:luck_of_the_sea": 2, "minecraft:lure": 2, "minecraft:unbreaking": 3}, "minecraft:damage": 10}, id: "minecraft:fishing_rod"}, {count: 1, Slot: 3b, id: "minecraft:shield"}]}')

// returns ->

[
    "z" => -11,
    "x" => -40,
    "id" => "minecraft:chest",
    "y" => 73,
    "Items" => [
        [
            "count" => 1,
            "Slot" => 0,
            "id" => "minecraft:golden_horse_armor",
        ],
        [
            "count" => 1,
            "Slot" => 1,
            "id" => "minecraft:saddle",
        ],
        [
            "count" => 1,
            "Slot" => 2,
            "components" => [
                "minecraft:repair_cost" => 1,
                "minecraft:enchantments" => [
                    "minecraft:luck_of_the_sea" => 2,
                    "minecraft:lure" => 2,
                    "minecraft:unbreaking" => 3,
                ],
                "minecraft:damage" => 10,
            ],
            "id" => "minecraft:fishing_rod",
        ],
        [
            "count" => 1,
            "Slot" => 3,
            "id" => "minecraft:shield",
        ],
    ],
]
```

Converting UUIDs
----------------

[](#converting-uuids)

Minecraft stores UUIDs as four-integer arrays (e.g. `UUID: [I; 110787060, 1156138790, -1514210135, 238594805]`). Once parsed, pass that array to `intsToUuid()` to get the canonical string form:

```
use Stilling\SNBTParser\SNBTParser;

SNBTParser::intsToUuid([110787060, 1156138790, -1514210135, 238594805]);

// returns -> "069a79f4-44e9-4726-a5be-fca90e38aaf5"
```

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance87

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~72 days

Total

5

Last Release

64d ago

PHP version history (2 changes)v0.1.0PHP ^8.3|^8.4

v0.2.0PHP ^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/36037304?v=4)[stilling](/maintainers/stilling)[@stilling](https://github.com/stilling)

---

Top Contributors

[![m-stilling](https://avatars.githubusercontent.com/u/5173683?v=4)](https://github.com/m-stilling "m-stilling (38 commits)")

---

Tags

minecraftnbtsnbtNBTminecraftsnbt

###  Code Quality

TestsPest

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/stilling-snbt-parser/health.svg)

```
[![Health](https://phpackages.com/badges/stilling-snbt-parser/health.svg)](https://phpackages.com/packages/stilling-snbt-parser)
```

###  Alternatives

[mwgg/airports

A JSON collection of ~29k entries with basic information about nearly every airport and landing strip in the world

7683.4k](/packages/mwgg-airports)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9845.4k](/packages/sauladam-shipment-tracker)[glauberportella/cnab-layouts-parser

Parser de arquivos de configuração CNAB gerados no projeto https://github.com/glauberportella/cnab-layouts

2154.5k](/packages/glauberportella-cnab-layouts-parser)[rickselby/nbt

Parser/Writer for the NBT file format

171.3k1](/packages/rickselby-nbt)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.4k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
