程序包 org.bukkit.damage

# 接口 DamageSource.Builder

封闭接口:
  DamageSource

public static interface DamageSource.Builder
Utility class to make building a `DamageSource` easier. Only a `DamageType` is required.

- ## 方法概要

  修饰符和类型
  方法
  说明
  `@NotNull DamageSource`
  `build()`
  Create a new `DamageSource` instance using the supplied parameters.
  `@NotNull DamageSource.Builder`
  `withCausingEntity(@NotNull Entity entity)`
  Set the `Entity` that caused the damage.
  `@NotNull DamageSource.Builder`
  `withDamageLocation(@NotNull Location location)`
  Set the `Location` of the source of damage.
  `@NotNull DamageSource.Builder`
  `withDirectEntity(@NotNull Entity entity)`
  Set the `Entity` that directly inflicted the damage.

- ## 方法详细资料

  - ### withCausingEntity

    @NotNull @NotNull DamageSource.Builder withCausingEntity(@NotNull @NotNull Entity entity)
    Set the `Entity` that caused the damage.
    参数:
      `entity` - the entity
    返回:
      this instance. Allows for chained method calls
    另请参阅:
      - `DamageSource.getCausingEntity()`

  - ### withDirectEntity

    @NotNull @NotNull DamageSource.Builder withDirectEntity(@NotNull @NotNull Entity entity)
    Set the `Entity` that directly inflicted the damage.
    参数:
      `entity` - the entity
    返回:
      this instance. Allows for chained method calls
    另请参阅:
      - `DamageSource.getDirectEntity()`

  - ### withDamageLocation

    @NotNull @NotNull DamageSource.Builder withDamageLocation(@NotNull @NotNull Location location)
    Set the `Location` of the source of damage.
    参数:
      `location` - the location where the damage occurred
    返回:
      this instance. Allows for chained method calls
    另请参阅:
      - `DamageSource.getSourceLocation()`

  - ### build

    @NotNull @NotNull DamageSource build()
    Create a new `DamageSource` instance using the supplied parameters.
    返回:
      the damage source instance