Set NBT in 1.12?

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
Apr 12, 2017
36
0
0
24
I am just screwing around with NBT atm and i cant seem to get it to work. It is not returning any errors. It might be because I am running an outdated version, but i am using the Tuke-Nuke fork. I am running a 1.12.2 server.
code_language.skript:
on damage:
    add "{AttackDamage:123}" to nbt of attacker's tool
    broadcast "%nbt of attacker's tool%"
m5HzCpg.png

When I damage the mob, it is suppose to return the NBT of the attacker's weapon. It only returns "<none>" though.
2ESrM3A.png

When I check the item's nbt in the gui, it isn't changed.
 
non official : https://github.com/Tuke-Nuke/SkStuff ,
it's a hotfix for 1.12



In case of bugs:

  • If it is a bug related to NBTs or Pathfind and it only happens in 1.12, you can report it here and I will try to help.
  • Any other bugs, should be reported at official pages. Since it is a temporary fork.
 
i use this on 1.10.2 , maybe shoud work on 1.12 (or maybe not ...)

code_language.skript:
import:
    org.bukkit.craftbukkit.v1_10_R1.inventory.CraftItemStack

object property item[stack] nbt:
    get:
        set {_object} to expression-1
        if {_object} is an item:
            set {_nbt} to CraftItemStack.asNMSCopy({_object}).getTag()
        return {_nbt}


you need the addon skript-mirror , and replace "v1_10_R1" with "v1_12_R1"

Then try
code_language.skript:
send "%itemstack nbt of tool of player%" to player
Note : This work on 1.10.2 and 1.12.2 *TESTED*




it's for *GET* the nbt, i don't know how to set them ... (except using Vanilla commands)
 
Last edited:
i use this on 1.10.2 , maybe shoud work on 1.12 (or maybe not ...)

code_language.skript:
import:
    org.bukkit.craftbukkit.v1_10_R1.inventory.CraftItemStack

object property item[stack] nbt:
    get:
        set {_object} to expression-1
        if {_object} is an item:
            set {_nbt} to CraftItemStack.asNMSCopy({_object}).getTag()
        return {_nbt}


you need the addon skript-mirror , and replace "v1_10_R1" with "v1_12_R1"

Then try
code_language.skript:
send "%itemstack nbt of tool of player%" to player
Note : This work on 1.10.2 and 1.12.2 *TESTED*




it's for *GET* the nbt, i don't know how to set them ... (except using Vanilla commands)
Thank you! I will try it out!
 
Status
Not open for further replies.