程序包 org.bukkit.loot
类 LootContext.Builder
java.lang.Object
org.bukkit.loot.LootContext.Builder
- 封闭类:
- LootContext
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明build()使用提供的参数创建一个新的LootContext实例。killer(@Nullable HumanEntity killer) lootedEntity(@Nullable Entity lootedEntity) 被杀死的实体。lootingModifier(int modifier) 已过时。不再起作用luck(float luck) 设置生成战利品时的幸运值。
-
构造器详细资料
-
Builder
创建一个新的 LootContext.Builder 实例,以便于轻松创建LootContext。原文: Creates a new LootContext.Builder instance to facilitate easy creation of
LootContexts.- 参数:
location- LootContext 应使用的位置
-
-
方法详细资料
-
luck
设置生成战利品时的幸运值。原文: Set how much luck to have when generating loot.
- 参数:
luck- 幸运等级- 返回:
- Builder 实例
-
lootingModifier
@NotNull @Deprecated(since="1.21") public @NotNull LootContext.Builder lootingModifier(int modifier) 已过时。不再起作用设置生成战利品时使用的Enchantment.LOOTING等级等效值。小于或等于 0 的值将强制LootTable每个池只返回一个ItemStack。原文: Set the
Enchantment.LOOTINGlevel equivalent to use when generating loot. Values less than or equal to 0 will force theLootTableto only return a singleItemStackper pool.- 参数:
modifier- 抢夺等级修饰符- 返回:
- Builder 实例
-
lootedEntity
被杀死的实体。原文: The entity that was killed.
- 参数:
lootedEntity- 被掠夺的实体- 返回:
- Builder 实例
-
killer
设置杀死LootContext.getLootedEntity()的HumanEntity。如果未设置lootingModifier(int),此实体将用于获取抢夺等级。原文: Set the
HumanEntitythat killedLootContext.getLootedEntity(). This entity will be used to get the looting level iflootingModifier(int)is not set.- 参数:
killer- 击杀者实体- 返回:
- Builder 实例
-
build
使用提供的参数创建一个新的LootContext实例。原文: Create a new
LootContextinstance using the supplied parameters.- 返回:
- 一个新的
LootContext实例
-