stilling/snbt-parser
最新稳定版本:v0.1.2
Composer 安装命令:
composer require stilling/snbt-parser
包简介
Turn Minecraft SNBT data into the corresponding PHP data types.
关键字:
README 文档
README
Turn Minecraft SNBT 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", ], ], ]
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-08-26