Project home for New Alterlite - A new locaria community pack focused on a different approach of minecrafting.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewAlterlite/config/triumph/documentation/script/ScriptAdvancement.txt

379 lines
13 KiB

These are the functions which can be called directly in a script advancement file.
setBackground:
Arguments:
boolean
Usage:
background resource location
Notes:
Sets the background for the advancement page. This is required and only used by root advancements. Be aware the background is tiled.
setDescription:
Arguments:
String
Usage:
description
Notes:
Sets the description for the advancement. This or setTranslatedDescription is required.
addParent:
Arguments:
String
Notes:
Adds a parent for the advancement. This only effects its position on the advancement page and connection lines. By default parents are not required for the advancement to be completed. At least one parent is required for non-root advancements. If the string ends with a / it will be treated as a folder, and all advancements within that folder will be added as parents.
setPos:
Arguments:
int, int
Usage:
x pos, y pos
Notes:
Sets the x and y coordinates of the advancement.
addCriteria:
Arguments:
String, String
Usage:
criteria name, criteria trigger type
Notes:
Adds a criteria to the advancement with the specified type. Returns the criteria object for use as a variable.
setIcon:
Arguments:
ItemBlockData
Usage:
item data
Notes:
Sets the item icon for the advancement. This is required.
setTitle:
Arguments:
String
Usage:
title
Notes:
Sets the title for the advancement. This or setTranslatedTitle is required.
setHidden:
Arguments:
boolean
Usage:
if the advancement should be hidden
Notes:
Sets if the advancement should be hidden until it is completed. Not compatible with other visibility options.
drawDirectLines:
Notes:
Sets the advancement to draw direct lines to parents.
hideLines:
Notes:
Sets the advancement to hide connection lines to parents.
setUncompletedTitleColor:
Arguments:
int
Usage:
color int
Notes:
Sets the uncompleted title color for the advancement.
setUncompletedTitleColor:
Arguments:
int, int, int
Usage:
red, green, blue
Notes:
Sets the uncompleted title color for the advancement.
setCompletedTitleColor:
Arguments:
int
Usage:
color
Notes:
Sets the completed title color for the advancement.
setCompletedTitleColor:
Arguments:
int, int, int
Usage:
red, green, blue
Notes:
Sets the completed title color for the advancement.
setTranslatedTitle:
Arguments:
String
Usage:
title translation path
Notes:
Sets the translated title for the advancement. Used for localization. This or setTitle is required.
pageAlwaysVisible:
Notes:
Only usable in root advancements. Makes the page always visible. All visibility options (alwaysVisible, alwaysHidden, visibleIf, hiddenIf, visibleUnless and hiddenUnless) are run in order of addition to the script. The first one in the list to be completed is the one which enforces its visibility option.
setCompletedIconColor:
Arguments:
int
Usage:
color
Notes:
Sets the completed icon color for the advancement.
setCompletedIconColor:
Arguments:
int, int, int
Usage:
red, green, blue
Notes:
Sets the completed icon color for the advancement.
setUncompletedIconColor:
Arguments:
int
Usage:
color int
Notes:
Sets the uncompleted icon color for the advancement.
setUncompletedIconColor:
Arguments:
int, int, int
Usage:
red, green, blue
Notes:
Sets the uncompleted icon color for the advancement.
setAnnounceToChat:
Arguments:
boolean
Usage:
if advancement completion should be announced in chat
Notes:
Sets if the advancement completion should be announced in chat.
setRewardExperience:
Arguments:
int
Usage:
experience
Notes:
Sets the experience amount for the reward for completing the advancement. This is in xp, not in levels.
addRewardSkillable:
Arguments:
String, int
Usage:
skill, levels
Notes:
Adds a Skillable skill level up reward.
setTranslatedDescription:
Arguments:
String
Usage:
description translation path
Notes:
Sets the description for the advancement. Used for localization. This or setDescription is required.
addRewardFunction:
Arguments:
String
Usage:
function name
Notes:
Adds the function with the provided name as a reward for completing the advancement.
setUncompletedLineColor:
Arguments:
int
Usage:
color int
Notes:
Sets the uncompleted line color for the advancement.
setUncompletedLineColor:
Arguments:
int, int, int
Usage:
red, green, blue
Notes:
Sets the uncompleted line color for the advancement.
pageVisibleUnless:
Arguments:
String
Usage:
Advancement resource location or gamestage name
Notes:
Only usable in root advancements. Makes the page visible if the provided advancement/gamestage is not completed. All visibility options (alwaysVisible, alwaysHidden, visibleIf, hiddenIf, visibleUnless and hiddenUnless) are run in order of addition to the script. The first one in the list to be completed is the one which enforces its visibility option.
setCompletedLineColor:
Arguments:
int, int, int
Usage:
red, green, blue
Notes:
Sets the completed line color for the advancement.
setCompletedLineColor:
Arguments:
int
Usage:
color int
Notes:
Sets the completed line color for the advancement.
setRequiresParents:
Notes:
This is a helper method which adds criteria either named 'completedParent'/'completedParent2'/etc or if the 'useNewParentCompletionCriteriaNames' option is set in the main config named the same as their title or resource location (Example: "Completed Some Advancement Title") with type "triumph:completed_advancement", and makes them a requirement. This effectively makes the advancement require its parents to be completed before it can be completed.
addRewardLootTable:
Arguments:
String
Usage:
loottable resource location
Notes:
Adds a loot table reward.
pageRequiresRoot:
Notes:
Convenience method to add a 'triumph:completed_advancement' criteria for this root to every advancement on the page. Can only be used in a root advancement.
setRequirements:
Arguments:
String, String array
Usage:
Requirements type, criteria exception array
Notes:
This is a helper method designed to make setting criteria requirements easier. If set to "all" this will make all criteria required for completion. If set to "any" this will make any criteria complete the advancement. If set to "any" the array of criteria exceptions is used to configure the requirements where all exceptions are required plus any other single criteria.
setRequirements:
Arguments:
String
Usage:
Requirements type. This type can be either "any" or "all"
Notes:
This is a helper method designed to make setting criteria requirements easier. If set to "all" this will make all criteria required for completion. If set to "any" this will make any criteria complete the advancement.
addRequirements:
Arguments:
String array
Usage:
array of criteria requirements
Notes:
This is the manual way of adding requirements. The array of criteria requirements will be added as a requirement array. This is done in basically the same way as vanilla Json advancements, where an array of requirements is a group of criteria that, if all are completed, the advancement is completed. Multiple arrays can be added by calling this function multiple times.
pageAlwaysHidden:
Notes:
Only usable in root advancements. Makes the page always hidden. All visibility options (alwaysVisible, alwaysHidden, visibleIf, hiddenIf, visibleUnless and hiddenUnless) are run in order of addition to the script. The first one in the list to be completed is the one which enforces its visibility option.
pageVisibleIf:
Arguments:
String
Usage:
Advancement resource location or gamestage name
Notes:
Only usable in root advancements. Makes the page visible if the provided advancement/gamestage is complete. All visibility options (alwaysVisible, alwaysHidden, visibleIf, hiddenIf, visibleUnless and hiddenUnless) are run in order of addition to the script. The first one in the list to be completed is the one which enforces its visibility option.
pageHiddenIf:
Arguments:
String
Usage:
Advancement resource location or gamestage name
Notes:
Only usable in root advancements. Makes the page hidden if the provided advancement/gamestage is complete. All visibility options (alwaysVisible, alwaysHidden, visibleIf, hiddenIf, visibleUnless and hiddenUnless) are run in order of addition to the script. The first one in the list to be completed is the one which enforces its visibility option.
addRewardRecipe:
Arguments:
String
Usage:
recipe name
Notes:
Adds a recipe as a reward for completing the advancement. You can get the name of the recipe you want to grant from NEI or JEI.
alwaysVisible:
Notes:
Makes the advancement always visible. All visibility options (alwaysVisible, alwaysHidden, visibleIf, hiddenIf, visibleUnless and hiddenUnless) are run in order of addition to the script. The first one in the list to be completed is the one which enforces its visibility option.
setShowToast:
Arguments:
boolean
Usage:
if the toast should be shown
Notes:
Sets if a toast should be shown to the player when the advancement is completed.
visibleIf:
Arguments:
String
Usage:
Advancement resource location or gamestage name
Notes:
Makes the advancement visible if the provided advancement/gamestage is complete. All visibility options (alwaysVisible, alwaysHidden, visibleIf, hiddenIf, visibleUnless and hiddenUnless) are run in order of addition to the script. The first one in the list to be completed is the one which enforces its visibility option.
visibleUnless:
Arguments:
String
Usage:
Advancement resource location or gamestage name
Notes:
Makes the advancement visible if the provided advancement/gamestage is not completed. All visibility options (alwaysVisible, alwaysHidden, visibleIf, hiddenIf, visibleUnless and hiddenUnless) are run in order of addition to the script. The first one in the list to be completed is the one which enforces its visibility option.
addRewardItem:
Arguments:
ItemBlockData
Usage:
item data
Notes:
Adds the item as a reward for completing this advancement.
setFrameType:
Arguments:
boolean
Usage:
frame type
Notes:
Sets the frame type for the advancement. Options are "TASK", "CHALLENGE", "GOAL". Default is TASK.
alwaysHidden:
Notes:
Makes the advancement always hidden. All visibility options (alwaysVisible, alwaysHidden, visibleIf, hiddenIf, visibleUnless and hiddenUnless) are run in order of addition to the script. The first one in the list to be completed is the one which enforces its visibility option.
hiddenIf:
Arguments:
String
Usage:
Advancement resource location or gamestage name
Notes:
Makes the advancement hidden if the provided advancement/gamestage is complete. All visibility options (alwaysVisible, alwaysHidden, visibleIf, hiddenIf, visibleUnless and hiddenUnless) are run in order of addition to the script. The first one in the list to be completed is the one which enforces its visibility option.
hiddenUnless:
Arguments:
String
Usage:
Advancement resource location or gamestage name
Notes:
Makes the advancement hidden if the provided advancement/gamestage is not completed. All visibility options (alwaysVisible, alwaysHidden, visibleIf, hiddenIf, visibleUnless and hiddenUnless) are run in order of addition to the script. The first one in the list to be completed is the one which enforces its visibility option.
setRepeatTime:
Arguments:
long
Usage:
number of seconds before the advancement can be repeated
Notes:
Sets the number of seconds real time between advancement completion and when it will be completable again.
pageHiddenUnless:
Arguments:
String
Usage:
Advancement resource location or gamestage name
Notes:
Only usable in root advancements. Makes the page hidden if the provided advancement/gamestage is not completed. All visibility options (alwaysVisible, alwaysHidden, visibleIf, hiddenIf, visibleUnless and hiddenUnless) are run in order of addition to the script. The first one in the list to be completed is the one which enforces its visibility option.