程序包 org.bukkit.loot
类 LootContext.Builder
java.lang.Object
org.bukkit.loot.LootContext.Builder
- 封闭类:
- LootContext
Utility class to make building
LootContext
easier. The only
required argument is Location
with a valid (non-null)
World
.-
构造器概要
-
方法概要
修饰符和类型方法说明build()
Create a newLootContext
instance using the supplied parameters.killer
(@Nullable HumanEntity killer) Set theHumanEntity
that killedLootContext.getLootedEntity()
.lootedEntity
(@Nullable Entity lootedEntity) The entity that was killed.lootingModifier
(int modifier) 已过时。no longer functionalluck
(float luck) Set how much luck to have when generating loot.
-
构造器详细资料
-
Builder
Creates a new LootContext.Builder instance to facilitate easy creation ofLootContext
s.- 参数:
location
- the location the LootContext should use
-
-
方法详细资料
-
luck
Set how much luck to have when generating loot.- 参数:
luck
- the luck level- 返回:
- the Builder
-
lootingModifier
已过时。no longer functionalSet theEnchantment.LOOTING
level equivalent to use when generating loot. Values less than or equal to 0 will force theLootTable
to only return a singleItemStack
per pool.- 参数:
modifier
- the looting level modifier- 返回:
- the Builder
-
lootedEntity
The entity that was killed.- 参数:
lootedEntity
- the looted entity- 返回:
- the Builder
-
killer
Set theHumanEntity
that killedLootContext.getLootedEntity()
. This entity will be used to get the looting level iflootingModifier(int)
is not set.- 参数:
killer
- the killer entity- 返回:
- the Builder
-
build
Create a newLootContext
instance using the supplied parameters.- 返回:
- a new
LootContext
instance
-