Sueta
[A

[Add-on] jNBT

0.3.2

Provides NBT usages within Skript

·Script

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.

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"

Contents
Entity NBT

Entity NBT
%entity%'s [entity-]nbt
[entity-]nbt of %entity%

Methods:

  • get
  • add

Examples

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

Item NBT
%item%'s [item-]nbt
[item-]nbt of %item%

Methods:

  • get
  • add
  • remove (work in progress)
  • set
  • delete
  • reset

Examples

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)

Block NBT
%block%'s [block-]nbt
[block-]nbt of %block%

Methods:

  • add
  • get
  • set (kinda useless)

Examples

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

Joined NBT
joined nbt[( |-)string] from %string% and %string%

Joins two different NBTs together. The latter value will overwrite conflicting values between the two.

Examples

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

Joined NBT
tag %string% of %string%

Returns the value of the specified tag of the specified NBT

Examples

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

Similar projects

Script →