Closed NingLiu1998 closed 11 months ago
I am uncertain what is the expected/actual values you are getting, but I will note that SNBT is not JSON, though raw strings of JSON text can be used as a string value, which is common. This string can then be converted by the application into the expected type, but the SNBT itself is not JSON, nor is it likely to process it correctly.
SNBT would be something more akin to this:
{jsonText: "{\"command\": {\"name\": \"quit\"}}" }
Note that the actual JSON is passed as a string, not in JSON form, and the similarity between SNBT and JSON can be deceptive. I am unsure if you are receiving raw JSON that shouldn't be parsed as SNBT, or if you are attempting to process the SNBT key/value as JSON, when you should only be processing the text value.
You are right, I found my train of thought a little bit wrong, thank you!
This is the data I receive
如果我直接序列化json,NBT 格式和原来的就不对了
If I serialize json directly, the NBT format is wrong with the original one
SharpNBT.SNBT.StringNbt.Parse
之后如何转回原来的?How do I switch back to the original after
SharpNBT.SNBT.StringNbt.Parse
?