Interface IScalingFunction

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface IScalingFunction
An IScalingFunction is used by custom DamageScaling instances.
This allows finer control over the actual scaling value, instead of the hard-coded vanilla defaults.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final IScalingFunction
    Default Scaling function used by the vanilla DamageScaling values.
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    scaleDamage(DamageSource source, Player target, float amount, Difficulty difficulty)
    Scales the incoming damage amount based on the current difficulty.
    Only damage dealt to players is scaled, other damage is not impacted.
  • Field Details

  • Method Details

    • scaleDamage

      float scaleDamage(DamageSource source, Player target, float amount, Difficulty difficulty)
      Scales the incoming damage amount based on the current difficulty.
      Only damage dealt to players is scaled, other damage is not impacted.
      Parameters:
      source - The source of the incoming damage.
      target - The player which is being attacked.
      amount - The amount of damage being dealt.
      difficulty - The current game difficulty.
      Returns:
      The scaled damage value.