I didn't realize the Java Edition has an in-built mechanism that converts JSON <=> NBT, I thought the concept behind that was just a mechanic of users working with NBT data outside of the game itself, like with third-party projects like yours truly.
JSON and NBT - Minecraft Wiki
If this does have a specific intended behavior for converting to and from NBT and JSON primitives, then this is a spec that NBTify itself should also follow. As of yet, I decided to essentially only make safe conversions for working with JSON itself, without any implied value range inferences, say for example whether a value is small enough to fit inside of a TAG_Byte, that shouldn't dictate that it's type is indeed that size, because when the game loads that file, it might be expecting a different number type. This concept was worrisome to me, so I went with what seemed like the least opinionated route, where it would only convert types when they safely could assumed to be such. For example, going from JS booleans to TAG_Byte is okay, because this is what NBT itself does too. However, converting a TAG_List of TAG_Byte values to a TAG_Byte_Array doesn't seem as straightforward, so I don't do that.
If this behavior is expected though, then it is something that NBTify should allow for too. Personally, I think for general JSON out in the world, the current NBTify implementation for conversion works well for that, because it doesn't assume anything to be safe coming in. However, in an expected scenario of data coming in from the game, and you know where it's reading into (like player data for example), then if the game is okay with key-value pairs being of different types, then conversion doesn't seem to be much of an issue.
I didn't realize the Java Edition has an in-built mechanism that converts JSON <=> NBT, I thought the concept behind that was just a mechanic of users working with NBT data outside of the game itself, like with third-party projects like yours truly.
JSON and NBT - Minecraft Wiki
If this does have a specific intended behavior for converting to and from NBT and JSON primitives, then this is a spec that NBTify itself should also follow. As of yet, I decided to essentially only make safe conversions for working with JSON itself, without any implied value range inferences, say for example whether a value is small enough to fit inside of a
TAG_Byte, that shouldn't dictate that it's type is indeed that size, because when the game loads that file, it might be expecting a different number type. This concept was worrisome to me, so I went with what seemed like the least opinionated route, where it would only convert types when they safely could assumed to be such. For example, going from JS booleans toTAG_Byteis okay, because this is what NBT itself does too. However, converting aTAG_ListofTAG_Bytevalues to aTAG_Byte_Arraydoesn't seem as straightforward, so I don't do that.If this behavior is expected though, then it is something that NBTify should allow for too. Personally, I think for general JSON out in the world, the current NBTify implementation for conversion works well for that, because it doesn't assume anything to be safe coming in. However, in an expected scenario of data coming in from the game, and you know where it's reading into (like player data for example), then if the game is okay with key-value pairs being of different types, then conversion doesn't seem to be much of an issue.