# 接口的使用
org.bukkit.damage.DamageSource

使用DamageSource的程序包
程序包
说明
org.bukkit.damage
Classes concerning damage types and sources applicable to living entities.
org.bukkit.entity
为在`世界`内存在的非三维像素单位(实体)提供的接口，包含玩家、怪物、抛射物等.
org.bukkit.event.entity
与`实体`相关的`事件`，不包括 一些直接引用的更具体的实体类型.

- ## org.bukkit.damage中DamageSource的使用

  返回DamageSource的org.bukkit.damage中的方法
  修饰符和类型
  方法
  说明
  `@NotNull DamageSource`
  DamageSource.Builder.`build()`
  Create a new `DamageSource` instance using the supplied parameters.

- ## org.bukkit.entity中DamageSource的使用

  参数类型为DamageSource的org.bukkit.entity中的方法
  修饰符和类型
  方法
  说明
  `void`
  Damageable.`damage(double amount, @NotNull DamageSource damageSource)`
  Deals the given amount of damage to this entity from a specified `DamageSource`.

- ## org.bukkit.event.entity中DamageSource的使用

  返回DamageSource的org.bukkit.event.entity中的方法
  修饰符和类型
  方法
  说明
  `@NotNull DamageSource`
  EntityDamageEvent.`getDamageSource()`
  Get the source of damage.
  `@NotNull DamageSource`
  EntityDeathEvent.`getDamageSource()`
  获取造成此实体死亡的伤害来源.
  参数类型为DamageSource的org.bukkit.event.entity中的构造器
  限定符
  构造器
  说明
  ``
  `EntityDamageByBlockEvent(@Nullable Block damager, @Nullable BlockState damagerState, @NotNull Entity damagee, @NotNull EntityDamageEvent.DamageCause cause, @NotNull DamageSource damageSource, double damage)`
  ``
  `EntityDamageByBlockEvent(@Nullable Block damager, @Nullable BlockState damagerState, @NotNull Entity damagee, @NotNull EntityDamageEvent.DamageCause cause, @NotNull DamageSource damageSource, @NotNull Map<EntityDamageEvent.DamageModifier,Double> modifiers, @NotNull Map<EntityDamageEvent.DamageModifier,? extends Function<? super Double,Double>> modifierFunctions)`
  ``
  `EntityDamageByEntityEvent(@NotNull Entity damager, @NotNull Entity damagee, @NotNull EntityDamageEvent.DamageCause cause, @NotNull DamageSource damageSource, double damage)`
  ``
  `EntityDamageByEntityEvent(@NotNull Entity damager, @NotNull Entity damagee, @NotNull EntityDamageEvent.DamageCause cause, @NotNull DamageSource damageSource, @NotNull Map<EntityDamageEvent.DamageModifier,Double> modifiers, @NotNull Map<EntityDamageEvent.DamageModifier,? extends Function<? super Double,Double>> modifierFunctions)`
  ``
  `EntityDamageEvent(@NotNull Entity damagee, @NotNull EntityDamageEvent.DamageCause cause, @NotNull DamageSource damageSource, double damage)`
  ``
  `EntityDamageEvent(@NotNull Entity damagee, @NotNull EntityDamageEvent.DamageCause cause, @NotNull DamageSource damageSource, @NotNull Map<EntityDamageEvent.DamageModifier,Double> modifiers, @NotNull Map<EntityDamageEvent.DamageModifier,? extends Function<? super Double,Double>> modifierFunctions)`
  ``
  `EntityDeathEvent(@NotNull LivingEntity entity, @NotNull DamageSource damageSource, @NotNull List<ItemStack> drops)`
  ``
  `EntityDeathEvent(@NotNull LivingEntity what, @NotNull DamageSource damageSource, @NotNull List<ItemStack> drops, int droppedExp)`
  ``
  `PlayerDeathEvent(@NotNull Player player, @NotNull DamageSource damageSource, @NotNull List<ItemStack> drops, int droppedExp, int newExp, int newTotalExp, int newLevel, @Nullable String deathMessage)`
  ``
  `PlayerDeathEvent(@NotNull Player player, @NotNull DamageSource damageSource, @NotNull List<ItemStack> drops, int droppedExp, int newExp, @Nullable String deathMessage)`
  ``
  `PlayerDeathEvent(@NotNull Player player, @NotNull DamageSource damageSource, @NotNull List<ItemStack> drops, int droppedExp, @Nullable String deathMessage)`