Item comparison

Nov 5, 2017
Item comparison
  • When the price of a shopitem is items, players need to sell those items from their inventory in order to receive the defined reward.

    Example:
    Code (Text):
      NinjaPotion:
        PriceType: item
        Price:
        - - type:EMERALD
          - amount:5
    [...]
    In this example the players need to pay 5 emeralds to receive one NinjaPotion.

    In order for items contained in the player inventory to be accepted they do not necessarily need to be identical to the price item: For example items with additional lore or a custom name are accepted aswell. Additionally you can define additional attributes (besides material) an item needs to have to be "accepted" (allowed to be sold).

    When is an item accepted?
    All items in the main inventory (armor excluded) are considered.


    Type/Id (Material)
    Obviously needs to be identical.


    Durability
    If the item is a tool/armor/weapon and the config option "AllowSellingDamagedItems" is true the durability (damage of the item) is ignored.
    Else it needs to be identical to the price item. For example in case of wool it needs to have the same color and in case of wood it needs to have the same subtype.


    Custom name
    If the price item has a custom name defined, the player item needs to have the same name, else the name of the player item is ignored.


    Custom lore
    If the price item has a custom lore defined, the player item needs to have a lore with the same upper lines (can contain additional lines below), else the player item lore is ignored. Example usage:
    Code (Text):
        Price:
        - - type:DIAMOND_SWORD
          - lore1:Rarity: Epic
    In this example only diamond swords with the lore "Rarity: Epic" are accepted, while additional lines in the player item lore do not matter.


    Rest
    In case of potion effects, enchantments and other ItemData shop item and player item need to have identical attributes in order for the player item to be accepted.


    Note that if you want to allow players selling Vanilla potions you use "potion":
    (ItemData) which allows creating Vanilla potions, instead of "potioneffect" which can be used for completely custom potion effects (custom strength/duration).
  • Loading...
  • Loading...