public static class LootContext.Builder
extends java.lang.Object
LootContext
easier. The only
required argument is Location
with a valid (non-null)
World
.Constructor | Description |
---|---|
Builder(Location location) |
Creates a new LootContext.Builder instance to facilitate easy
creation of
LootContext s. |
Modifier and Type | Method | Description |
---|---|---|
LootContext |
build() |
Create a new
LootContext instance using the supplied
parameters. |
LootContext.Builder |
killer(HumanEntity killer) |
Set the
HumanEntity that killed
LootContext.getLootedEntity() . |
LootContext.Builder |
lootedEntity(Entity lootedEntity) |
The entity that was killed.
|
LootContext.Builder |
lootingModifier(int modifier) |
Set the
Enchantment.LOOT_BONUS_MOBS
level equivalent to use when generating loot. |
LootContext.Builder |
luck(float luck) |
Set how much luck to have when generating loot.
|
public Builder(Location location)
LootContext
s.location
- the location the LootContext should usepublic LootContext.Builder luck(float luck)
luck
- the luck levelpublic LootContext.Builder lootingModifier(int modifier)
Enchantment.LOOT_BONUS_MOBS
level equivalent to use when generating loot. Values less than or
equal to 0 will force the LootTable
to only return a single
ItemStack
per pool.modifier
- the looting level modifierpublic LootContext.Builder lootedEntity(Entity lootedEntity)
lootedEntity
- the looted entitypublic LootContext.Builder killer(HumanEntity killer)
HumanEntity
that killed
LootContext.getLootedEntity()
. This entity will be used to get the
looting level if lootingModifier(int)
is not set.killer
- the killer entitypublic LootContext build()
LootContext
instance using the supplied
parameters.LootContext
instanceCopyright © 2018. All rights reserved.