Class CosmeticDefinition
java.lang.Object
dev.itsharshxd.zentrix.api.cosmetics.CosmeticDefinition
One cosmetic of an addon's type, as its
handler lists it.
Immutable; build one with builder(String).
Who may use it:
- a player who owns it, granted or bought;
- a player who holds its permission, when it has one;
- everyone, when it is unlocked by default.
CosmeticDefinition crown = CosmeticDefinition.builder("crown")
.name("&6Golden Crown")
.icon(new ItemStack(Material.GOLDEN_HELMET))
.lore(List.of("&7Fit for a champion."))
.rarity("&6Legendary")
.price(2500)
.build();
- Since:
- 1.11.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull CosmeticDefinition.BuilderStarts a cosmetic.@NotNull org.bukkit.inventory.ItemStackgetIcon()A copy of the icon menus show it with.@NotNull StringgetId()The stable ID ownership is stored under.getLore()The description lines, in Zentrix's colour format.@NotNull StringgetName()The display name, in Zentrix's colour format.The permission that unlocks it without owning it.@NotNull OptionalDoublegetPrice()What it costs in Zentrix's currency; empty when it is not for sale.The rarity label, in Zentrix's colour format, such as&6Legendary.booleanWhether every player may use it without owning it.
-
Method Details
-
builder
Starts a cosmetic.- Parameters:
id- the stable ID ownership is stored under:a-z,0-9,_and-
-
getId
The stable ID ownership is stored under. -
getName
The display name, in Zentrix's colour format. -
getIcon
@NotNull public @NotNull org.bukkit.inventory.ItemStack getIcon()A copy of the icon menus show it with. -
getLore
The description lines, in Zentrix's colour format. -
getRarity
The rarity label, in Zentrix's colour format, such as&6Legendary. -
getPermission
The permission that unlocks it without owning it. -
getPrice
What it costs in Zentrix's currency; empty when it is not for sale. -
isUnlockedByDefault
public boolean isUnlockedByDefault()Whether every player may use it without owning it.
-