//Set the icon item
setIcon(<minecraft:enchanted_book>)

//Set the title String
setTitle("Enchanting")

//Set the description String
setDescription("Enchant a golden sword")

//Set the parent advancement. The syntax is "modid:folder/path/to/the/advancement/then/filename"
setParent("triumph:example/root")

//Set the position
setPos(11, 14)

//Set this to use direct lines, so I can have a pretty shape
drawDirectLines(true)

//Adds criteria named "enchanted" with the trigger type "minecraft:enchanted_item". This function returns the criteria as an object
criteria = addCriteria("enchanted", "minecraft:enchanted_item")

//Sets the required item for the criteria. This is the item that needs to be enchanted.
criteria.setItem(<minecraft:golden_sword>)