Package org.bukkit.loot
Class LootContext
- java.lang.Object
-
- org.bukkit.loot.LootContext
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLootContext.BuilderUtility class to make buildingLootContexteasier.
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_LOOT_MODIFIER
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HumanEntitygetKiller()Get theHumanEntitywho killed thegetLootedEntity().LocationgetLocation()TheLocationto store where the loot will be generated.EntitygetLootedEntity()Get theEntitythat was killed.intgetLootingModifier()Represents theEnchantment.LOOT_BONUS_MOBSthegetKiller()entity has on their equipped item.floatgetLuck()Represents thePotionEffectType.LUCKthat an entity can have.
-
-
-
Field Detail
-
DEFAULT_LOOT_MODIFIER
public static final int DEFAULT_LOOT_MODIFIER
- See Also:
- Constant Field Values
-
-
Method Detail
-
getLocation
@NotNull public Location getLocation()
TheLocationto store where the loot will be generated.- Returns:
- the Location of where the loot will be generated
-
getLuck
public float getLuck()
Represents thePotionEffectType.LUCKthat 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_MOBSthegetKiller()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
@Nullable public Entity getLootedEntity()
Get theEntitythat was killed. Can be null.- Returns:
- the looted entity or null
-
getKiller
@Nullable public HumanEntity getKiller()
Get theHumanEntitywho killed thegetLootedEntity(). Can be null.- Returns:
- the killer entity, or null.
-
-