EffectiveAdvancement

abstract class EffectiveAdvancement

Base class for a custom advancement.

A subclass defines its getDisplay (title, icon, frame, …), optional getParent to place it in a tree, and identity via getNamespacedData. Advancements register on construction and are (re)loaded in parent-before-child order; grant them with grant and check with isGrantedTo.

This is purely the client-side visual layer — the entry in the advancements screen, the toast on grant, its tree placement. It has no criteria and never fires itself; deciding when a player earns it is the child plugin's job (listen for the relevant event and call grant).

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class DisplayData(val title: String, val description: String, val icon: EffectiveAdvancement.IconData, val frame: EffectiveAdvancement.FrameType, val background: String? = null, val showToast: Boolean = true, val announceToChat: Boolean = true, val hidden: Boolean = false)

Visual/behavioral display of an advancement.

Link copied to clipboard

Advancement frame style shown in the UI.

Link copied to clipboard
data class IconData(val material: Material, val components: HashMap<String, String>)

The advancement icon: a Material plus optional item components (e.g. custom item model).

Functions

Link copied to clipboard

Display data (title, description, icon, frame, flags).

Link copied to clipboard
abstract fun getNamespacedData(): Pair<JavaPlugin, String>

Owning plugin and a plugin-unique id; together they form the advancement key.

Link copied to clipboard
Link copied to clipboard
abstract fun getParent(): NamespacedKey?

Parent advancement key to attach under, or null for a root advancement.

Link copied to clipboard
fun grant(player: Player)

Awards all remaining criteria to player, completing this advancement (no-op if already done).

Link copied to clipboard
fun isGrantedTo(player: Player): Boolean

Whether player has completed this advancement.