Hello! Ive recently Tried to Learn Skript YAML and it was going pretty well untill I hit a roadblock and I cant solve it, so I wanted to ask for some help 
So Im working on a GUI where players can upgrade their items etc etc, and each item is saved as an individual .yml file so I can edit the name lore etc, but here is my problem, I tried using a list or someway of adding enchants, but I couldnt parse the list nor could I enchant items with it, I tried Parse as enchantment type and level, but it just doesnt seem to work for me sadly, so here is what my basic yml file looks like:
And this is my function to retrieve the information:
And there aren't any errors, just that it doesnt enchant it correctly, if the list only contains 1 enchant then it atleast outputs it correctly to the broadcast, but still the item doesnt get enchanted, and more then one enchant is just <none>
Anyways as always I very much appreciate help and this platform
So Im working on a GUI where players can upgrade their items etc etc, and each item is saved as an individual .yml file so I can edit the name lore etc, but here is my problem, I tried using a list or someway of adding enchants, but I couldnt parse the list nor could I enchant items with it, I tried Parse as enchantment type and level, but it just doesnt seem to work for me sadly, so here is what my basic yml file looks like:
Code:
name: "&6Wooden Axe &8[&7I&8]"
type: wooden axe
price: "64 oak log"
enchants: unbreaking 1 and efficiency 2
damage: 2
And this is my function to retrieve the information:
Code:
function createItem(player: player, id: number, type: text) :: item:
if file "plugins/Items/%{_type}%/%{_id}%.yml" doesn't exist:
send "&7[&bItems&7] &8» &cUnable to generate an item. This ID does not exist." to {_player}
else:
load "plugins/Items/%{_type}%/%{_id}%.yml" as "items-%{_type}%-%{_id}%"
set {_name} to yaml value "name" from "items-%{_type}%-%{_id}%"
set {_itemType} to yaml value "type" from "items-%{_type}%-%{_id}%"
set {_price-shown} to yaml value "price" from "items-%{_type}%-%{_id}%"
set {_enchants::*} to yaml value "enchants" from "items-%{_type}%-%{_id}%"
loop {_enchants::*}:
set {_enchant} to loop-value parsed as enchantment type
broadcast "%{_enchant}%"
enchant {_item} with {_enchant}
set {_item} to {_itemType} parsed as item
set name of {_item} to colored {_name}
set lore of {_item} to colored "&a%{_price-shown}%"
add hide attributes to item flags of {_item}
add hide enchants to item flags of {_item}
return {_item}
And there aren't any errors, just that it doesnt enchant it correctly, if the list only contains 1 enchant then it atleast outputs it correctly to the broadcast, but still the item doesnt get enchanted, and more then one enchant is just <none>
Anyways as always I very much appreciate help and this platform