Class DamageAttribute

All Implemented Interfaces:
DynamicStat<StatBonus>

public class DamageAttribute extends DuplicableItemLoreStat<StatBonus> implements DynamicStat<StatBonus>
  • Constructor Details

    • DamageAttribute

      public DamageAttribute(@NotNull String id, @NotNull String name, @NotNull String format, int priority, @NotNull studio.magemonkey.codex.util.actions.ActionManipulator actionEngine, @NotNull Set<String> attachedDamageCauses, @NotNull Map<String,Double> biome, @NotNull Map<String,Double> entityTypeModifier, @NotNull Map<String,Double> mythicFactionModifier)
  • Method Details

    • getParameterClass

      @NotNull public Class<StatBonus> getParameterClass()
      Specified by:
      getParameterClass in class ItemLoreStat<StatBonus>
    • isDefault

      public boolean isDefault()
    • isAttached

      public boolean isAttached(@NotNull org.bukkit.event.entity.EntityDamageEvent.DamageCause cause)
    • isAttachedToDamageType

      public boolean isAttachedToDamageType(@NotNull String damageType)
      Whether damage of this vanilla damage type is damage of this attribute. Vanilla damage types only exist on Minecraft 1.20.4 and newer, and are finer than damage causes.
      Parameters:
      damageType - the key of the vanilla damage type, such as minecraft:freeze
    • setAttachedDamageTypes

      public void setAttachedDamageTypes(@NotNull Collection<String> damageTypes)
      Parameters:
      damageTypes - keys of vanilla damage types, with or without the minecraft: namespace
    • getAttachedDamageTypes

      @NotNull public Set<String> getAttachedDamageTypes()
    • isAttached

      public boolean isAttached(@NotNull DefenseAttribute def)
    • setAttachedDefense

      public void setAttachedDefense(@Nullable DefenseAttribute defense)
    • getAttachedDefense

      @Nullable public DefenseAttribute getAttachedDefense()
    • getVanillaDamage

      public static double getVanillaDamage(@NotNull org.bukkit.inventory.ItemStack item)
    • getTotal

      public double[] getTotal(@NotNull org.bukkit.inventory.ItemStack item, @Nullable org.bukkit.entity.Player player)
    • get

      @NotNull public List<BiFunction<Boolean,double[],double[]>> get(@NotNull org.bukkit.inventory.ItemStack item, @Nullable org.bukkit.entity.Player player)
    • getHitActions

      @NotNull public studio.magemonkey.codex.util.actions.ActionManipulator getHitActions()
    • getBiomeDamageModifiers

      @NotNull public Map<String,Double> getBiomeDamageModifiers()
    • getDamageModifierByBiome

      public double getDamageModifierByBiome(@NotNull org.bukkit.block.Biome b)
    • getDamageModifierByEntityType

      public double getDamageModifierByEntityType(@NotNull org.bukkit.entity.Entity e)
    • getDamageModifierByMythicFaction

      public double getDamageModifierByMythicFaction(@Nullable String faction)
    • formatValue

      @NotNull public String formatValue(@NotNull org.bukkit.inventory.ItemStack item, @NotNull StatBonus value)
      Specified by:
      formatValue in class ItemLoreStat<StatBonus>
    • getFormat

      @NotNull public String getFormat(@Nullable org.bukkit.entity.Player p, @NotNull org.bukkit.inventory.ItemStack item, @NotNull StatBonus value)
      Specified by:
      getFormat in interface DynamicStat<StatBonus>
    • updateItem

      @NotNull public org.bukkit.inventory.ItemStack updateItem(@Nullable org.bukkit.entity.Player p, @NotNull org.bukkit.inventory.ItemStack item)
      Specified by:
      updateItem in interface DynamicStat<StatBonus>