Package org.bukkit.loot
Class LootContext.Builder
java.lang.Object
org.bukkit.loot.LootContext.Builder
- Enclosing class:
- LootContext
Utility class to make building 
LootContext easier. The only
 required argument is Location with a valid (non-null)
 World.- 
Constructor SummaryConstructorsConstructorDescriptionCreates a new LootContext.Builder instance to facilitate easy creation ofLootContexts.
- 
Method SummaryModifier and TypeMethodDescriptionbuild()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) Deprecated, for removal: This API element is subject to removal in a future version.no longer functionalluck(float luck) Set how much luck to have when generating loot.
- 
Constructor Details- 
BuilderCreates a new LootContext.Builder instance to facilitate easy creation ofLootContexts.- Parameters:
- location- the location the LootContext should use
 
 
- 
- 
Method Details- 
luckSet how much luck to have when generating loot.- Parameters:
- luck- the luck level
- Returns:
- the Builder
 
- 
lootingModifier@NotNull @Deprecated(since="1.21", forRemoval=true) public @NotNull LootContext.Builder lootingModifier(int modifier) Deprecated, for removal: This API element is subject to removal in a future version.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.- Parameters:
- modifier- the looting level modifier
- Returns:
- the Builder
 
- 
lootedEntityThe entity that was killed.- Parameters:
- lootedEntity- the looted entity
- Returns:
- the Builder
 
- 
killerSet theHumanEntitythat killedLootContext.getLootedEntity(). This entity will be used to get the looting level iflootingModifier(int)is not set.- Parameters:
- killer- the killer entity
- Returns:
- the Builder
 
- 
buildCreate a newLootContextinstance using the supplied parameters.- Returns:
- a new LootContextinstance
 
 
-