Interface CosmeticItem
public interface CosmeticItem
Represents a unique cosmetic type listed in the shop.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the behaviour when this item is being activated.Returns the category of this item.Returns the description of the item exactly the same as it has been configured.Returns the name of the item exactly the same as it has been configured.@Nullable Currency
Returns the currency that is used to buy this item.default String
ReturnsgetConfigDescription()
, but formats it into the default configured language.getDescription
(@Nullable CommandSender sender) ReturnsgetConfigDescription()
, but formats it and translates it to the givensender
.getIcon()
Returns the icon item that will be displayed in the shop.getId()
Returns the unique id of this cosmetic item.default String
getName()
ReturnsgetConfigName()
, but formats it into the default configured language.getName
(@Nullable CommandSender sender) ReturnsgetConfigName()
, but formats it and translates it to the givensender
.@Nullable BigDecimal
getPrice()
Returns the price the player has to pay to obtain this item.Returns the rarity (quality, worthness) of this item.getShop()
Returns the shop this item is listed in.boolean
hasPrice()
Returns whether this item has a price.boolean
Returns whether this item is locked by a permission.
-
Method Details
-
getId
String getId()Returns the unique id of this cosmetic item.It is promised that this id does not change over runtime, as it might be used to store data in databases.
- Returns:
- The unique id
-
getShop
Shop getShop()Returns the shop this item is listed in.- Returns:
- The shop
-
getConfigName
String getConfigName()Returns the name of the item exactly the same as it has been configured.- Returns:
- The raw name
- See Also:
-
getName
ReturnsgetConfigName()
, but formats it into the default configured language.- Returns:
- The name in the default language
- See Also:
-
getName
ReturnsgetConfigName()
, but formats it and translates it to the givensender
.- Parameters:
sender
- The person from which it should look up the language.null
if it should take the default language- Returns:
- The name in the language of the sender
- See Also:
-
getConfigDescription
String getConfigDescription()Returns the description of the item exactly the same as it has been configured.- Returns:
- The raw description
- See Also:
-
getDescription
ReturnsgetConfigDescription()
, but formats it into the default configured language.- Returns:
- The description in the default language
- See Also:
-
getDescription
ReturnsgetConfigDescription()
, but formats it and translates it to the givensender
.- Parameters:
sender
- The person from which it should look up the language.null
if it should take the default language- Returns:
- The description in the language of the sender
- See Also:
-
getIcon
ItemStack getIcon()Returns the icon item that will be displayed in the shop.- Returns:
- The icon item
-
hasPrice
boolean hasPrice()Returns whether this item has a price.If it does not have a price, then there might be either a permission needed to obtain it (see
isLockedByPermission()
) or it is generally available for free to everyone.- Returns:
true
if this item has a price,false
otherwise
-
getCurrency
Returns the currency that is used to buy this item.- Returns:
- The currency.
null
ifhasPrice()
returns false
-
getPrice
Returns the price the player has to pay to obtain this item.- Returns:
- The price.
null
ifhasPrice()
returns false
-
getRarity
Rarity getRarity()Returns the rarity (quality, worthness) of this item.- Returns:
- The rarity
-
getCategory
CosmeticItemCategory getCategory()Returns the category of this item.- Returns:
- The category
-
getBehaviour
CosmeticItemBehaviour getBehaviour()Returns the behaviour when this item is being activated.Items may also have a passive behaviour, where they don't directly refer to an action but rather to a state. Such as, not having any animation active at all for the given category or wanting to play a random animation the player owns.
- Returns:
- The behaviour when this item is being activated by the player
-
isLockedByPermission
boolean isLockedByPermission()Returns whether this item is locked by a permission.Only players with the permission can obtain this item.
- Returns:
true
if this item is locked by a permission,false
otherwise
-