All Implemented Interfaces:
DamageableItem, ItemAttribute, Placeable, ProtectiveArmor

public class ElytraCap extends SlimefunArmorPiece implements DamageableItem, ProtectiveArmor
The ElytraCap negates damage taken when crashing into a wall using an elytra.
Author:
Seggan
See Also:
  • Constructor Details

  • Method Details

    • isDamageable

      public boolean isDamageable()
      Description copied from interface: DamageableItem
      Implement this method to make the behaviour of this interface dependent on the state of your object. You could add a Config option to toggle the behaviour for example.
      Specified by:
      isDamageable in interface DamageableItem
      Returns:
      Whether this SlimefunItem is damageable
    • damageItem

      public void damageItem(@Nonnull org.bukkit.entity.Player p, @Nullable org.bukkit.inventory.ItemStack item)
      Description copied from interface: DamageableItem
      This method will damage the given ItemStack once. It also takes into account the Enchantment Unbreaking. It will only apply the damage if DamageableItem.isDamageable() returned true.
      Specified by:
      damageItem in interface DamageableItem
      Parameters:
      p - The Player to which the item belongs
      item - The ItemStack to damage
    • evaluateUnbreakingEnchantment

      public boolean evaluateUnbreakingEnchantment(int unbreakingLevel)
      Description copied from interface: DamageableItem
      This method will randomly decide if the item should be damaged or not This does not damage the item, it is called by DamageableItem.damageItem(Player, ItemStack) to randomly generate a boolean This function should be overridden when the item type is not a tool which is the default value
      Specified by:
      evaluateUnbreakingEnchantment in interface DamageableItem
      Parameters:
      unbreakingLevel - The Integer level of the unbreaking Enchantment
      Returns:
      Whether to save the item from taking damage
    • getProtectionTypes

      @Nonnull public ProtectionType[] getProtectionTypes()
      Description copied from interface: ProtectiveArmor
      This returns which ProtectionType damages this ItemAttribute will protect the Player from.
      Specified by:
      getProtectionTypes in interface ProtectiveArmor
      Returns:
      The ProtectionTypes.
    • isFullSetRequired

      public boolean isFullSetRequired()
      Description copied from interface: ProtectiveArmor
      This returns whether the full set is required for Player's protection on assigned ProtectionType damages.
      Specified by:
      isFullSetRequired in interface ProtectiveArmor
      Returns:
      Whether or not he full set is required.
    • getArmorSetId

      @Nonnull public org.bukkit.NamespacedKey getArmorSetId()
      Description copied from interface: ProtectiveArmor
      This returns the armor set NamespacedKey of this SlimefunArmorPiece.
      Specified by:
      getArmorSetId in interface ProtectiveArmor
      Returns:
      The set NamespacedKey, null if none is found.