程序包 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 newLootContextinstance using the supplied parameters.killer(@Nullable HumanEntity killer) Set theHumanEntitythat 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.
- 
构造器详细资料- 
BuilderCreates a new LootContext.Builder instance to facilitate easy creation ofLootContexts.- 参数:
- location- the location the LootContext should use
 
 
- 
- 
方法详细资料- 
luckSet how much luck to have when generating loot.- 参数:
- luck- the luck level
- 返回:
- the Builder
 
- 
lootingModifier@NotNull @Deprecated(since="1.21") public @NotNull LootContext.Builder lootingModifier(int modifier) 已过时。no longer functionalSet theEnchantment.LOOTINGlevel equivalent to use when generating loot. Values less than or equal to 0 will force theLootTableto only return a singleItemStackper pool.- 参数:
- modifier- the looting level modifier
- 返回:
- the Builder
 
- 
lootedEntityThe entity that was killed.- 参数:
- lootedEntity- the looted entity
- 返回:
- the Builder
 
- 
killerSet theHumanEntitythat killedLootContext.getLootedEntity(). This entity will be used to get the looting level iflootingModifier(int)is not set.- 参数:
- killer- the killer entity
- 返回:
- the Builder
 
- 
buildCreate a newLootContextinstance using the supplied parameters.- 返回:
- a new LootContextinstance
 
 
-