AdvancementPredicate

Link to advancementpredicate

Represents a predicate around an advancement.

This predicate can be used to check the completion status of the advancement, either specifying specific criteria to check against, or the full advancement. It is not possible to check against both, since the two checks are effectively incompatible with each other.

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

ZenScript
Copy
import crafttweaker.api.predicate.AdvancementPredicate;

已实现的接口

Link to 已实现的接口

AdvancementPredicate implements the following interfaces. That means all methods defined in these interfaces are also available in AdvancementPredicate

Name: withCompleted

Specifies that the advancement must be completed to pass the check.

If this predicate had already been set to check for an in-progress advancement status, this setting is overwritten. If the predicate had been set to check for a specific set of criteria, the predicate will be in an invalid state.

Returns: This predicate for chaining.
Return Type: AdvancementPredicate

ZenScript
Copy
// AdvancementPredicate.withCompleted() as AdvancementPredicate

myAdvancementPredicate.withCompleted();

Name: withInProgress

Specifies that the advancement must not be completed, that is being in-progress, to pass the check.

If this predicate had already been set to check for completion, this setting is overwritten. If the predicate had been set to check for a specific set of criteria, the predicate will be in an invalid state.

Returns: This predicate for chaining.
Return Type: AdvancementPredicate

ZenScript
Copy
// AdvancementPredicate.withInProgress() as AdvancementPredicate

myAdvancementPredicate.withInProgress();

Link to withInProgressCriterion

Name: withInProgressCriterion

Adds the criterion name to the list of criteria to check for in-progress status.

If the predicate had already been set to check for this criterion's completion, the setting is overwritten. If the predicate had been set to check for a completion status, the predicate will be in an invalid state.

Returns: This predicate for chaining.
Return Type: AdvancementPredicate

ZenScript
Copy
AdvancementPredicate.withInProgressCriterion(name as string) as AdvancementPredicate
参数类型描述
参数
name(名称)
类型
string
描述
The name of the criterion to check for in-progress status.

Link to withPassedCriterion

Name: withPassedCriterion

Adds the criterion name to the list of criteria to check for completion.

If the predicate had already been set to check for this criterion's in-progress status, the setting is overwritten. If the predicate had been set to check for a completion status, the predicate will be in an invalid state.

Returns: This predicate for chaining.
Return Type: AdvancementPredicate

ZenScript
Copy
AdvancementPredicate.withPassedCriterion(name as string) as AdvancementPredicate
参数类型描述
参数
name(名称)
类型
string
描述
The name of the criterion to check for completion.