Class DamageRequest.Builder

java.lang.Object
studio.magemonkey.codex.api.damage.DamageRequest.Builder
Enclosing class:
DamageRequest

public static final class DamageRequest.Builder extends Object
  • Method Details

    • amount

      @NotNull public DamageRequest.Builder amount(@NonNull @NonNull String type, double amount)
      Adds damage of one type. Adding the same type again adds to its amount.
      Parameters:
      type - the damage type id, kept exactly as given
      amount - the amount, which must be a number and not negative
    • weaponScale

      @NotNull public DamageRequest.Builder weaponScale(double factor)
      Multiplies every damage type of the attacker's weapon. Defaults to 1.
      Parameters:
      factor - the factor, which must be a number and not negative
    • weaponScale

      @NotNull public DamageRequest.Builder weaponScale(@NonNull @NonNull String type, double factor)
      Multiplies one damage type of the attacker's weapon, in place of the factor for every type.
      Parameters:
      type - the damage type id of the plugin that calculates the damage, without a namespace
      factor - the factor, which must be a number and not negative
    • weaponBonus

      @NotNull public DamageRequest.Builder weaponBonus(double amount)
      Adds to every damage type the attacker's weapon deals. Defaults to 0.
      Parameters:
      amount - the amount, which may be negative
    • weaponBonus

      @NotNull public DamageRequest.Builder weaponBonus(@NonNull @NonNull String type, double amount)
      Adds to one damage type of the attacker's weapon, in place of the amount for every type.
      Parameters:
      type - the damage type id of the plugin that calculates the damage, without a namespace
      amount - the amount, which may be negative
    • build

      @NotNull public DamageRequest build()
    • origin

      public DamageRequest.Builder origin(@NonNull @NonNull DamageOrigin origin)
      Returns:
      this.
    • source

      public DamageRequest.Builder source(@Nullable org.bukkit.entity.LivingEntity source)
      Returns:
      this.
    • cause

      public DamageRequest.Builder cause(@Nullable org.bukkit.event.entity.EntityDamageEvent.DamageCause cause)
      Returns:
      this.
    • weaponStats

      public DamageRequest.Builder weaponStats(@NonNull @NonNull WeaponStatsMode weaponStats)
      Defaults to WeaponStatsMode.ADD.
      Returns:
      this.
    • knockback

      public DamageRequest.Builder knockback(boolean knockback)
      Defaults to true.
      Returns:
      this.