Solved Help with hidden NBT and SkStuff

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

    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.

aescraft

Well-Known Member
Mar 1, 2017
295
13
0
Hello.
I want to create hidden NBT tags to work as a voucher for trades in shopkeepers.

The NBT Tag I want to be stored is %playername% and %arg 1%, arg 1 being <text> from a command.

Here is the code so far:
code_language.skript:
command /nbt <text>:
  trigger:
    set all paper from the inventory of the player to paper with nbt "{display:{Lore:["lore here", "lore here"]}"

The problem is that it says "lore is not a valid item data". So it's impossible to do what I want here?
I'm using SkStuff for the NBT management.
 
If you want to have quotes inside of quotes, you need to double the quotes, so the tag would become
code_language.skript:
"{display:{Lore:[""lore here"", ""lore here""]}}"
 
If you want to have quotes inside of quotes, you need to double the quotes, so the tag would become
code_language.skript:
"{display:{Lore:[""lore here"", ""lore here""]}}"
Same error.
Do you have in mind another method to create a paper with custom hidden tags to players use to create currency for their store?
 
Last edited by a moderator:
Your main issue is probably that the syntax "set all paper from the inventory of the player to paper with nbt" doesn't make sense. However, if you want to have a hidden tag on an item, just put a fake tag on it. Items support having non-real tags, unlike entities:

code_language.skript:
give 1 of paper with custom NBT "{Value:1}" to the player

The paper would then have the provided 'Value' tag on it, which could be retrieved with tag "Value" of NBT of %item%
 
Your main issue is probably that the syntax "set all paper from the inventory of the player to paper with nbt" doesn't make sense. However, if you want to have a hidden tag on an item, just put a fake tag on it. Items support having non-real tags, unlike entities:

code_language.skript:
give 1 of paper with custom NBT "{Value:1}" to the player

The paper would then have the provided 'Value' tag on it, which could be retrieved with tag "Value" of NBT of %item%
Is it possible to have lore 1: player name and lore 2: custom value being the custom value the argument <text> from the command?

Your code is working, using {value:1}, but when I try this:
I tried:

code_language.skript:
        give 64 of paper with custom NBT "{Display:{Name:"Cheque",Lore:["Emitido por %player%","Anotação"]}}" to the player

It says it's not a valid item data.
[doublepost=1492114998,1492111589][/doublepost]Solution found!
First of all, you need to remove all the " from the NBT part of the code:
code_language.skript:
{Display:{Name:"Cheque",Lore:["Emitido por %player%","Anotação"]}}

to

code_language.skript:
{Display:{Name:Cheque,Lore:[Emitido por %player%,Anotação]}}

But the with custom NBT it does not display as a lore.

So, instead, I used this:

code_language.skript:
execute console command "/give %player% paper 64 0 {display:{Name:Cheque,Lore:[%player%,%arg 1%]}}
 
I told you in my very first reply that you can't have quotes in the NBT, you have to do two quotes. Your original code would work if like this:

code_language.skript:
give 64 of paper to the player with custom NBT "{display:{Name:""Cheque"",Lore:[""Emitido por %player%"",""Anotação""]}}"

You NEED to have two " when you want to include it inside of another text like that. I promise you it works perfectly as I do it all the time on my server. There's no need to use console commands, just read what I said and let me know if you don't understand it still.
 
I told you in my very first reply that you can't have quotes in the NBT, you have to do two quotes. Your original code would work if like this:

code_language.skript:
give 64 of paper to the player with custom NBT "{display:{Name:""Cheque"",Lore:[""Emitido por %player%"",""Anotação""]}}"

You NEED to have two " when you want to include it inside of another text like that. I promise you it works perfectly as I do it all the time on my server. There's no need to use console commands, just read what I said and let me know if you don't understand it still.
Ok, I know this should work, but isn't working for me.

I found out I have SkQuery and Skstuff, I think both of them is trying to access the NBT and giving the error of the "invalid item data".
Do you know if this is the cause? Thanks.
[doublepost=1494450283,1494449896][/doublepost]Nope, SKquery does not have the NBT support.
Well, looks like the SkStuff is not working right on the NBT part.
 
Ok, I know this should work, but isn't working for me.

I found out I have SkQuery and Skstuff, I think both of them is trying to access the NBT and giving the error of the "invalid item data".
Do you know if this is the cause? Thanks.
[doublepost=1494450283,1494449896][/doublepost]Nope, SKquery does not have the NBT support.
Well, looks like the SkStuff is not working right on the NBT part.

You don't need to edit the nbt to change the name and lore (since it is the only thing you are changing).
code_language.skript:
give a paper named "Cheque" with lore "Emitido por %player%||Anotação" to player
The '||' makes a new line using SkQuery lore expression.
 
You don't need to edit the nbt to change the name and lore (since it is the only thing you are changing).
code_language.skript:
give a paper named "Cheque" with lore "Emitido por %player%||Anotação" to player
The '||' makes a new line using SkQuery lore expression.
Is it possible to give "a enchanted paper named (...)"? Can't find out how.
 
You can use the glowing effect.
I've tested it already with this syntax:

code_language.skript:
give a GLOWING paper named "Cheque" with lore "Emitido por %player%||Anotação" to player

does not work.
[doublepost=1495340913,1495299816][/doublepost]Solution found!

The syntax with "to player" at the end does not work with the "glowing" effect..
You need to use this:

code_language.skript:
    give player glowing ITEMNAME named "NAME HERE" with lore "LORE HERE"

Thanks for the help everyone.
 
Status
Not open for further replies.