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.2.0(5mo ago)06MITPHPPHP ^8.4CI passing

Since Aug 27Pushed 4mo 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 1mo ago

READMEChangelog (4)Dependencies (1)Versions (5)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

```

Note

Technically, this package transposes the SNBT data to JSON and parses that using `json_decode()`, which may not be too performant. A potential v2 may parse SNBT directly.

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",
        ],
    ],
]
```

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance74

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

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 ~48 days

Total

4

Last Release

163d 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 (20 commits)")

---

Tags

minecraftnbtsnbtNBTminecraftsnbt

###  Code Quality

TestsPest

### 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

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19139.2M45](/packages/mck89-peast)[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.

9843.5k](/packages/sauladam-shipment-tracker)[rickselby/nbt

Parser/Writer for the NBT file format

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

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

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

PHPackages © 2026

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