Interface Advancement
-
- All Superinterfaces:
ComponentLike
,DataPackSerializable
,DataSerializable
,Keyed
,ResourceKeyed
public interface Advancement extends ComponentLike, DataPackSerializable
An advancement.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
Advancement.Builder
A builder to createAdvancement
s.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static Advancement.Builder
builder()
Creates a newAdvancement.Builder
to createAdvancement
s.Collection<Advancement>
children()
Gets all the childrenAdvancement
s.AdvancementCriterion
criterion()
Gets all theAdvancementCriterion
that should be achieved before this advancement is unlocked.Optional<DisplayInfo>
displayInfo()
Gets theDisplayInfo
of this advancement, if present.Optional<Advancement>
parent()
Gets the parentAdvancement
, if present.List<Component>
toToastText()
Gets theComponent
lines that would be used to display a toast notification.Optional<AdvancementTree>
tree()
Gets theAdvancementTree
this advancement is located in, will only be present if the root advancement was used to create aAdvancementTree
.-
Methods inherited from interface net.kyori.adventure.text.ComponentLike
asComponent
-
Methods inherited from interface org.spongepowered.api.datapack.DataPackSerializable
type
-
Methods inherited from interface org.spongepowered.api.data.persistence.DataSerializable
contentVersion, toContainer
-
Methods inherited from interface org.spongepowered.api.ResourceKeyed
key
-
-
-
-
Method Detail
-
builder
static Advancement.Builder builder()
Creates a newAdvancement.Builder
to createAdvancement
s.- Returns:
- The new builder
-
tree
Optional<AdvancementTree> tree()
Gets theAdvancementTree
this advancement is located in, will only be present if the root advancement was used to create aAdvancementTree
.- Returns:
- The advancement tree
-
children
Collection<Advancement> children()
Gets all the childrenAdvancement
s.- Returns:
- The children advancements
-
criterion
AdvancementCriterion criterion()
Gets all theAdvancementCriterion
that should be achieved before this advancement is unlocked.AdvancementCriterion.empty()
will be returned if no criterion was assigned.This
AdvancementCriterion
can be a AND or OR operation that contains multiple possibleAdvancementCriterion
s.- Returns:
- The criterion
-
parent
Optional<Advancement> parent()
Gets the parentAdvancement
, if present.- Returns:
- The parent advancement, if present
-
displayInfo
Optional<DisplayInfo> displayInfo()
Gets theDisplayInfo
of this advancement, if present.- Returns:
- The display info, if present
-
-