How do I add attributes to items?

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

Duomax

New Member
May 21, 2023
6
1
3
25
I'm trying to make a skript, which previews crates/kits, but I would like to add attributes to the showcased items
Code:
function viewCrate(p: player, crate: text):
 
        if {_crate} is "iron":
                set {_p} to a new chest inventory with 3 rows with name "&f&lIron &7Crate"
                set slot 0 and 1 and 2 and 3 and 4 and 5 and 6 and 7 and 8 and 9 and 17 and 18 and 19 and 20 and 21 and 23 and 24 and 25 and 26 of {_p} to {frame} named "&6"
                set slot 10 of {_p} to unbreakable iron axe of efficiency 10 named "&f&lIron &7Axe" with lore "" and "&7Chance:" and "&7[&a12.5%%&7]"
                set slot 11 of {_p} to unbreakable iron sword of sharnpess 5 named "&f&lIron &7Sword" with lore "" and "&7Chance:" and "&7[&a12.5%%&7]"
                set slot 13 of {_p} to unbreakable iron helmet of protection 3 named "&f&lIron &7Helmet" with lore "" and "&7Chance:" and "&7[&a12.5%%&7]"
                set slot 14 of {_p} to unbreakable iron chestplate of protection 3 named "&f&lIron &7Chestplate" with lore "" and "&7Chance:" and "&7[&a12.5%%&7]"
                set slot 15 of {_p} to unbreakable iron leggings of protection 3 named "&f&lIron &7leggings" with lore "" and "&7Chance:" and "&7[&a12.5%%&7]"
                set slot 16 of {_p} to unbreakable iron boots of protection 3 named "&f&lIron &7Boots" with lore "" and "&7Chance:" and "&7[&a12.5%%&7]"
I would like to add +20% max health to all these items. How do I do that?
 
If you use SkBee, you can modify the NBT data of items. You can then use variables to modify the NBT properties of the items like an item's max health, if you can place it, etc. You'd have to do a little research to figure out how to do specifics on that though.