
//Set icon item
setIcon(<minecraft:chest_minecart>)

//Set title String
setTitle("Train on the Tracks")

//Set description String
setDescription("Minecarts and Track are a cheap way of transporting items over longer distances.")

//Add a parent advancement. The syntax is "modid:folder/path/to/the/advancement/then/filename"
addParent("triumph:islandparadisepart2/standardrail")
addParent("triumph:islandparadisepart2/railroadtie")

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

//Adds the required item for the criteria. This is the item that needs to be in the player inventory.
criteria.addItem(<minecraft:chest_minecart>)
criteria.addItem(<minecraft:rail>)

drawDirectLines(true)

//Set the position
setPos(-407,57)

//Rewards
setRewardExperience(4)