Interface DamageSource

    • Method Detail

      • isAbsolute

        boolean isAbsolute()
        Gets whether this DamageSource's damage is absolute and will ignore potion effects and enchantments.
        Returns:
        If this damage source deals absolute damage
      • isBypassingArmor

        boolean isBypassingArmor()
        Gets whether this DamageSource will deal damage that bypasses any armor.
        Returns:
        True if this damage source bypasses armor
      • isScaledByDifficulty

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

        boolean isExplosive()
        Gets whether this DamageSource is an explosion.
        Returns:
        True if this damage source is an explosion
      • isMagic

        boolean isMagic()
        Gets whether this DamageSource is considered to be magical damage, such as potions, or other sources.
        Returns:
        If this damage is magic based
      • doesAffectCreative

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

        boolean isFire()
        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.
        Returns:
        If this damage is considered fire
      • exhaustion

        double exhaustion()
        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.

        Returns:
        The increase in exhaustion