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 |
---|---|---|
@Nullable HumanEntity |
getKiller() |
Get the
HumanEntity who killed the getLootedEntity() . |
@NotNull Location |
getLocation() |
The
Location to store where the loot will be generated. |
@Nullable 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
@NotNull public @NotNull 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.@Nullable public @Nullable Entity getLootedEntity()
Entity
that was killed. Can be null.@Nullable public @Nullable HumanEntity getKiller()
HumanEntity
who killed the getLootedEntity()
.
Can be null.Copyright © 2020. All rights reserved.