public final class LootContext
extends java.lang.Object
LootTable
can use to modify it's
generated loot.限定符和类型 | 类和说明 |
---|---|
static class |
LootContext.Builder
Utility class to make building
LootContext easier. |
限定符和类型 | 字段和说明 |
---|---|
static int |
DEFAULT_LOOT_MODIFIER |
限定符和类型 | 方法和说明 |
---|---|
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.