Resource icon
  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Supported Minecraft Versions
  1. 1.12
jNBT

jNBT allows you to read and modify the NBT data of all entities, items and tile-entities.
This is the product of hours of trying to figure out how to get this stuff to work correctly and reading through example code. Yet, it doesn't offer as much depth as SkStuff does - however i do intend to upgrade this.

This add-on is purely dedicated to providing NBT usages. There won't be any non-NBT related functionality added to it.


Installation
  • Requires:
    • Spigot 1.12.*
  1. Put the jar in the plugins-folder
  2. Restart the server (observe the console for errors)
Links
Incompatible with
  • SkStuff
    You can make it compatible with SkStuff by specifying "item-nbt", "block-nbt" & "entity-nbt" as opposed to using plain "nbt"
    Definitly gonna have issues if you run both
Contents
Entity NBT

code_language.skript:
%entity%'s [entity-]nbt
[entity-]nbt of %entity%
Methods:
  • get
  • add
Examples
code_language.skript:
add "{NoAI:true}" to last spawned entity's nbt
add "{Silent:1b}" to player's targeted entity's nbt
add "{Something:something}" to entity-nbt of event-entity
broadcast "%last spawned entity's nbt%"
Item NBT
code_language.skript:
%item%'s [item-]nbt
[item-]nbt of %item%
Methods:
  • get
  • add
  • remove (work in progress)
  • set
  • delete
  • reset
Examples
code_language.skript:
send "%{_player}'s tool's item-nbt%" to all players
broadcast "%nbt of event-player's helmet%"
add "{SomeTag:1234}" to player's tool's item-nbt
reset event-player's helmet's nbt
set nbt of command sender's chestplate to "{Yes:false,No:true}"
Block NBT (Tile entities)
code_language.skript:
%block%'s [block-]nbt
[block-]nbt of %block%
Methods:

  • add
  • get
  • set (kinda useless)
Examples
code_language.skript:
add "{RequiredPlayerRange:0s}" to targeted block's nbt
add "{SpawnData:{id:""minecraft:wither""}}" to nbt of clicked block
broadcast "%event-block's nbt%"
Joined NBT
code_language.skript:
joined nbt[( |-)string] from %string% and %string%
Joins two different NBTs together. The latter value will overwrite conflicting values between the two.

Examples
code_language.skript:
set {_ex} to joined nbt from "{Test:false,Whatever:123}" and "{Something:something,Test:true}"
# {_ex} = "{Test:true,Whatever:123,Something:something}"
Tag %string% of NBT
code_language.skript:
tag %string% of %string%
Returns the value of the specified tag of the specified NBT

Examples
code_language.skript:
set {_tag} to tag "Invulnerable" of targeted entity's nbt

To do
  • Support MC 1.13
    • This might take some time
    • If you want compability for 1.11 or earlier, use SkStuff
    • There are no plans to create backwards compability
  • Add more in-depth NBT editing capabilities
  • Find a way to add NBT to items without having to create a new one completed!
  • Make it compatible with SkStuff maybe (it kinda is already)
  • Drink lots of coffee
Good stuff?
If you like this resource, please consider buying me a coffee:
PayPal: https://www.paypal.me/langejulian
Author
jaylawl
Downloads
2,853
Views
2,853
First release
Last update
Rating
5.00 star(s) 7 ratings

More resources from jaylawl

Latest updates

  1. 0.3.2

    0.3.2 Fixed some more NPEs on the "tag %string% of nbt" expression
  2. 0.3.1

    0.3.1 Fixed some NPEs on the "tag of nbt" expression
  3. 0.3

    0.3 Added the expression joined nbt[( |-)string] from %string% and %string% Added the...

Latest reviews

One of the most useful addons yet. Although the examples and the usage is a bit confusing, once you figure it out it becomes really easy. I made numerous skripts using your addon, and can't thank you enough for it!

set nbt of this comment to "{Awesome:true}"
Love it! This has helped me a lot. I have used it for custom nbt and a lot more then it should be able too lol... Is there any way to do an if statement to check if an items contains x nbt?
This is perfect. But, I just want to know something, can we add custom nbt tag ?
I'm working on an NBT-heavy project, and with the recent versions of Skript (dev34 onwards I think?) not playing nice with SKStuff, I thought I was out of luck.

You've saved me from a world of headaches, thanks a bunch! NBT is such a useful feature, I wish it was part of vanilla Skript...
Perfect script for not only using NBT but also understanding how to use skript-mirror. Very thanks!
jaylawl
jaylawl
Glad you find so many uses in this! If you're looking for examples of skript-mirror usages, also check out my "Expressions+" release , there is tons more in there (although it could be done better) :)
D
Currently very promising!
I hope some new syntaxes arrives in future, as such as get a specific Tag, or sub-Tag! And maybe add tag to an existing item :)
Good luck and keep going! <3
jaylawl
jaylawl
I'm glad you find it useful, thank you. I'm planning on adding all of your wishes and to even make it a .jar add-on instead of "just" a skript-mirror thing.
Great resource, thanks! Good to have something working in many Minecraft versions