Class 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.
Since:
1.13
  • Field Details

    • DEFAULT_LOOT_MODIFIER

      public static final int DEFAULT_LOOT_MODIFIER
      Since:
      1.13
      See Also:
  • Method Details

    • getLocation

      @NotNull public @NotNull Location getLocation()
      The Location to store where the loot will be generated.
      Returns:
      the Location of where the loot will be generated
      Since:
      1.13
    • getLuck

      public float getLuck()
      Represents the PotionEffectType.LUCK that an entity can have. The higher the value the better chance of receiving more loot.
      Returns:
      luck
      Since:
      1.13
    • getLootingModifier

      @Deprecated(since="1.21", forRemoval=true) public int getLootingModifier()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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.
      Returns:
      the looting level
    • getLootedEntity

      @Nullable public @Nullable Entity getLootedEntity()
      Get the Entity that was killed. Can be null.
      Returns:
      the looted entity or null
      Since:
      1.13
    • getKiller

      @Nullable public @Nullable HumanEntity getKiller()
      Get the HumanEntity who killed the getLootedEntity(). Can be null.
      Returns:
      the killer entity, or null.
      Since:
      1.13