程序包 org.bukkit.loot

# 类 LootContext

java.lang.Object
org.bukkit.loot.LootContext

public final class LootContext extends Object
Represents additional information a `LootTable` can use to modify it's generated loot.

- ## 嵌套类概要

  嵌套类
  修饰符和类型
  类
  说明
  `static class`
  `LootContext.Builder`
  Utility class to make building `LootContext` easier.

- ## 字段概要

  字段
  修饰符和类型
  字段
  说明
  `static final int`
  `DEFAULT_LOOT_MODIFIER`

- ## 方法概要

  修饰符和类型
  方法
  说明
  `@Nullable HumanEntity`
  `getKiller()`
  Get the `HumanEntity` who killed the `getLootedEntity()`.
  `@NotNull Location`
  `getLocation()`
  The `Location` to store where the loot will be generated.
  `@Nullable Entity`
  `getLootedEntity()`
  Get the `Entity` that was killed.
  `int`
  `getLootingModifier()`
  已过时。
  no longer functional
  `float`
  `getLuck()`
  Represents the `PotionEffectType.LUCK` that an entity can have.

  ### 从类继承的方法 java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 字段详细资料

  - ### DEFAULT_LOOT_MODIFIER

    public static final int DEFAULT_LOOT_MODIFIER
    另请参阅:
      - 常量字段值

- ## 方法详细资料

  - ### getLocation

    @NotNull public @NotNull Location getLocation()
    The `Location` to store where the loot will be generated.
    返回:
      the Location of where the loot will be generated

  - ### getLuck

    public float getLuck()
    Represents the `PotionEffectType.LUCK` that an entity can have. The higher the value the better chance of receiving more loot.
    返回:
      luck

  - ### getLootingModifier

    @Deprecated public int getLootingModifier()
    已过时。
    no longer functional
    Represents the `Enchantment.LOOTING` the `getKiller()` entity has on their equipped item. This value is only set via `LootContext.Builder.lootingModifier(int)`. If not set, the `getKiller()` entity's looting level will be used instead.
    返回:
      the looting level

  - ### getLootedEntity

    @Nullable public @Nullable Entity getLootedEntity()
    Get the `Entity` that was killed. Can be null.
    返回:
      the looted entity or null

  - ### getKiller

    @Nullable public @Nullable HumanEntity getKiller()
    Get the `HumanEntity` who killed the `getLootedEntity()`. Can be null.
    返回:
      the killer entity, or null.