Skip to content

Advancements

TCreopargh edited this page Feb 20, 2021 · 1 revision

You can manipulate advancements in vanilla or advancements added by other mods.

AdvancementHelper

This is needed to get advancements by ID.

Import:

import mods.ctintegration.advancement.AdvancementHelper;
Method Description
static IAdvancement getAdvancementById(IServer server, String id) Get an IAdvancement with the given id, may return null.
static List getAdvancements(IServer server) Get a list of all advancements

IAdvancement

import mods.ctintegration.advancement.IAdvancement;
Getter return type description
id String resource location of the advancement
displayText ITextComponent
title ITextComponent
description ITextComponent
requirements String[][]
requirementCount int
children List
criterion List
parent IAdvancement
Method Description
void applyRewards(IPlayer player) Give the advancement rewards to a player

IAdvancementProgress

Indicates the progress of an advancement.

You can get it from IPlayer#getAdvancementProgress(IAdvancement advancement)

Import:

import mods.ctintegration.advancement.IAdvancementProgress;
Method Description
boolean isDone()
boolean hasProgress()
boolean grantCriterion(String criterion)
boolean revokeCriterion(String criterion)
List getCompletedCriteria()
List getRemainingCriteria()
float getPercent()
String getProgressText()
boolean isCriterionObtained(String criterion)
IDate getCriterionObtainedDate(String criterion)
IDate getFirstProgressDate(String criterion)
void obtainCriterion(String criterion)
void resetCriterion(String criterion)
boolean setCompleted()
void resetAll()
Clone this wiki locally