Interface CosmeticItem


public interface CosmeticItem
Represents a unique cosmetic type listed in the shop.
See Also:
  • 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

      default String getName()
      Returns getConfigName(), but formats it into the default configured language.
      Returns:
      The name in the default language
      See Also:
    • getName

      String getName(@Nullable @Nullable CommandSender sender)
      Returns getConfigName(), but formats it and translates it to the given sender.
      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

      default String getDescription()
      Returns getConfigDescription(), but formats it into the default configured language.
      Returns:
      The description in the default language
      See Also:
    • getDescription

      String getDescription(@Nullable @Nullable CommandSender sender)
      Returns getConfigDescription(), but formats it and translates it to the given sender.
      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

      @Nullable @Nullable Currency getCurrency()
      Returns the currency that is used to buy this item.
      Returns:
      The currency. null if hasPrice() returns false
    • getPrice

      @Nullable @Nullable BigDecimal getPrice()
      Returns the price the player has to pay to obtain this item.
      Returns:
      The price. null if hasPrice() 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