-
-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] How can I get/write a list of some types? #268
Comments
Oops, didn't see this issue. There is no setter because the list is linked to the NBT. Just get the list and start adding stuff. |
nvm, Thanks for the reply.
Maybe I'm just missed how to do this, but how do you do it? |
|
Hmmm, do we use |
What do you mean? It returns a literal normal Java |
I understand the case where the element type is |
Nbt doesn't have short lists. Mojang never needed it, so they haven't added it. |
Ummm, it is not used by default, but you can use it in commands and such. |
I guess so far the reason it's been not added is: "why?". |
I want to retrieve or write a list of types whose elements are part of the
NBTCompound
type for general-purpose NBT operations, but I am stuck because I do not know how to retrieve some list types (Byte
/Short
/ByteArray
/IntArray
/LongArray
/nested list) and how to set the list I am stuck because I don't know how to get some list types (Byte
/Short
/ByteArray
/IntArray
/LongArray
/nested list) and how to set list types.What should I do?
For example, the NBTCompound types getInteger and getIntegerList exist, but getShortList does not exist even though getShort does.
Just to be sure, here are the SNBT expressions for each and what is missing.
["", "", ""]
[0b, 1b, 2b]
[0s, 1s, 2s]
[0, 1, 2, 3]
[0L, 1L, 2L]
[0f, 1f, 2f]
[0d, 1d, 2d]
[[B; 0b, 1b, 2b], [B; 3b, 4b, 5b]]
[[I; 0, 1, 2, 3], [I; 4, 5, 6, 7]]
[[L; 0L, 1L, 2L], [L; 3L, 4L, 5L]]
[{a: 1, b: 2, c: 3}, {x: 4, y: 5}]
getCompoundList(key).addCompound()
)[[0b, 1b], [2s, 3s], [4, 5], [6L]]
The text was updated successfully, but these errors were encountered: