Class DamageRequest.Builder
java.lang.Object
studio.magemonkey.codex.api.damage.DamageRequest.Builder
- Enclosing class:
DamageRequest
-
Method Summary
Modifier and TypeMethodDescriptionAdds damage of one type.build()cause(org.bukkit.event.entity.EntityDamageEvent.DamageCause cause) knockback(boolean knockback) Defaults to true.origin(@NonNull DamageOrigin origin) Defaults toDamageOrigin.EXTERNAL.source(org.bukkit.entity.LivingEntity source) weaponBonus(double amount) Adds to every damage type the attacker's weapon deals.weaponBonus(@NonNull String type, double amount) Adds to one damage type of the attacker's weapon, in place of the amount for every type.weaponScale(double factor) Multiplies every damage type of the attacker's weapon.weaponScale(@NonNull String type, double factor) Multiplies one damage type of the attacker's weapon, in place of the factor for every type.weaponStats(@NonNull WeaponStatsMode weaponStats) Defaults toWeaponStatsMode.ADD.
-
Method Details
-
amount
Adds damage of one type. Adding the same type again adds to its amount.- Parameters:
type- the damage type id, kept exactly as givenamount- the amount, which must be a number and not negative
-
weaponScale
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
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 namespacefactor- the factor, which must be a number and not negative
-
weaponBonus
Adds to every damage type the attacker's weapon deals. Defaults to 0.- Parameters:
amount- the amount, which may be negative
-
weaponBonus
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 namespaceamount- the amount, which may be negative
-
build
-
origin
Defaults toDamageOrigin.EXTERNAL.- Returns:
this.
-
source
- Returns:
this.
-
cause
public DamageRequest.Builder cause(@Nullable org.bukkit.event.entity.EntityDamageEvent.DamageCause cause) - Returns:
this.
-
weaponStats
Defaults toWeaponStatsMode.ADD.- Returns:
this.
-
knockback
-