PlayerAdvancements

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

script.zs
import crafttweaker.api.advancement.PlayerAdvancements;

Members

award(advancement as AdvancementHolder, criteria as string) as bool
Awards an advancement to the player.

Returns: Whether the advancement was awarded.

script.zs
// PlayerAdvancements.award(advancement as AdvancementHolder, criteria as string) as bool;
myPlayerAdvancements.award(myAdvancementHolder, myString);

Parameters:

advancement Type: AdvancementHolder - The advancement to award.
criteria Type: string - The criteria to award.

Return Type: bool

flushDirty(player as ServerPlayer)
Updates the advancements on the client
script.zs
// PlayerAdvancements.flushDirty(player as ServerPlayer);
myPlayerAdvancements.flushDirty(myServerPlayer);

Parameters:

player Type: ServerPlayer - The player to flush the dirty state of.
getOrStartProgress(advancement as AdvancementHolder) as AdvancementProgress
Gets the progress of an advancement.

Returns: The progress of the advancement.

script.zs
// PlayerAdvancements.getOrStartProgress(advancement as AdvancementHolder) as AdvancementProgress;
myPlayerAdvancements.getOrStartProgress(myAdvancementHolder);

Parameters:

advancement Type: AdvancementHolder - The advancement to get the progress of.

Return Type: AdvancementProgress

revoke(advancement as AdvancementHolder, criteria as string) as bool
Revokes an advancement from the player.

Returns: Whether the advancement was revoked.

script.zs
// PlayerAdvancements.revoke(advancement as AdvancementHolder, criteria as string) as bool;
myPlayerAdvancements.revoke(myAdvancementHolder, myString);

Parameters:

advancement Type: AdvancementHolder - The advancement to revoke.
criteria Type: string - The criteria to revoke.

Return Type: bool