Skip to content

Advancement

AdvancementsData

Python
AdvancementsData(
    reset_clear: bool,
    advancements: Dict[str, Advancement],
    removed_advancements: List[str],
    progress: Dict[str, AdvancementProgress],
)

Represents the full advancement data for a player/session.

ATTRIBUTE DESCRIPTION
reset_clear

Indicates whether all advancement data should be reset.

TYPE: bool

advancements

All defined advancements.

TYPE: Dict[str, Advancement]

removed_advancements

Advancement IDs that have been removed.

TYPE: List[str]

progress

The player's progress on each advancement.

TYPE: Dict[str, AdvancementProgress]

get_advancement

Python
get_advancement(
    advancement_id: str,
) -> Optional[Advancement]

Retrieve an advancement definition.

PARAMETER DESCRIPTION
advancement_id

The ID of the advancement.

TYPE: str

RETURNS DESCRIPTION
Optional[Advancement]

The advancement, or None if not found.

get_progress

Python
get_progress(
    advancement_id: str,
) -> Optional[AdvancementProgress]

Retrieve the progress for a specific advancement.

PARAMETER DESCRIPTION
advancement_id

The ID of the advancement.

TYPE: str

RETURNS DESCRIPTION
Optional[AdvancementProgress]

The progress data, or None if not found.

get_completed_advancements

Python
get_completed_advancements() -> List[str]

Get a list of advancement IDs that are completed.

RETURNS DESCRIPTION
List[str]

List of completed advancement IDs.

get_advancement_count

Python
get_advancement_count() -> int

Get the number of defined advancements.

RETURNS DESCRIPTION
int

The count of advancements.

is_reset_clear

Python
is_reset_clear() -> bool

Check if advancement data is marked for reset.

RETURNS DESCRIPTION
bool

True if reset_clear is set, False otherwise.


Advancement

Python
Advancement(
    parent_id: Optional[str],
    display_data: Optional[AdvancementDisplay],
    criteria: Dict[str, None],
    requirements: List[List[str]],
)

Represents a single advancement definition.

ATTRIBUTE DESCRIPTION
parent_id

The identifier of the parent advancement.

TYPE: Optional[str]

display_data

Display information for the advancement.

TYPE: Optional[AdvancementDisplay]

criteria

The criteria required for this advancement.

TYPE: Dict[str, None]

requirements

Requirement groups, where each sublist is an OR-group.

TYPE: List[List[str]]

has_parent

Python
has_parent() -> bool

Check if the advancement has a parent.

RETURNS DESCRIPTION
bool

True if a parent exists, False otherwise.

has_display

Python
has_display() -> bool

Check if the advancement has display data.

RETURNS DESCRIPTION
bool

True if display data is present, False otherwise.

get_criteria_ids

Python
get_criteria_ids() -> List[str]

Get all criterion IDs.

RETURNS DESCRIPTION
List[str]

List of criterion identifiers.

get_all_requirements

Python
get_all_requirements() -> List[str]

Get a flattened list of all requirement IDs.

RETURNS DESCRIPTION
List[str]

List of all requirement IDs.


AdvancementDisplay

Python
AdvancementDisplay(
    title: Any,
    description: Any,
    icon: Any,
    frame_type: int,
    flags: int,
    background_texture: Optional[str],
    position: Vector2D[int],
)

Holds display-related data for an advancement.

ATTRIBUTE DESCRIPTION
title

The title of the advancement.

TYPE: Any

description

The description text.

TYPE: Any

icon

The icon representation.

TYPE: Any

frame_type

Type of the frame (e.g., task, challenge).

TYPE: int

flags

Flags controlling display features.

TYPE: int

background_texture

Optional background texture resource.

TYPE: Optional[str]

position

position in the advancement tree.

TYPE: float

has_background_texture

Python
has_background_texture() -> bool

Check if a background texture is present.

RETURNS DESCRIPTION
bool

True if a background texture is set, False otherwise.


AdvancementProgress

Python
AdvancementProgress(criteria: Dict[str, CriterionProgress])

Represents the progress across multiple advancement criteria.

ATTRIBUTE DESCRIPTION
criteria

Mapping of criterion IDs to their progress state.

TYPE: Dict[str, CriterionProgress]

get_criterion

Python
get_criterion(
    criterion_id: str,
) -> Optional[CriterionProgress]

Retrieve progress for a specific criterion.

PARAMETER DESCRIPTION
criterion_id

The identifier of the criterion.

TYPE: str

RETURNS DESCRIPTION
Optional[CriterionProgress]

The progress state for the criterion, or None if not found.

is_completed

Python
is_completed() -> bool

Check if all criteria are completed.

RETURNS DESCRIPTION
bool

True if all criteria are achieved, False otherwise.

get_completion_percentage

Python
get_completion_percentage() -> float

Calculate the percentage of completed criteria.

RETURNS DESCRIPTION
float

The completion percentage (0.0 to 100.0).


CriterionProgress

Python
CriterionProgress(
    achieved: bool, date_of_achieving: Optional[int] = None
)

Represents the progress of a single advancement criterion.

ATTRIBUTE DESCRIPTION
achieved

Whether the criterion has been achieved.

TYPE: bool

date_of_achieving

The timestamp of when the criterion was achieved.

TYPE: Optional[int]

is_completed

Python
is_completed() -> bool

Check if the criterion is completed.

RETURNS DESCRIPTION
bool

True if achieved, False otherwise.

get_completion_date

Python
get_completion_date() -> Optional[int]

Get the completion date if the criterion is achieved.

RETURNS DESCRIPTION
Optional[int]

The completion timestamp, or None if not achieved.