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

//Set title String
setTitle("IT'S A TRAP !!")

//Set description String
setDescription("Obtain a trapped chest")

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

//Set the position
setPos(240,120)

//Hide the connection lines, so I can have a pretty shape
hideLines()

//Adds criteria named "trapped" with the trigger type "minecraft:inventory_changed". This function returns the criteria as an object
criteria = addCriteria("trapped", "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:trapped_chest>)