Class AbstractEntityDamageSource

java.lang.Object
org.spongepowered.api.event.cause.entity.damage.source.common.AbstractEntityDamageSource
All Implemented Interfaces:
DamageSource, EntityDamageSource

public abstract class AbstractEntityDamageSource extends Object implements EntityDamageSource
  • Constructor Details

  • Method Details

    • source

      public Entity source()
      Description copied from interface: EntityDamageSource
      Gets the Entity that is the source.
      Specified by:
      source in interface EntityDamageSource
      Returns:
      The entity source
    • type

      public DamageType type()
      Description copied from interface: DamageSource
      Gets the DamageType of this source.
      Specified by:
      type in interface DamageSource
      Returns:
      The damage type
    • isAbsolute

      public boolean isAbsolute()
      Description copied from interface: DamageSource
      Gets whether this DamageSource's damage is absolute and will ignore potion effects and enchantments.
      Specified by:
      isAbsolute in interface DamageSource
      Returns:
      If this damage source deals absolute damage
    • isBypassingArmor

      public boolean isBypassingArmor()
      Description copied from interface: DamageSource
      Gets whether this DamageSource will deal damage that bypasses any armor.
      Specified by:
      isBypassingArmor in interface DamageSource
      Returns:
      True if this damage source bypasses armor
    • isScaledByDifficulty

      public boolean isScaledByDifficulty()
      Description copied from interface: DamageSource
      Gets whether this DamageSource's damage is scaled by Difficulty.
      Specified by:
      isScaledByDifficulty in interface DamageSource
      Returns:
      True if the damage from this source is scaled
    • isExplosive

      public boolean isExplosive()
      Description copied from interface: DamageSource
      Gets whether this DamageSource is an explosion.
      Specified by:
      isExplosive in interface DamageSource
      Returns:
      True if this damage source is an explosion
    • isMagic

      public boolean isMagic()
      Description copied from interface: DamageSource
      Gets whether this DamageSource is considered to be magical damage, such as potions, or other sources.
      Specified by:
      isMagic in interface DamageSource
      Returns:
      If this damage is magic based
    • doesAffectCreative

      public boolean doesAffectCreative()
      Description copied from interface: DamageSource
      Gets whether this DamageSource is considered to damage creative, or otherwise "normally unharmable" players. Usually associated with DamageTypes.VOID.
      Specified by:
      doesAffectCreative in interface DamageSource
      Returns:
      If this damage should affect creative players
    • isFire

      public boolean isFire()
      Description copied from interface: DamageSource
      Gets whether this DamageSource is considered to be "fire" based, can be from flames or blocks that are flaming, or the entity being on fire. Usually is possible to bypass or ignore this damage if the owning entity has PotionEffectTypes.FIRE_RESISTANCE active.
      Specified by:
      isFire in interface DamageSource
      Returns:
      If this damage is considered fire
    • exhaustion

      public double exhaustion()
      Description copied from interface: DamageSource
      Gets the amount of exhaustion this DamageSource will add to the entity, generally only to players.

      In vanilla gameplay this is set to 0.1 by default and overridden to 0 if the source is set to be absolute or as overriding armor.

      Specified by:
      exhaustion in interface DamageSource
      Returns:
      The increase in exhaustion