Modifier and Type | Class and Description |
---|---|
static class |
LootContext.Builder
Utility class to make building
LootContext easier. |
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_LOOT_MODIFIER |
Modifier and Type | Method and 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
@NotNull 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.@Nullable public Entity getLootedEntity()
Entity
that was killed. Can be null.@Nullable public HumanEntity getKiller()
HumanEntity
who killed the getLootedEntity()
.
Can be null.Copyright © 2022. All rights reserved.