NBT Tag support

I believe it would be very helpful to have native support for NBT Tags and other things built into the API.

A weakness in the Bukkit API was their inability to support NBT properly that led to convoluted libraries and made it a pain to efficiently store items.

I’m sure others can touch on this more, just something I was feeling that needed to be addressed.

9 Likes

Not sure if anything is set in stone there yet or not, but with /blockdata and /testforblockdata in 1.8, it would be hard to justify not supporting some form of API to meet the needs (not saying raw NBT exposed).

For example, I have a simple system in my Spigot fork that lets me set all the basic types, as well as list and maps that are also composed of the basic types (+ ItemStack). Anything safe to serialize to NBT. So no raw NBT classes, but same result.

Something like that should be good for an API.

4 Likes

Absolutly a feature we should think of. I managed to modify spigot to support nbt tags on items by only changing one line! It was a real shame that bukkit never managed to support nbt natively.

There already is a pull request for NBT

And now a Youtrack issue:
http://issues.spongepowered.org/youtrack/issue/SPONGE-35

This is a good idea, I’m thorwning my support in for this to be added. I think Bukkit’s ItemMeta API was one of the cleanest API’s ever written for it and I think that system worked pretty well. It would’ve been nice for it to have supported the ability to extend the API for more generalized data to be stored.

The ItemMeta API was useless if you had to deal with modded items, CraftItemStack just removed all the “unknown” tags.

I’m not talking about that part of it though (and that issue is a characteristic of the fact that it was designed to be used. Unknown tags were not supposed to be supported). The design of the API part was very clean and simple. Well written, the implementation may have caused you to have issues, but the design wasn’t intended to handle developers going around the API and using NMS.

1 Like