Class EntityProjectileDamage

java.lang.Object
net.minestom.server.entity.damage.Damage
net.minestom.server.entity.damage.EntityProjectileDamage
All Implemented Interfaces:
Taggable, TagReadable, TagWritable

public class EntityProjectileDamage extends Damage
Represents damage inflicted by an entity, via a projectile.
  • Constructor Details

    • EntityProjectileDamage

      public EntityProjectileDamage(@Nullable @Nullable Entity shooter, @NotNull @NotNull Entity projectile, float amount)
  • Method Details

    • getProjectile

      @NotNull public @NotNull Entity getProjectile()
      Gets the projectile responsible for the damage.
      Returns:
      the projectile
    • getShooter

      @Nullable public @Nullable Entity getShooter()
      Gets the shooter of the projectile.
      Returns:
      the shooter of the projectile, null if not any
    • getSource

      @NotNull public @NotNull Entity getSource()
      Description copied from class: Damage
      Gets the direct source of the damage. This is the entity that directly causes the damage, like a projectile, or null if there was none.
      Overrides:
      getSource in class Damage
      Returns:
      the source