public final class LootContext
extends java.lang.Object
LootTable
can use to modify it's
generated loot.Modifier and Type | Class | Description |
---|---|---|
static class |
LootContext.Builder |
Utility class to make building
LootContext easier. |
Modifier and Type | Field | Description |
---|---|---|
static int |
DEFAULT_LOOT_MODIFIER |
Modifier and Type | Method | Description |
---|---|---|
HumanEntity |
getKiller() |
Get the
HumanEntity who killed the getLootedEntity() . |
Location |
getLocation() |
The
Location to store where the loot will be generated. |
Entity |
getLootedEntity() |
Get the
Entity that was killed. |
int |
getLootingModifier() |
Represents the
Enchantment.LOOT_BONUS_MOBS the
getKiller() entity has on their equipped item. |
float |
getLuck() |
Represents the
PotionEffectType.LUCK that an
entity can have. |
public static final int DEFAULT_LOOT_MODIFIER
public Location getLocation()
Location
to store where the loot will be generated.public float getLuck()
PotionEffectType.LUCK
that an
entity can have. The higher the value the better chance of receiving more
loot.public int getLootingModifier()
Enchantment.LOOT_BONUS_MOBS
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.public Entity getLootedEntity()
Entity
that was killed. Can be null.public HumanEntity getKiller()
HumanEntity
who killed the getLootedEntity()
.
Can be null.Copyright © 2018. All rights reserved.