Package org.bukkit.loot
Class LootContext
java.lang.Object
org.bukkit.loot.LootContext
Represents additional information a
LootTable
can use to modify it's
generated loot.-
Nested Class Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet theHumanEntity
who killed thegetLootedEntity()
.TheLocation
to store where the loot will be generated.Get theEntity
that was killed.int
Represents theEnchantment.LOOT_BONUS_MOBS
thegetKiller()
entity has on their equipped item.float
getLuck()
Represents thePotionEffectType.LUCK
that an entity can have.
-
Field Details
-
DEFAULT_LOOT_MODIFIER
public static final int DEFAULT_LOOT_MODIFIER- See Also:
- Constant Field Values
-
-
Method Details
-
getLocation
TheLocation
to store where the loot will be generated.- Returns:
- the Location of where the loot will be generated
-
getLuck
public float getLuck()Represents thePotionEffectType.LUCK
that an entity can have. The higher the value the better chance of receiving more loot.- Returns:
- luck
-
getLootingModifier
public int getLootingModifier()Represents theEnchantment.LOOT_BONUS_MOBS
thegetKiller()
entity has on their equipped item. This value is only set viaLootContext.Builder.lootingModifier(int)
. If not set, thegetKiller()
entity's looting level will be used instead.- Returns:
- the looting level
-
getLootedEntity
Get theEntity
that was killed. Can be null.- Returns:
- the looted entity or null
-
getKiller
Get theHumanEntity
who killed thegetLootedEntity()
. Can be null.- Returns:
- the killer entity, or null.
-