Minecraft 服务端插件
NBT-API
Add custom NBT tags to Items/Tiles/Entities without NMS
- 版本范围
- 1.7.9–26.2
- 下载量
- 30.7 万
插件介绍
(Item-)NBT-API
Add custom NBT tags to Items/Tiles/Entities without NMS! Modify NBT and store it Files, other NBT or as String in yaml/json/SQL/Redis. Server Owner/Developer Wiki
Build/Maven Status
SpigotMC Status
Getting started
Import the API using Maven, then check out the basic usage or code examples like working with Skulls.
bStats
版本与下载
推荐下载
item-nbt-api-plugin-2.13.2.jar版本 2.13.2 · 227.5 KBSHA-1 624e930f9a1e24f0be5a9a386817d09e3fd00286下载 item-nbt-api-plugin-2.13.2.jar2.15.7
正式版- 加载器
- bukkit · folia · paper · purpur · spigot
- MC 版本
- 1.8.8 · 1.8.9 · 1.9 · 1.9.1 · 1.9.2 · 1.9.3 · 1.9.4 · 1.10 · 1.10.1 · 1.10.2 · 1.11 · 1.11.1 · 1.11.2 · 1.12 · 1.12.1 · 1.12.2 · 1.13 · 1.13.1 · 1.13.2 · 1.14 · 1.14.1 · 1.14.2 · 1.14.3 · 1.14.4 · 1.15 · 1.15.1 · 1.15.2 · 1.16 · 1.16.1 · 1.16.2 · 1.16.3 · 1.16.4 · 1.16.5 · 1.17 · 1.17.1 · 1.18 · 1.18.1 · 1.18.2 · 1.19 · 1.19.1 · 1.19.2 · 1.19.3 · 1.19.4 · 1.20 · 1.20.1 · 1.20.2 · 1.20.3 · 1.20.4 · 1.20.5 · 1.20.6 · 1.21 · 1.21.1 · 1.21.2 · 1.21.3 · 1.21.4 · 1.21.5 · 1.21.6 · 1.21.7 · 1.21.8 · 1.21.9 · 1.21.10 · 1.21.11 · 26.1 · 26.1.1 · 26.1.2 · 26.2
SHA-1 26d82ec9c37def4fbde5a135ee14bc2f4d4ae0c2获取文件 item-nbt-api-plugin-2.15.7.jar展开更新日志
What's Changed
- Added any 26.1.x build as supported, assuming that Mojang/Spigot/Paper don't introduce breaking changes in patch releases
- Added support for Papers 26.1.1+ new versioning format
Full Changelog: https://github.com/tr7zw/Item-NBT-API/compare/2.15.6...2.15.7
2.15.6
正式版- 加载器
- bukkit · folia · paper · purpur · spigot
- MC 版本
- 1.8.8 · 1.8.9 · 1.9 · 1.9.1 · 1.9.2 · 1.9.3 · 1.9.4 · 1.10 · 1.10.1 · 1.10.2 · 1.11 · 1.11.1 · 1.11.2 · 1.12 · 1.12.1 · 1.12.2 · 1.13 · 1.13.1 · 1.13.2 · 1.14 · 1.14.1 · 1.14.2 · 1.14.3 · 1.14.4 · 1.15 · 1.15.1 · 1.15.2 · 1.16 · 1.16.1 · 1.16.2 · 1.16.3 · 1.16.4 · 1.16.5 · 1.17 · 1.17.1 · 1.18 · 1.18.1 · 1.18.2 · 1.19 · 1.19.1 · 1.19.2 · 1.19.3 · 1.19.4 · 1.20 · 1.20.1 · 1.20.2 · 1.20.3 · 1.20.4 · 1.20.5 · 1.20.6 · 1.21 · 1.21.1 · 1.21.2 · 1.21.3 · 1.21.4 · 1.21.5 · 1.21.6 · 1.21.7 · 1.21.8 · 1.21.9 · 1.21.10 · 1.21.11 · 26.1
SHA-1 9db30493640d54d961231237575adeccbf536bf2获取文件 item-nbt-api-plugin-2.15.6.jar展开更新日志
What's Changed
- Add 26.1 as fully supported (last build did work without changes)
- Fix DataVersion not changing when upgrading Item nbt
- Bump org.bstats:bstats-bukkit from 3.1.0 to 3.2.1 by @dependabot[bot] in https://github.com/tr7zw/Item-NBT-API/pull/347
- Bump org.apache.maven.plugins:maven-compiler-plugin from 3.14.1 to 3.15.0 by @dependabot[bot] in https://github.com/tr7zw/Item-NBT-API/pull/344
- Bump org.codehaus.mojo:license-maven-plugin from 2.7.0 to 2.7.1 by @dependabot[bot] in https://github.com/tr7zw/Item-NBT-API/pull/341
- Bump org.apache.maven.plugins:maven-shade-plugin from 3.6.1 to 3.6.2 by @dependabot[bot] in https://github.com/tr7zw/Item-NBT-API/pull/348
Full Changelog: https://github.com/tr7zw/Item-NBT-API/compare/2.15.5...2.15.6
2.15.5
正式版- 加载器
- bukkit · folia · paper · purpur · spigot
- MC 版本
- 1.8.8 · 1.8.9 · 1.9 · 1.9.1 · 1.9.2 · 1.9.3 · 1.9.4 · 1.10 · 1.10.1 · 1.10.2 · 1.11 · 1.11.1 · 1.11.2 · 1.12 · 1.12.1 · 1.12.2 · 1.13 · 1.13.1 · 1.13.2 · 1.14 · 1.14.1 · 1.14.2 · 1.14.3 · 1.14.4 · 1.15 · 1.15.1 · 1.15.2 · 1.16 · 1.16.1 · 1.16.2 · 1.16.3 · 1.16.4 · 1.16.5 · 1.17 · 1.17.1 · 1.18 · 1.18.1 · 1.18.2 · 1.19 · 1.19.1 · 1.19.2 · 1.19.3 · 1.19.4 · 1.20 · 1.20.1 · 1.20.2 · 1.20.3 · 1.20.4 · 1.20.5 · 1.20.6 · 1.21 · 1.21.1 · 1.21.2 · 1.21.3 · 1.21.4 · 1.21.5 · 1.21.6 · 1.21.7 · 1.21.8 · 1.21.9 · 1.21.10 · 1.21.11
SHA-1 fa8110e3648d44ff67fdf0b207a835e2733fa61b获取文件 item-nbt-api-plugin-2.15.5.jar展开更新日志
What's Changed
- Fixed that the API reports that it doesn't know about 1.21.11
Full Changelog: https://github.com/tr7zw/Item-NBT-API/compare/2.15.4...2.15.5
2.15.4
正式版- 加载器
- bukkit · folia · paper · purpur · spigot
- MC 版本
- 1.8.8 · 1.8.9 · 1.9 · 1.9.1 · 1.9.2 · 1.9.3 · 1.9.4 · 1.10 · 1.10.1 · 1.10.2 · 1.11 · 1.11.1 · 1.11.2 · 1.12 · 1.12.1 · 1.12.2 · 1.13 · 1.13.1 · 1.13.2 · 1.14 · 1.14.1 · 1.14.2 · 1.14.3 · 1.14.4 · 1.15 · 1.15.1 · 1.15.2 · 1.16 · 1.16.1 · 1.16.2 · 1.16.3 · 1.16.4 · 1.16.5 · 1.17 · 1.17.1 · 1.18 · 1.18.1 · 1.18.2 · 1.19 · 1.19.1 · 1.19.2 · 1.19.3 · 1.19.4 · 1.20 · 1.20.1 · 1.20.2 · 1.20.3 · 1.20.4 · 1.20.5 · 1.20.6 · 1.21 · 1.21.1 · 1.21.2 · 1.21.3 · 1.21.4 · 1.21.5 · 1.21.6 · 1.21.7 · 1.21.8 · 1.21.9 · 1.21.10 · 1.21.11
SHA-1 a98d7c200dff4c558290fc3b79df9e6248505788获取文件 item-nbt-api-plugin-2.15.4.jar展开更新日志
What's Changed
- Add 1.21.11 support for Spigot/Paper
- Bump org.apache.maven.plugins:maven-source-plugin from 3.3.1 to 3.4.0 by @dependabot[bot] in https://github.com/tr7zw/Item-NBT-API/pull/339
Full Changelog: https://github.com/tr7zw/Item-NBT-API/compare/2.15.3...2.15.4
2.15.3
正式版- 加载器
- bukkit · folia · paper · purpur · spigot
- MC 版本
- 1.8.8 · 1.8.9 · 1.9 · 1.9.1 · 1.9.2 · 1.9.3 · 1.9.4 · 1.10 · 1.10.1 · 1.10.2 · 1.11 · 1.11.1 · 1.11.2 · 1.12 · 1.12.1 · 1.12.2 · 1.13 · 1.13.1 · 1.13.2 · 1.14 · 1.14.1 · 1.14.2 · 1.14.3 · 1.14.4 · 1.15 · 1.15.1 · 1.15.2 · 1.16 · 1.16.1 · 1.16.2 · 1.16.3 · 1.16.4 · 1.16.5 · 1.17 · 1.17.1 · 1.18 · 1.18.1 · 1.18.2 · 1.19 · 1.19.1 · 1.19.2 · 1.19.3 · 1.19.4 · 1.20 · 1.20.1 · 1.20.2 · 1.20.3 · 1.20.4 · 1.20.5 · 1.20.6 · 1.21 · 1.21.1 · 1.21.2 · 1.21.3 · 1.21.4 · 1.21.5 · 1.21.6 · 1.21.7 · 1.21.8 · 1.21.9 · 1.21.10
SHA-1 6ca7da8d5af716964d674b09f58714fe15f2edf1获取文件 item-nbt-api-plugin-2.15.3.jar展开更新日志
What's Changed
- Add 1.21.9/1.12.10 spigot/paper support
- Fix gameprofile writing/reading in 1.20.5+
- Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.11.3 to 3.12.0 by @dependabot[bot] in https://github.com/tr7zw/Item-NBT-API/pull/338
- Bump org.apache.maven.plugins:maven-compiler-plugin from 3.14.0 to 3.14.1 by @dependabot[bot] in https://github.com/tr7zw/Item-NBT-API/pull/337
- Bump org.codehaus.mojo:license-maven-plugin from 2.6.0 to 2.7.0 by @dependabot[bot] in https://github.com/tr7zw/Item-NBT-API/pull/336
- Bump org.apache.maven.plugins:maven-shade-plugin from 3.6.0 to 3.6.1 by @dependabot[bot] in https://github.com/tr7zw/Item-NBT-API/pull/335
Full Changelog: https://github.com/tr7zw/Item-NBT-API/compare/2.15.2...2.15.3
2.15.2
正式版- 加载器
- bukkit · folia · paper · purpur · spigot
- MC 版本
- 1.8.8 · 1.8.9 · 1.9 · 1.9.1 · 1.9.2 · 1.9.3 · 1.9.4 · 1.10 · 1.10.1 · 1.10.2 · 1.11 · 1.11.1 · 1.11.2 · 1.12 · 1.12.1 · 1.12.2 · 1.13 · 1.13.1 · 1.13.2 · 1.14 · 1.14.1 · 1.14.2 · 1.14.3 · 1.14.4 · 1.15 · 1.15.1 · 1.15.2 · 1.16 · 1.16.1 · 1.16.2 · 1.16.3 · 1.16.4 · 1.16.5 · 1.17 · 1.17.1 · 1.18 · 1.18.1 · 1.18.2 · 1.19 · 1.19.1 · 1.19.2 · 1.19.3 · 1.19.4 · 1.20 · 1.20.1 · 1.20.2 · 1.20.3 · 1.20.4 · 1.20.5 · 1.20.6 · 1.21 · 1.21.1 · 1.21.2 · 1.21.3 · 1.21.4 · 1.21.5 · 1.21.6 · 1.21.7 · 1.21.8
SHA-1 44c3ced111e90f74669fdd83ef8ed3b4d70cb02b获取文件 item-nbt-api-plugin-2.15.2.jar展开更新日志
What's Changed
- Mark 1.21.8 as compatible (it was before too, this just removes the warning in the log)
- Fix 1.21.5 on spigot having CODEC errors
- Fixed variables for the DataFixerUtil to use revisions
- Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.11.2 to 3.11.3 by @dependabot[bot] in https://github.com/tr7zw/Item-NBT-API/pull/333
Full Changelog: https://github.com/tr7zw/Item-NBT-API/compare/2.15.1...2.15.2
2.15.1
正式版- 加载器
- bukkit · folia · paper · purpur · spigot
- MC 版本
- 1.8.8 · 1.8.9 · 1.9 · 1.9.1 · 1.9.2 · 1.9.3 · 1.9.4 · 1.10 · 1.10.1 · 1.10.2 · 1.11 · 1.11.1 · 1.11.2 · 1.12 · 1.12.1 · 1.12.2 · 1.13 · 1.13.1 · 1.13.2 · 1.14 · 1.14.1 · 1.14.2 · 1.14.3 · 1.14.4 · 1.15 · 1.15.1 · 1.15.2 · 1.16 · 1.16.1 · 1.16.2 · 1.16.3 · 1.16.4 · 1.16.5 · 1.17 · 1.17.1 · 1.18 · 1.18.1 · 1.18.2 · 1.19 · 1.19.1 · 1.19.2 · 1.19.3 · 1.19.4 · 1.20 · 1.20.1 · 1.20.2 · 1.20.3 · 1.20.4 · 1.20.5 · 1.20.6 · 1.21 · 1.21.1 · 1.21.2 · 1.21.3 · 1.21.4 · 1.21.5 · 1.21.6 · 1.21.7 · 1.21.8
SHA-1 4f6959d35fd40f4386f5d44ba274ad44d36a0ab4获取文件 item-nbt-api-plugin-2.15.1.jar展开更新日志
What's Changed
- Added 1.21.6/1.21.7 support
- Reworked bStats shading/Updated bStats version
- Fixed errors with slightly malformed parent (paper-)plugin.yml
- Better Mojmap support for fields
- Added new bStats graphs: https://bstats.org/plugin/bukkit/ItemNBTAPI/1058
- [1.21.6] support Entity and BlockEntity by @patyhank in https://github.com/tr7zw/Item-NBT-API/pull/326
- Bump org.codehaus.mojo:license-maven-plugin from 2.5.0 to 2.6.0 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/325
- Mark 1.21.7 as supported by @patyhank in https://github.com/tr7zw/Item-NBT-API/pull/328
New Contributors
- @patyhank made their first contribution in https://github.com/tr7zw/Item-NBT-API/pull/326 Thank you so much for the contributions to the update, I wouldn't have been able to finish it in time.
Full Changelog: https://github.com/tr7zw/Item-NBT-API/compare/2.15.0...2.15.1
2.15.0
正式版- 加载器
- bukkit · paper · purpur · spigot
- MC 版本
- 1.8.9 · 1.9 · 1.9.1 · 1.9.2 · 1.9.3 · 1.9.4 · 1.10 · 1.10.1 · 1.10.2 · 1.11 · 1.11.1 · 1.11.2 · 1.12 · 1.12.1 · 1.12.2 · 1.13 · 1.13.1 · 1.13.2 · 1.14 · 1.14.1 · 1.14.2 · 1.14.3 · 1.14.4 · 1.15 · 1.15.1 · 1.15.2 · 1.16 · 1.16.1 · 1.16.2 · 1.16.3 · 1.16.4 · 1.16.5 · 1.17 · 1.17.1 · 1.18 · 1.18.1 · 1.18.2 · 1.19 · 1.19.1 · 1.19.2 · 1.19.3 · 1.19.4 · 1.20 · 1.20.1 · 1.20.2 · 1.20.3 · 1.20.4 · 1.20.5 · 1.20.6 · 1.21 · 1.21.1 · 1.21.2 · 1.21.3 · 1.21.4 · 1.21.5
SHA-1 73fe69ba408acea32b59818939801e35075c9001获取文件 item-nbt-api-plugin-2.15.0.jar展开更新日志
What's Changed
- Add 1.21.5 support (Spigot/Paper/forks)
- Updated Wiki pages a lot
- Add DataVersion for itemstack conversions by @SoSeDiK in https://github.com/tr7zw/Item-NBT-API/pull/319
- Fixed list#remove(Object) removing every instance of the Object, not just the first one. #293
- Add a method to extract difference between two compounds by @SoSeDiK in https://github.com/tr7zw/Item-NBT-API/pull/321
- Update "Reading world data" wiki example by @SoSeDiK in https://github.com/tr7zw/Item-NBT-API/pull/320
- Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.11.1 to 3.11.2 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/312
- Add EvenMoreFish to Plugins.md by @FireML in https://github.com/tr7zw/Item-NBT-API/pull/311
- Bump org.codehaus.mojo:license-maven-plugin from 2.4.0 to 2.5.0 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/309
- Update wiki by @SoSeDiK in https://github.com/tr7zw/Item-NBT-API/pull/313
- Bump org.apache.maven.plugins:maven-compiler-plugin from 3.13.0 to 3.14.0 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/316
New Contributors
- @FireML made their first contribution in https://github.com/tr7zw/Item-NBT-API/pull/311
Full Changelog: https://github.com/tr7zw/Item-NBT-API/compare/2.14.1...2.15.0
2.14.1
正式版- 加载器
- bukkit · folia · paper · purpur · spigot
- MC 版本
- 1.8.8 · 1.8.9 · 1.9 · 1.9.1 · 1.9.2 · 1.9.3 · 1.9.4 · 1.10 · 1.10.1 · 1.10.2 · 1.11 · 1.11.1 · 1.11.2 · 1.12 · 1.12.1 · 1.12.2 · 1.13 · 1.13.1 · 1.13.2 · 1.14 · 1.14.1 · 1.14.2 · 1.14.3 · 1.14.4 · 1.15 · 1.15.1 · 1.15.2 · 1.16 · 1.16.1 · 1.16.2 · 1.16.3 · 1.16.4 · 1.16.5 · 1.17 · 1.17.1 · 1.18 · 1.18.1 · 1.18.2 · 1.19 · 1.19.1 · 1.19.2 · 1.19.3 · 1.19.4 · 1.20 · 1.20.1 · 1.20.2 · 1.20.3 · 1.20.4 · 1.20.5 · 1.20.6 · 1.21 · 1.21.1 · 1.21.2 · 1.21.3 · 1.21.4
SHA-1 513b7a04b6011cd4dc0d004b6e912f10f1013662获取文件 item-nbt-api-plugin-2.14.1.jar展开更新日志
What's Changed
- Add 1.21.4 support
- Add new experimental NBTJsonUtil#itemStackToJson method to use for 1.20.3+ Chat Hover Components
- Update wiki by @SoSeDiK in https://github.com/tr7zw/Item-NBT-API/pull/308
- Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.10.1 to 3.11.1 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/306
Full Changelog: https://github.com/tr7zw/Item-NBT-API/compare/2.14.0...2.14.1
2.14.0
正式版- 加载器
- bukkit · folia · paper · purpur · spigot
- MC 版本
- 1.8.8 · 1.8.9 · 1.9 · 1.9.1 · 1.9.2 · 1.9.3 · 1.9.4 · 1.10 · 1.10.1 · 1.10.2 · 1.11 · 1.11.1 · 1.11.2 · 1.12 · 1.12.1 · 1.12.2 · 1.13 · 1.13.1 · 1.13.2 · 1.14 · 1.14.1 · 1.14.2 · 1.14.3 · 1.14.4 · 1.15 · 1.15.1 · 1.15.2 · 1.16 · 1.16.1 · 1.16.2 · 1.16.3 · 1.16.4 · 1.16.5 · 1.17 · 1.17.1 · 1.18 · 1.18.1 · 1.18.2 · 1.19 · 1.19.1 · 1.19.2 · 1.19.3 · 1.19.4 · 1.20 · 1.20.1 · 1.20.2 · 1.20.3 · 1.20.4 · 1.20.5 · 1.20.6 · 1.21 · 1.21.1 · 1.21.2 · 1.21.3
SHA-1 f50ff071df2d85b2943727c2a7c5fe9df3067a5b获取文件 item-nbt-api-plugin-2.14.0.jar展开更新日志
What's Changed
- Add 1.21.3 support (and 1.21.2, but you shouldn't be using this version)
- Hide NBTFile/NBTContainer fully behind NBT (methods are now deprecated, pointing to the equivalent NBT replacement)
- Add missing addCompound(ReadableNBT comp) to ReadWriteNBTCompoundList
- Fix edge-case in writing out Bukkit items without data
- Try to auto-detect pre 1.20.3 item nbt also via the "Count" tag for updating
- Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.8.0 to 3.10.0 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/297
- Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.10.0 to 3.10.1 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/300
Full Changelog: https://github.com/tr7zw/Item-NBT-API/compare/2.13.2...2.14.0
2.13.2
正式版推荐- 加载器
- bukkit · folia · paper · purpur · spigot
- MC 版本
- 1.8.8 · 1.8.9 · 1.9 · 1.9.1 · 1.9.2 · 1.9.3 · 1.9.4 · 1.10 · 1.10.1 · 1.10.2 · 1.11 · 1.11.1 · 1.11.2 · 1.12 · 1.12.1 · 1.12.2 · 1.13 · 1.13.1 · 1.13.2 · 1.14 · 1.14.1 · 1.14.2 · 1.14.3 · 1.14.4 · 1.15 · 1.15.1 · 1.15.2 · 1.16 · 1.16.1 · 1.16.2 · 1.16.3 · 1.16.4 · 1.16.5 · 1.17 · 1.17.1 · 1.18 · 1.18.1 · 1.18.2 · 1.19 · 1.19.1 · 1.19.2 · 1.19.3 · 1.19.4 · 1.20 · 1.20.1 · 1.20.2 · 1.20.3 · 1.20.4 · 1.20.5 · 1.20.6 · 1.21 · 1.21.1
SHA-1 624e930f9a1e24f0be5a9a386817d09e3fd00286获取文件 item-nbt-api-plugin-2.13.2.jar展开更新日志
What's Changed
- Add 1.21.1 support
- Small wiki changes by @SoSeDiK in https://github.com/tr7zw/Item-NBT-API/pull/287
- Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.7.0 to 3.8.0 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/290
- Prevent chunk loading during tile entity tests by @SoSeDiK in https://github.com/tr7zw/Item-NBT-API/pull/288
Full Changelog: https://github.com/tr7zw/Item-NBT-API/compare/2.13.1...2.13.2
2.13.1
正式版- 加载器
- bukkit · folia · paper · purpur · spigot
- MC 版本
- 1.8.8 · 1.8.9 · 1.9 · 1.9.1 · 1.9.2 · 1.9.3 · 1.9.4 · 1.10 · 1.10.1 · 1.10.2 · 1.11 · 1.11.1 · 1.11.2 · 1.12 · 1.12.1 · 1.12.2 · 1.13 · 1.13.1 · 1.13.2 · 1.14 · 1.14.1 · 1.14.2 · 1.14.3 · 1.14.4 · 1.15 · 1.15.1 · 1.15.2 · 1.16 · 1.16.1 · 1.16.2 · 1.16.3 · 1.16.4 · 1.16.5 · 1.17 · 1.17.1 · 1.18 · 1.18.1 · 1.18.2 · 1.19 · 1.19.1 · 1.19.2 · 1.19.3 · 1.19.4 · 1.20 · 1.20.1 · 1.20.2 · 1.20.3 · 1.20.4 · 1.20.5 · 1.20.6 · 1.21
SHA-1 68b1b004e1be3c40bbf742d410e84b9a18f3d357获取文件 item-nbt-api-plugin-2.13.1.jar展开更新日志
What's Changed
- Fix Paper 1.21
- Fix resolveCompound in ReadWriteNBT not returning ReadWriteNBT
- Add a missing
@Nullableflag to resolveCompound - Removed old incorrect mappings on newer versions
- General code cleanup
- Fix datafixer now knowing the 1.21 version id
- Update wiki by @SoSeDiK in https://github.com/tr7zw/Item-NBT-API/pull/282
If you have questions about how to migrate your code away from NBTItem or how to support 1.20.5+ with the new ItemStack logic, check out the updated wiki! SoSeDiK did an amazing job updating the wiki, including many updated examples. Also, feel free to PR your plugin to the Plugin list on the wiki.
Full Changelog: https://github.com/tr7zw/Item-NBT-API/compare/2.13.0...2.13.1
2.13.0
正式版- 加载器
- bukkit · folia · paper · purpur · spigot
- MC 版本
- 1.8.8 · 1.8.9 · 1.9 · 1.9.1 · 1.9.2 · 1.9.3 · 1.9.4 · 1.10 · 1.10.1 · 1.10.2 · 1.11 · 1.11.1 · 1.11.2 · 1.12 · 1.12.1 · 1.12.2 · 1.13 · 1.13.1 · 1.13.2 · 1.14 · 1.14.1 · 1.14.2 · 1.14.3 · 1.14.4 · 1.15 · 1.15.1 · 1.15.2 · 1.16 · 1.16.1 · 1.16.2 · 1.16.3 · 1.16.4 · 1.16.5 · 1.17 · 1.17.1 · 1.18 · 1.18.1 · 1.18.2 · 1.19 · 1.19.1 · 1.19.2 · 1.19.3 · 1.19.4 · 1.20 · 1.20.1 · 1.20.2 · 1.20.3 · 1.20.4 · 1.20.5 · 1.20.6 · 1.21
SHA-1 2f535b6b29d07d6c0d7b95ae354f8e5fd7e7bc6e获取文件 item-nbt-api-plugin-2.13.0.jar展开更新日志
What's Changed
- Update to 1.21
- Deprecated lots of old methods/constructors. Please migrate to the NBT class for faster and abstracted alternatives
- Added new NBT.modifyComponents API for 1.20.5+ to modify vanilla components
- Removed nbt-injector(you really shouldn't be using this) and nbt-data-api(never finished). This removed a lot of bloat from the jar
- Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.6.3 to 3.7.0 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/279
- Bump org.apache.maven.plugins:maven-shade-plugin from 3.5.3 to 3.6.0 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/278
Full Changelog: https://github.com/tr7zw/Item-NBT-API/compare/2.12.4...2.13.0
2.12.4
正式版- 加载器
- bukkit · folia · paper · purpur · spigot
- MC 版本
- 1.8.8 · 1.8.9 · 1.9 · 1.9.1 · 1.9.2 · 1.9.3 · 1.9.4 · 1.10 · 1.10.1 · 1.10.2 · 1.11 · 1.11.1 · 1.11.2 · 1.12 · 1.12.1 · 1.12.2 · 1.13 · 1.13.1 · 1.13.2 · 1.14 · 1.14.1 · 1.14.2 · 1.14.3 · 1.14.4 · 1.15 · 1.15.1 · 1.15.2 · 1.16 · 1.16.1 · 1.16.2 · 1.16.3 · 1.16.4 · 1.16.5 · 1.17 · 1.17.1 · 1.18 · 1.18.1 · 1.18.2 · 1.19 · 1.19.1 · 1.19.2 · 1.19.3 · 1.19.4 · 1.20 · 1.20.1 · 1.20.2 · 1.20.3 · 1.20.4 · 1.20.5 · 1.20.6
SHA-1 8daf42d1ff62a52653e3fafadf6311d602974395获取文件 item-nbt-api-plugin-2.12.4.jar展开更新日志
What's Changed
- Add 1.20.5 & 1.20.6 support
- Add Datafixer support to upgrade item NBT to newer versions
- Auto upgrade old ItemStacks when using
NBT.itemStackFromNBTand the related methods (it will assume the NBT is 1.20.4 data, otherwise upgrade the NBT before yourself with the Datafixer) - Fix BlockEntity bug on Mojang mapped servers
- Bump org.apache.maven.plugins:maven-source-plugin from 3.3.0 to 3.3.1 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/273
- Bump org.apache.maven.plugins:maven-shade-plugin from 3.5.2 to 3.5.3 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/277
Note
Due to Mojang changes to how ItemStacks work at runtime, vanilla NBT won't be visible on loaded ItemStacks in 1.20.5+ anymore. So modifying vanilla data will not work anymore in the same way as for 1.8-1.20.4, and all plugins need to be updated to be aware of that. If in doubt, feel free to ask on Discord.
Full Changelog: https://github.com/tr7zw/Item-NBT-API/compare/2.12.3...2.12.4
2.12.3
正式版- 加载器
- bukkit · folia · paper · purpur · spigot
- MC 版本
- 1.8.8 · 1.8.9 · 1.9 · 1.9.1 · 1.9.2 · 1.9.3 · 1.9.4 · 1.10 · 1.10.1 · 1.10.2 · 1.11 · 1.11.1 · 1.11.2 · 1.12 · 1.12.1 · 1.12.2 · 1.13 · 1.13.1 · 1.13.2 · 1.14 · 1.14.1 · 1.14.2 · 1.14.3 · 1.14.4 · 1.15 · 1.15.1 · 1.15.2 · 1.16 · 1.16.1 · 1.16.2 · 1.16.3 · 1.16.4 · 1.16.5 · 1.17 · 1.17.1 · 1.18 · 1.18.1 · 1.18.2 · 1.19 · 1.19.1 · 1.19.2 · 1.19.3 · 1.19.4 · 1.20 · 1.20.1 · 1.20.2 · 1.20.3 · 1.20.4
SHA-1 d3f9e96ec2c3708a3b058dab00fa65aeccd76709获取文件 item-nbt-api-plugin-2.12.3.jar展开更新日志
What's Changed
- Add support for un-remapped Paper 1.20+
Other changes
- Bump org.apache.maven.plugins:maven-compiler-plugin from 3.11.0 to 3.12.0 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/261
- Bump org.apache.maven.plugins:maven-compiler-plugin from 3.12.0 to 3.12.1 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/263
- Update LICENSE copyright to 2024 by @SmartGecko44 in https://github.com/tr7zw/Item-NBT-API/pull/264
- Bump org.codehaus.mojo:license-maven-plugin from 2.3.0 to 2.4.0 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/265
- Bump org.apache.maven.plugins:maven-shade-plugin from 3.5.1 to 3.5.2 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/267
- Bump org.apache.maven.plugins:maven-compiler-plugin from 3.12.1 to 3.13.0 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/270
New Contributors
- @SmartGecko44 made their first contribution in https://github.com/tr7zw/Item-NBT-API/pull/264
Full Changelog: https://github.com/tr7zw/Item-NBT-API/compare/2.12.2...2.12.3
2.12.2
正式版- 加载器
- bukkit · folia · paper · purpur · spigot
- MC 版本
- 1.8.8 · 1.8.9 · 1.9 · 1.9.1 · 1.9.2 · 1.9.3 · 1.9.4 · 1.10 · 1.10.1 · 1.10.2 · 1.11 · 1.11.1 · 1.11.2 · 1.12 · 1.12.1 · 1.12.2 · 1.13 · 1.13.1 · 1.13.2 · 1.14 · 1.14.1 · 1.14.2 · 1.14.3 · 1.14.4 · 1.15 · 1.15.1 · 1.15.2 · 1.16 · 1.16.1 · 1.16.2 · 1.16.3 · 1.16.4 · 1.16.5 · 1.17 · 1.17.1 · 1.18 · 1.18.1 · 1.18.2 · 1.19 · 1.19.1 · 1.19.2 · 1.19.3 · 1.19.4 · 1.20 · 1.20.1 · 1.20.2 · 1.20.3 · 1.20.4
SHA-1 eade5ea05429a49826a5c33a306a8592b47551d3获取文件 item-nbt-api-plugin-2.12.2.jar展开更新日志
What's Changed
- Add 1.20.4 support
- Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.6.0 to 3.6.2 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/256
- Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.6.2 to 3.6.3 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/258
Full Changelog: https://github.com/tr7zw/Item-NBT-API/compare/2.12.1...2.12.2
2.12.1
正式版- 加载器
- bukkit · folia · paper · purpur · spigot
- MC 版本
- 1.8.8 · 1.8.9 · 1.9 · 1.9.1 · 1.9.2 · 1.9.3 · 1.9.4 · 1.10 · 1.10.1 · 1.10.2 · 1.11 · 1.11.1 · 1.11.2 · 1.12 · 1.12.1 · 1.12.2 · 1.13 · 1.13.1 · 1.13.2 · 1.14 · 1.14.1 · 1.14.2 · 1.14.3 · 1.14.4 · 1.15 · 1.15.1 · 1.15.2 · 1.16 · 1.16.1 · 1.16.2 · 1.16.3 · 1.16.4 · 1.16.5 · 1.17 · 1.17.1 · 1.18 · 1.18.1 · 1.18.2 · 1.19 · 1.19.1 · 1.19.2 · 1.19.3 · 1.19.4 · 1.20 · 1.20.1 · 1.20.2
SHA-1 34c0241ebcfd7823ddb6bd2621eb540ae72123b6获取文件 item-nbt-api-plugin-2.12.1.jar展开更新日志
What's Changed
- Fix 1.19R3 using the wrong mapping, causing a test to fail
- Fix internal version ID of 1.20R2
- Bump org.apache.maven.plugins:maven-shade-plugin from 3.5.0 to 3.5.1 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/250
- Bump org.codehaus.mojo:license-maven-plugin from 2.2.0 to 2.3.0 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/253
Full Changelog: https://github.com/tr7zw/Item-NBT-API/compare/2.12.0...2.12.1
2.12.0
正式版- 加载器
- bukkit · folia · paper · purpur · spigot
- MC 版本
- 1.8.8 · 1.8.9 · 1.9 · 1.9.1 · 1.9.2 · 1.9.3 · 1.9.4 · 1.10 · 1.10.1 · 1.10.2 · 1.11 · 1.11.1 · 1.11.2 · 1.12 · 1.12.1 · 1.12.2 · 1.13 · 1.13.1 · 1.13.2 · 1.14 · 1.14.1 · 1.14.2 · 1.14.3 · 1.14.4 · 1.15 · 1.15.1 · 1.15.2 · 1.16 · 1.16.1 · 1.16.2 · 1.16.3 · 1.16.4 · 1.16.5 · 1.17 · 1.17.1 · 1.18 · 1.18.1 · 1.18.2 · 1.19 · 1.19.1 · 1.19.2 · 1.19.3 · 1.19.4 · 1.20 · 1.20.1 · 1.20.2
SHA-1 a69d4f81f2a0d1c34b0484eeb3f718b0058d551b获取文件 item-nbt-api-plugin-2.12.0.jar展开更新日志
2.12.0
Hello everyone, this is the by far biggest NBTAPI update so far. This release contains 100 commits of the total 580 total commits(17% of all commits of the past 7 years?!?), so strap in for the changes.
(Also small reminder that supporting the dev behind this project would be really nice, especially when you use this API to make paid Plugins 😅)
Late changes between 2.12.0-RC1 and 2.12.0:
- Add 1.20.2 support
- Fix getKeys on empty ItemStacks
- Fix modifyMeta on empty ItemStacks
- Add support for ProxiedLists
- Add support for using indices like [123] or [-1] in resolve methods
- Hard prevent Jitpack. If you are using Jitpack for whatever reason, check the wiki to use the correct repo!
Major Changes
- Add support for Mojang-Mapped servers(Paper-Mojmap/Paper dev mode)
- Add support for Folia
- HEAVY performance improvements for NBT.get and NBT.modify (see below)
- Preview: Interface proxies to access NBT without writing code(see below)
- Entity/BlockEntity modifications are now atomic and faster to prevent pitfalls
- Entity/BlockEntity read-only is now a lot faster by only getting the tag once
- Added resolveOrNull/resolveOrDefault/resolveCompound/resolveOrCreateCompound. They take
.separated strings to keys liketag.othertag.key(see below for examples)
Noteworthy Changes
- Updated bStats from version 1? to 3.0.2
- Reduced logging for Gson
- Added long[] support with setLongArray/getLongArray (1.16+)
- Include NBTAPI version in errors
- Removed the "functional-annotations" dependency shading users might have noticed
- Fixed NBTFile.saveTo always saving the root instead of the passed tag
- Added @Nullable in some key places
- When the tag is empty at the end of NBT.modify, the tag gets removed from the item instead of saving an empty
{}tag - Prevented some misuse of the NBT.get/NBT.modify methods
- New
set(String key, T value, NBTHandler<T> handler)method to set your custom data with the provided handler - New
get(String key, NBTHandler<T> handler)method to get your custom data with the provided handler
Other Changes/Documentation
- Bump license-maven-plugin from 2.0.1 to 2.1.0 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/229
- Bump maven-shade-plugin from 3.4.1 to 3.5.0 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/232
- Bump license-maven-plugin from 2.1.0 to 2.2.0 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/235
- Read-only optimization by @tr7zw in https://github.com/tr7zw/Item-NBT-API/pull/236
- Update "set skull skin" documentation by @BlackBaroness in https://github.com/tr7zw/Item-NBT-API/pull/237
- Fix minor English mistakes in documentation by @BlackBaroness in https://github.com/tr7zw/Item-NBT-API/pull/238
- add honorable plugin list mentions by @U5B in https://github.com/tr7zw/Item-NBT-API/pull/242
- Fix Folia detection and NBT#modify for tile entities by @SoSeDiK in https://github.com/tr7zw/Item-NBT-API/pull/243
Performance
This release has a lot of performance optimizations under the hood, mainly for the NBT.get and NBT.modify methods for ItemStacks/Entities/BlockEntities. I highly encourage everyone to start updating their NBTItem/NBTEntity/NBTTileEntity code to use these new methods.
All benchmarks are done on Paper-171 on my local PC with 2.11.3 vs 2.12.0-RC1. The numbers are how often the test case was able to run in one second(the JVM did have some warmup time before on these methods). But since it's just one run there is probably a +-5% margin of error on these values, they are just there to get a rough idea.
Itemstacks
Link to the code that runs. The legacy tests use new NBTItem, while the others use the NBT class. Both tests get/set the same data, just changing between the old and new syntax!
NMS-Backed Itemstacks:
- LegacyGet: 880.620 -> 909.369 = ~3% faster
- NBT.get: 884.326 -> 4.214.210 = ~376% faster
- LegacySet: 762.453 -> 804.732 = ~5% faster
- NBT.modify: 298.238 -> 1.781.667 = ~497% faster
Bukkit-only Itemstacks:
- LegacyGet: 215.992 -> 202.413 = ~6% slower
- NBT.get: 223.998 -> 649.626 = ~190% faster
- LegacySet: 229.485 -> 239.910 = ~4% faster
- NBT.modify: 166.048 -> 567.107 = 241% faster
Basically, switch to the new NBT.get/NBT.modify method and get at least 200% more performance compared to before.
Persistent Data Container
To get a better idea on the performance of using the NBTAPI to store data on items vs Spigots Persistent Data Container API I checked and compared these too. Again, Paper-171 on 2.12.0-RC1. On NMS-Backed Itemstacks normal PDC is about the same speed as NBT.get. Only when caching the NamespacedKey in a final class field PDC pulls ahead. Writing data, especially on Bukkit-only items is a lot slower, but still easily 500.000+ times per second, so doubt that it's much of an issue(especially for gaining a way more flexible API and pre-1.14 support).
Resolve methods
To simplify working with deeply nested NBT, resolve methods now allow directly getting or working with these tags.
Compounds are separated by .. In case you need a . inside a key, it can be escaped with a \.
Examples:
// sets foo/bar/baz/test to 42
nbt.resolveOrCreateCompound("foo.bar.baz").setInteger("test", 42);
// gets the value we just set or 0
nbt.resolveOrDefault("foo.bar.baz.test", 0);
// gets the value we just set or null
nbt.resolveOrNull("foo.bar.baz.test", int.class);
// example of a key with a . in it. Sets the key foo/some.key/baz/other
nbt.resolveOrCreateCompound("foo.some\\.key.baz").setInteger("other", 123)
// get a tag or null when it's not there
nbt.resolveCompound("some.nested.key");
Interface Proxies
This is a preview feature contained in this release, and the API might change depending on feedback/development. It allows defining an Interface with normal methods/default methods, and the NBTAPI wraps the NBT with an automatically generated implementation of this Interface.
Methods starting with has/get/set will be interpreted as their respective calls:
public boolean hasKills(); runs return nbt.hasTag("kills");
public void setKills(int amount); runs nbt.setInteger("kills", amount);
public int getKills(); runs return nbt.getInteger("kills");
Default methods like
public default void addKill() {
setKills(getKills() + 1);
}
inside the interface are supported. Also having a getter return another Interface that also extends NBTProxy is supported.
To support other datatypes like ItemStacks, the init method can be overwritten with a default method, using the registerHandler method to add handlers. For example:
@Override
default void init() {
registerHandler(ItemStack.class, NBTHandlers.ITEM_STACK);
}
To now use your interface, just call NBT.modify or NBT.readNbt like this:
NBT.modify(item, TestInterface.class, ti -> {
ti.addKill();
//or any other method from your interface
});
// This instance can only run read-only methods. Calling any setter will cause an exception
TestInterface yourInterface = NBT.readNbt(item, TestInterface.class);
yourInterface .getKills();
For the complete example check the built-in startup test or the WIP NBT-ItemMeta proxy. Also feel free to ask on Discord.
New Contributors
- @BlackBaroness made their first contribution in https://github.com/tr7zw/Item-NBT-API/pull/237
- @U5B made their first contribution in https://github.com/tr7zw/Item-NBT-API/pull/242
Full Changelog: https://github.com/tr7zw/Item-NBT-API/compare/2.11.3...2.12.0-RC1
2.12.0-RC1
测试版- 加载器
- bukkit · folia · paper · purpur · spigot
- MC 版本
- 1.8.8 · 1.8.9 · 1.9 · 1.9.1 · 1.9.2 · 1.9.3 · 1.9.4 · 1.10 · 1.10.1 · 1.10.2 · 1.11 · 1.11.1 · 1.11.2 · 1.12 · 1.12.1 · 1.12.2 · 1.13 · 1.13.1 · 1.13.2 · 1.14 · 1.14.1 · 1.14.2 · 1.14.3 · 1.14.4 · 1.15 · 1.15.1 · 1.15.2 · 1.16 · 1.16.1 · 1.16.2 · 1.16.3 · 1.16.4 · 1.16.5 · 1.17 · 1.17.1 · 1.18 · 1.18.1 · 1.18.2 · 1.19 · 1.19.1 · 1.19.2 · 1.19.3 · 1.19.4 · 1.20 · 1.20.1
SHA-1 25c40e431cfdfbdca6b634a046fcf754aa52d7fe获取文件 item-nbt-api-plugin-2.12.0-RC1.jar展开更新日志
2.12.0 - Release Candidate 1
Hello everyone, this is the by far biggest NBTAPI update so far, that's why I decided to have a Minecraft-style Release Candidate before the full 2.12.0 release(best-case without any changes). This release contains 84 commits of the total 563 total commits(nearly 15% of all commits of the past 6-7 years?!?), so strap in for the changes.
(Also small reminder that supporting the dev behind this project would be really nice, especially when you use this API to make paid Plugins 😅)
Major Changes
- Add support for Mojang-Mapped servers(Paper-Mojmap/Paper dev mode)
- Add support for Folia
- HEAVY performance improvements for NBT.get and NBT.modify (see below)
- Preview: Interface proxies to access NBT without writing code(see below)
- Entity/BlockEntity modifications are now atomic and faster to prevent pitfalls
- Entity/BlockEntity read-only is now a lot faster by only getting the tag once
- Added resolveOrNull/resolveOrDefault/resolveCompound/resolveOrCreateCompound. They take
.separated strings to keys liketag.othertag.key(see below for examples)
Noteworthy Changes
- Updated bStats from version 1? to 3.0.2
- Reduced logging for Gson
- Added long[] support with setLongArray/getLongArray (1.16+)
- Include NBTAPI version in errors
- Removed the "functional-annotations" dependency shading users might have noticed
- Fixed NBTFile.saveTo always saving the root instead of the passed tag
- Added @Nullable in some key places
- When the tag is empty at the end of NBT.modify, the tag gets removed from the item instead of saving an empty
{}tag - Prevented some misuse of the NBT.get/NBT.modify methods
- New
set(String key, T value, NBTHandler<T> handler)method to set your custom data with the provided handler - New
get(String key, NBTHandler<T> handler)method to get your custom data with the provided handler
Other Changes/Documentation
- Bump license-maven-plugin from 2.0.1 to 2.1.0 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/229
- Bump maven-shade-plugin from 3.4.1 to 3.5.0 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/232
- Bump license-maven-plugin from 2.1.0 to 2.2.0 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/235
- Read-only optimization by @tr7zw in https://github.com/tr7zw/Item-NBT-API/pull/236
- Update "set skull skin" documentation by @BlackBaroness in https://github.com/tr7zw/Item-NBT-API/pull/237
- Fix minor English mistakes in documentation by @BlackBaroness in https://github.com/tr7zw/Item-NBT-API/pull/238
- add honorable plugin list mentions by @U5B in https://github.com/tr7zw/Item-NBT-API/pull/242
- Fix Folia detection and NBT#modify for tile entities by @SoSeDiK in https://github.com/tr7zw/Item-NBT-API/pull/243
Performance
This release has a lot of performance optimizations under the hood, mainly for the NBT.get and NBT.modify methods for ItemStacks/Entities/BlockEntities. I highly encourage everyone to start updating their NBTItem/NBTEntity/NBTTileEntity code to use these new methods.
All benchmarks are done on Paper-171 on my local PC with 2.11.3 vs 2.12.0-RC1. The numbers are how often the test case was able to run in one second(the JVM did have some warmup time before on these methods). But since it's just one run there is probably a +-5% margin of error on these values, they are just there to get a rough idea.
Itemstacks
Link to the code that runs. The legacy tests use new NBTItem, while the others use the NBT class. Both tests get/set the same data, just changing between the old and new syntax!
NMS-Backed Itemstacks:
- LegacyGet: 880.620 -> 909.369 = ~3% faster
- NBT.get: 884.326 -> 4.214.210 = ~376% faster
- LegacySet: 762.453 -> 804.732 = ~5% faster
- NBT.modify: 298.238 -> 1.781.667 = ~497% faster
Bukkit-only Itemstacks:
- LegacyGet: 215.992 -> 202.413 = ~6% slower
- NBT.get: 223.998 -> 649.626 = ~190% faster
- LegacySet: 229.485 -> 239.910 = ~4% faster
- NBT.modify: 166.048 -> 567.107 = 241% faster
Basically, switch to the new NBT.get/NBT.modify method and get at least 200% more performance compared to before.
Persistent Data Container
To get a better idea on the performance of using the NBTAPI to store data on items vs Spigots Persistent Data Container API I checked and compared these too. Again, Paper-171 on 2.12.0-RC1. On NMS-Backed Itemstacks normal PDC is about the same speed as NBT.get. Only when caching the NamespacedKey in a final class field PDC pulls ahead. Writing data, especially on Bukkit-only items is a lot slower, but still easily 500.000+ times per second, so doubt that it's much of an issue(especially for gaining a way more flexible API and pre-1.14 support).
Resolve methods
To simplify working with deeply nested NBT, resolve methods now allow directly getting or working with these tags.
Compounds are separated by .. In case you need a . inside a key, it can be escaped with a \.
Examples:
// sets foo/bar/baz/test to 42
nbt.resolveOrCreateCompound("foo.bar.baz").setInteger("test", 42);
// gets the value we just set or 0
nbt.resolveOrDefault("foo.bar.baz.test", 0);
// gets the value we just set or null
nbt.resolveOrNull("foo.bar.baz.test", int.class);
// example of a key with a . in it. Sets the key foo/some.key/baz/other
nbt.resolveOrCreateCompound("foo.some\\.key.baz").setInteger("other", 123)
// get a tag or null when it's not there
nbt.resolveCompound("some.nested.key");
Interface Proxies
This is a preview feature contained in this release, and the API might change depending on feedback/development. It allows defining an Interface with normal methods/default methods, and the NBTAPI wraps the NBT with an automatically generated implementation of this Interface.
Methods starting with has/get/set will be interpreted as their respective calls:
public boolean hasKills(); runs return nbt.hasTag("kills");
public void setKills(int amount); runs nbt.setInteger("kills", amount);
public int getKills(); runs return nbt.getInteger("kills");
Default methods like
public default void addKill() {
setKills(getKills() + 1);
}
inside the interface are supported. Also having a getter return another Interface that also extends NBTProxy is supported.
To support other datatypes like ItemStacks, the init method can be overwritten with a default method, using the registerHandler method to add handlers. For example:
@Override
default void init() {
registerHandler(ItemStack.class, NBTHandlers.ITEM_STACK);
}
To now use your interface, just call NBT.modify or NBT.readNbt like this:
NBT.modify(item, TestInterface.class, ti -> {
ti.addKill();
//or any other method from your interface
});
// This instance can only run read-only methods. Calling any setter will cause an exception
TestInterface yourInterface = NBT.readNbt(item, TestInterface.class);
yourInterface .getKills();
For the complete example check the built-in startup test or the WIP NBT-ItemMeta proxy. Also feel free to ask on Discord.
New Contributors
- @BlackBaroness made their first contribution in https://github.com/tr7zw/Item-NBT-API/pull/237
- @U5B made their first contribution in https://github.com/tr7zw/Item-NBT-API/pull/242
Full Changelog: https://github.com/tr7zw/Item-NBT-API/compare/2.11.3...2.12.0-RC1
2.11.3
正式版- 加载器
- bukkit · paper · purpur · spigot
- MC 版本
- 1.8.8 · 1.8.9 · 1.9 · 1.9.1 · 1.9.2 · 1.9.3 · 1.9.4 · 1.10 · 1.10.1 · 1.10.2 · 1.11 · 1.11.1 · 1.11.2 · 1.12 · 1.12.1 · 1.12.2 · 1.13 · 1.13.1 · 1.13.2 · 1.14 · 1.14.1 · 1.14.2 · 1.14.3 · 1.14.4 · 1.15 · 1.15.1 · 1.15.2 · 1.16 · 1.16.1 · 1.16.2 · 1.16.3 · 1.16.4 · 1.16.5 · 1.17 · 1.17.1 · 1.18 · 1.18.1 · 1.18.2 · 1.19 · 1.19.1 · 1.19.2 · 1.19.3 · 1.19.4 · 1.20 · 1.20.1
SHA-1 6236d3b78755541a2967afa35111be61731d4c4c获取文件 item-nbt-api-plugin-2.11.3.jar展开更新日志
What's Changed
- Add 1.20 support
- Try printing the shaders plugin name in incompatibility messages
- Print warning when shading the plugin instead of the api/setting the shaded target to "de.tr7zw.nbtapi" (this is reserved for the official plugin)
- Disable version check for shaded versions by default(turn back on using MinecraftVersion.enableUpdateCheck())
- Add support for boolean in getOrDefault/getOrNull by @SoSeDiK in https://github.com/tr7zw/Item-NBT-API/pull/222
- Allow checking nbt type alongside the key by @SoSeDiK in https://github.com/tr7zw/Item-NBT-API/pull/223
- Bump license-maven-plugin from 2.0.0 to 2.0.1 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/221
- Fix a small typo in nbt-injector by @tom-devv in https://github.com/tr7zw/Item-NBT-API/pull/224
- Bump maven-source-plugin from 3.2.1 to 3.3.0 by @dependabot in https://github.com/tr7zw/Item-NBT-API/pull/227
A heads-up
More features like Mojang mapped jars/Folia support and a cleaner way to access data using interfaces are on the way. You should consider joining the discord to join the discussion.
New Contributors
- @tom-devv made their first contribution in https://github.com/tr7zw/Item-NBT-API/pull/224
Full Changelog: https://github.com/tr7zw/Item-NBT-API/compare/2.11.2...2.11.3
2.11.2
正式版- 加载器
- bukkit · paper · purpur · spigot
- MC 版本
- 1.8.9 · 1.9.4 · 1.10.2 · 1.11.2 · 1.12.2 · 1.13 · 1.13.1 · 1.13.2 · 1.14.4 · 1.15.2 · 1.16.4 · 1.16.5 · 1.17.1 · 1.18.2 · 1.19 · 1.19.1 · 1.19.2 · 1.19.3 · 1.19.4
SHA-1 623e253e1e718cd7ac0a828980bf345547f9a780获取文件 item-nbt-api-plugin-2.11.2.jar展开更新日志
- Add 1.19.4 as officially supported(2.11.1 will work fine on 1.19.4, but show a warning that it doesn't know about this version)
- Fixed the return type of getOrCreateCompound/getCompound in ReadWriteNBT to be ReadWriteNBT too
2.11.1
正式版- 加载器
- bukkit · paper · purpur · spigot
- MC 版本
- 1.8.9 · 1.9.4 · 1.10.2 · 1.11.2 · 1.12.2 · 1.13.2 · 1.14.4 · 1.15.2 · 1.16.4 · 1.16.5 · 1.17.1 · 1.18.2 · 1.19.2 · 1.19.3
SHA-1 788769c5c39d9ede64d7cab12b54e1e30213533f获取文件 item-nbt-api-plugin-2.11.1.jar展开更新日志
What's Changed
- Fix StackOverflowError when merging ReadableNBT by @Kevin-OVI in https://github.com/tr7zw/Item-NBT-API/pull/204
New Contributors
- @Kevin-OVI made their first contribution in https://github.com/tr7zw/Item-NBT-API/pull/204
Full Changelog: https://github.com/tr7zw/Item-NBT-API/compare/2.11.0...2.11.1
2.11.0
正式版- 加载器
- bukkit · paper · purpur · spigot
- MC 版本
- 1.8.9 · 1.9.2 · 1.9.4 · 1.10.2 · 1.11.2 · 1.12.2 · 1.13.2 · 1.14.4 · 1.15.2 · 1.16.4 · 1.16.5 · 1.17.1 · 1.18.2 · 1.19.2 · 1.19.3
SHA-1 f7a40797ae54d26737728730f0c0f58a6d30f551获取文件 item-nbt-api-plugin-2.11.0.jar展开更新日志
New major NBTAPI release, adding 1.19.3 support and a new way to interact with the API.
Changes:
- 1.19.3 support
- Added interfaces to most nbt logic, including read-only versions
- Added a new utility class
NBT, which provides clean lambda access to read and write NBT. https://github.com/tr7zw/Item-NBT-API/wiki/Using-the-NBT-API has updated examples on how to use this class. - Utility
readFrom/saveTomethods to NBTFile hasTagas alternative forhasKey, returningbooleaninstead ofBoolean- Added
getOrDefaultmethod - Added
getOrNullmethod - Deprecated
setObject/getObject, please do the serialization yourself using your preferred lib/settings getUUID/setUUIDnow will handle pre-1.16 and post-1.16 formats correctly on their owngetItemStackwill now return null if the tag is not foundgetKeysis now a copy of the Set, and no longer linked to NMS internal objects- Added
setItemStackArray/getItemStackArraymethods - Added
modifyMetamethods to ItemStacks. Do not modify the NBT while inside the modifyMeta scope - The wiki is now inside the Github repository, so anyone can make pull requests to add examples, clarifications etc.
NBTItemnow will correctly reject ItemStacks of size 0- Updated a lot of Javadoc
- The full API Javadoc is now available under https://tr7zw.github.io/Item-NBT-API/v2-api/
- Pulling the NBTAPI plugin via Maven/Gradle will now also correctly contain the API Javadoc(only had the plugin Javadoc before)
- Fixed small NPE error during error reporting(ironic)
NBTCompoundListnow extendNBTList<ReadWriteNBT>instead ofNBTList<NBTListCompound>. This is a compile-time breaking change, and code needs to be updated accordingly. Already published plugins should not be affected by this.
2.10.0
正式版- 加载器
- bukkit · paper · purpur · spigot
- MC 版本
- 1.7.9 · 1.7.10 · 1.8.8 · 1.8.9 · 1.9.4 · 1.10.2 · 1.11.2 · 1.12.2 · 1.13.2 · 1.14.4 · 1.15.2 · 1.16 · 1.16.1 · 1.16.2 · 1.16.3 · 1.16.4 · 1.16.5 · 1.17 · 1.17.1 · 1.18 · 1.18.1 · 1.18.2 · 1.19 · 1.19.1 · 1.19.2
SHA-1 035a32f986e26c38e0ac90d6652a7534d2585bbd获取文件 item-nbt-api-plugin-2.10.0.jar展开更新日志
Added:
-
1.19 support
-
1.7.10 Crucible support(use the latest build). Thanks, EverNife
