Skip to content

[Bug]: js nodejs NBT.parseSNBT()无法正常使用 #102

@BlueBoxMirror

Description

@BlueBoxMirror

Describe the bug

无论何种格式的SNBT输入,输出只有两种结果
NbtCompound({}) 或 null

To Reproduce

输入 log(NBT.parseSNBT('{"data":"hello"}').getData("data"))
输出 INFO []
输入 log(NBT.parseSNBT('{data:hello}').getData("data"))
输出 INFO []

Expected behavior

输入 log(NBT.parseSNBT('{"data":"hello"}').getData("data"))
应输出 INFO [] hello
输入 log(NBT.parseSNBT(new NbtCompound({data:"hello"}).toSNBT()).getData("data"))
应输出 INFO [] hello

Screenshots

image
image

Platform

Windows 11

BDS Version

1.20.73.01

LeviLamina Version

0.11.1+01b482c57

LegacyScriptEngine Version

0.6.1

Additional context

nbt工具插件 因SNBT格式的更改与 parseSNBT的bug而无法使用
建议使用原先的NBT.toSNBT() 与 NBT.parseSNBT()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions