QtCraft API C++ classes QML types Handbook

QcAdvancementDefinition Struct

An advancement of the adventure guide (advancements/<name>.json, decision E-923): its place in the tree (parent, empty for a root), how it shows (icon item, title and description keys, frame, hidden until reached, announced in the chat), the handbook entry it leads to ("chapter:<name>", "item:<name>", "block:<name>", "mob:<name>", "biome:<name>"), its criteria and which of them it needs: requirements holds groups, every group must have one met criterion. More...

Header: #include <common/content/registry/QcAdvancementDefinition.h>

Public Functions

const QcAdvancementCriterion *criterion(const QString &criterionName) const
bool isDone(const QSet<QString> &done) const

Public Variables

bool announce
QList<QcAdvancementCriterion> criteria
QString descriptionKey
bool disabled
QcAdvancementFrame frame
QString handbook
bool hidden
QString icon
QString name
QString parent
QList<QStringList> requirements
QString titleKey

Static Public Members

const int maxCriteria
const int maxNameLength

Detailed Description

A mod replaces an advancement by name or switches it off with "disabled": true. The content sync sends everything but the triggers and conditions of the criteria (the client never matches events).

Member Function Documentation

const QcAdvancementCriterion *QcAdvancementDefinition::criterion(const QString &criterionName) const

Returns the criterion named criterionName, or null if it has none.

bool QcAdvancementDefinition::isDone(const QSet<QString> &done) const

Returns whether the met criteria done fulfil every requirement group.

Member Variable Documentation

bool QcAdvancementDefinition::announce

Whether the other players read in the chat that someone reached it (decision E-924; the server's game rule announceAdvancements must allow it too). Only the server uses it.

QList<QcAdvancementCriterion> QcAdvancementDefinition::criteria

Its criteria in the order of the JSON object.

QString QcAdvancementDefinition::descriptionKey

The translation key of the description (JSON "description", by default the title key with .description appended).

bool QcAdvancementDefinition::disabled

Whether a pack switches it off (JSON "disabled"); QcAdvancementCatalog::resolve() removes it.

QcAdvancementFrame QcAdvancementDefinition::frame

How it is framed (JSON "frame").

QString QcAdvancementDefinition::handbook

The handbook entry it leads to, <kind>:<qualified name>; empty for none.

bool QcAdvancementDefinition::hidden

Whether it stays hidden until reached (JSON "hidden").

QString QcAdvancementDefinition::icon

The qualified name of the item shown as its icon.

const int QcAdvancementDefinition::maxCriteria

The most criteria, and requirement groups, an advancement may have.

const int QcAdvancementDefinition::maxNameLength

The longest qualified name of an advancement, its parent and its icon.

QString QcAdvancementDefinition::name

The qualified name (JSON "name").

QString QcAdvancementDefinition::parent

The qualified name of the parent advancement; empty for a root.

QList<QStringList> QcAdvancementDefinition::requirements

Groups of criterion names, each met by one of its criteria (JSON "requirements": "all", the default, gives one group per criterion, "any" a single group).

QString QcAdvancementDefinition::titleKey

The translation key of the title (JSON "title", by default QcContentFields::translationKey() with the prefix advancement).