Package cz.jeme.advancium
Interface CustomAdvancementDisplay.Builder
- Enclosing interface:
CustomAdvancementDisplay
public static sealed interface CustomAdvancementDisplay.Builder
Builder interface for creating and configuring
CustomAdvancementDisplay instances.-
Method Summary
Modifier and TypeMethodDescriptionannounceToChat(boolean announceToChat) Sets whether the advancement should be announced in chat when achieved.build()Builds and returns theCustomAdvancementDisplayinstance.description(net.kyori.adventure.text.Component description) Sets the description of the advancement.Sets the frame type for the advancement.hidden(boolean hidden) Sets whether the advancement should remain hidden until achieved.icon(org.bukkit.inventory.ItemStack icon) Sets the icon for the advancement.default CustomAdvancementDisplay.BuilderSets the icon for the advancement after applying modifications via a consumer.default CustomAdvancementDisplay.Buildericon(org.bukkit.Material icon) Sets the icon for the advancement using a material type.showToast(boolean showToast) Sets whether a notification toast should be shown when the advancement is achieved.title(net.kyori.adventure.text.Component title) Sets the title of the advancement.
-
Method Details
-
icon
Sets the icon for the advancement.- Parameters:
icon- theItemStackto use as the icon- Returns:
- this builder instance for chaining
-
icon
Sets the icon for the advancement using a material type.This is a convenience method that creates an
ItemStackfrom the givenMaterialand adds it as a reward.- Parameters:
icon- theMaterialto use as the icon- Returns:
- this builder instance for chaining
-
icon
default CustomAdvancementDisplay.Builder icon(org.bukkit.inventory.ItemStack item, Consumer<org.bukkit.inventory.ItemStack> consumer) Sets the icon for the advancement after applying modifications via a consumer.This method allows modifications to be applied to the
ItemStackbefore it is set. The providedconsumercan modify the item, for example, by setting enchantments, or other metadata.- Parameters:
item- theItemStackto be used as the iconconsumer- a consumer to modify theItemStack- Returns:
- this builder instance for chaining
-
title
Sets the title of the advancement.- Parameters:
title- the title as aComponent- Returns:
- this builder instance for chaining
-
description
Sets the description of the advancement.- Parameters:
description- the description as aComponent- Returns:
- this builder instance for chaining
-
frame
Sets the frame type for the advancement.This controls the visual style and purpose of the advancement.
- Parameters:
frame- theCustomAdvancementDisplay.Frametype- Returns:
- this builder instance for chaining
-
showToast
Sets whether a notification toast should be shown when the advancement is achieved.- Parameters:
showToast-trueto show the toast, otherwisefalse- Returns:
- this builder instance for chaining
-
announceToChat
Sets whether the advancement should be announced in chat when achieved.- Parameters:
announceToChat-trueto announce in chat, otherwisefalse- Returns:
- this builder instance for chaining
-
build
CustomAdvancementDisplay build()Builds and returns theCustomAdvancementDisplayinstance.- Returns:
- the built custom advancement display
-