Parse more than one enchant?

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

Szymoon202

New Member
Jan 3, 2018
5
0
0
21
Kraków, Poland
mineserwer.pl
Hi, i have a problem with parse as enchantment type. My code:
code_language.skript:
set {_item} to {kity::%{_kit}%::gui::item}
set name of {_item} to colored {kity::%{_kit}%::gui::item::name}
enchant {_item} with {kity::%{_kit}%::gui::item::enchants} parsed as enchantment
set slot {kity::%{_kit}%::gui::slot} of {_p}'s current inventory to {_item}

all above variables are loaded on skript load from yaml file. When the {kity::%{_kit}%::gui::item::enchants} has a one enchant, like efficiency 5, i get item with enchantment, but when there's more than one - not works, i didn't get item... How i can fix this?

NOT WORKING:
code_language.skript:
    gui:
      material: stone pickaxe
      name: "&6» &7Zestaw Startowy &6«"
      enchants: efficiency 5 and unbreakable 3
      slot: 1
WORKING:
code_language.skript:
    gui:
      material: stone pickaxe
      name: "&6» &7Zestaw Startowy &6«"
      enchants: efficiency 5
      slot: 1
 
code_language.skript:
command /test:
    trigger:
        equip player with all leather armour of projectile protection 2 and unbreaking 5
works fine for me, try if it works in your server
 
code_language.skript:
command /test:
    trigger:
        equip player with all leather armour of projectile protection 2 and unbreaking 5
works fine for me, try if it works in your server
Well, its working for you, but he not, cuz he is using Yaml and then with "and" and then parsing it as
enchantment (And will be removed) so this is the problem...

So.... Maybe you could add a list? Like
Entchaments:
- Unbreaking 3
- Silk Touch 1
 
You'd have to manually parse the list yourself by splitting the value at commas and " and " then parsing each one you split out.
 
Status
Not open for further replies.