//Set icon item
setIcon("betterwithmods:single_machine")

//Set title String
setTitle("One Millstone to rule them all!")

//Set description String
setDescription("Craft the Millstone and up your game! Place a HAND CRANK on top or beside and crank away!")

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

//Adds criteria named "hasMill" with the trigger type "minecraft:inventory_changed". This function returns the criteria as an object
criteria = addCriteria("hasMill", "minecraft:inventory_changed")
//Adds the required item for the criteria. This is the item that needs to be in the player inventory. First variable is the item name, second is the metadata and is not required.
criteria.addItem("betterwithmods:single_machine")

//Sets the experience reward for the advancement.
setRewardExperience(10)

//By not setting anything about requirements here, all criteria are automatically required