let's say, that i want to give an item with as much nbt data as this: {display: {Name: '{"extra":[{"bold":true,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"dark_gray","text":"Słaby Klucz"}],"text":""}'}, PublicBukkitValues: {"excellentcrates:crate_key.id": "bad"}}, how put all that into the - give command?!
#(SuperPou) how to give items with a lot of nbt?
36 messages · Page 1 of 1 (latest)
(SuperPou) how to give items with a lot of nbt?
Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>
!xyproblem
Your question seems to be an XY Problem - you're asking about your attempted solution rather than your original problem.
Read in detail about the XY Problem here: http://xyproblem.info/
For an example of an XY Problem we've seen in Denizen, the question "how do I make an event for when a flag expires" has no answer, but the same question asked with full background detail will be something more like "I have this script: [LINK HERE], which sets a 3 minute cooldown flag on a player for when they use an ability. I want the player to be notified when the cooldown completes - how do I do this?" which we can then answer quite effectively (in this example, all that was needed was a simple wait command, no events or flag-listening or anything).
Generally, use item scripts with mechanisms to apply anything you need
!l item scripts
Possible Confusion
Did you mean to search for item script containers?
Item script containers are an easy way to pre-define custom items for use within scripts. Item
scripts work with the ItemTag object, and can be fetched with the Object Fetcher by using the
ItemTag constructor ItemTag_script_name. Example: - drop <player.location> super_dooper_diamond
The following is the format for the container. Except for the 'material' key (and the dScript
required 'type' key), all other keys are optional.
<code>
The name of the item script is the same name that you can use to construct a new
ItemTag based on this item script. For example, an item script named 'sword_of_swiftness'
can be referred to as simply 'sword_of_swiftness'.
Item_Script_Name:
type\: item
# Must be a valid ItemTag. See 'ItemTag' for more information.
# \| All item scripts MUST h...
Group
Script Container System
Other then that, see ^ - what are you actually trying to do?
i'm trying to give a player an item with a lot of nbt tags (written as you would put it in a /give command), but i'm not sure how to turn all of them into a format denizen can understand (using - give)
^ Please read this, that is still just your attempted solution to some underlaying problem
You generally don't directly use NBT in Denizen, and instead set specific stuff with the appropriate mechanisms
What are you trying to do that requires working directly with NBT?
i'm trying to give a crate key to the player, but might want to give other items with lots of custom nbt data that i created myself
I'm assuming a crate key from another plugin? if so, don't need to mess with NBT at all - can just store it in a server flag and use that
well, the key can be given with a command too, what about that?
Hold a copy of the key and /ex flag server crate_key:<player.item_in_hand>, then <server.flag[crate_key]> whenever you need it in a script
Ideally just implement your own crate system with Denizen, then you can use item scripts directly (iirc there's even a script on the forums for that), but if you'd still like to use whatever other plugin you have, can just store it's keys like that ^ for use in scripts
do flags stay even after a server restart?
Possible Confusion
Did you mean to search for long term memory: flags?
View the guide page 'Long Term Memory: Flags' at: https://guide.denizenscript.com/guides/basics/flags.html
Have you read the guide yet ^? it explains most of that stuff