Interface CombatEntry


@NullMarked @Experimental @NonExtendable public interface CombatEntry
Represents a combat entry
  • Method Details

    • getDamageSource

      DamageSource getDamageSource()
      Gets the damage source.
      Returns:
      the damage source
    • getDamage

      float getDamage()
      Gets the amount of damage caused.
      Returns:
      the amount of damage caused
    • getFallLocationType

      @Nullable FallLocationType getFallLocationType()
      Gets the fall location type at the time of this damage.
      Returns:
      the fall location type
    • getFallDistance

      float getFallDistance()
      Gets the fall distance at the time of this damage.
      Returns:
      the fall distance
    • combatEntry

      static CombatEntry combatEntry(LivingEntity entity, DamageSource damageSource, float damage)
      Creates a new combat entry.

      The fall location and fall distance will be calculated from the entity's current state.

      Parameters:
      entity - entity
      damageSource - damage source
      damage - damage amount
      Returns:
      combat entry
      See Also:
    • combatEntry

      static CombatEntry combatEntry(DamageSource damageSource, float damage, @Nullable FallLocationType fallLocationType, float fallDistance)
      Creates a new combat entry
      Parameters:
      damageSource - damage source
      damage - damage amount
      fallLocationType - fall location type
      fallDistance - fall distance
      Returns:
      a new combat entry
      See Also: