Class LootContext
java.lang.Object
net.minecraft.world.level.storage.loot.LootContext
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static interface
static class
-
Field Summary
Modifier and TypeFieldDescriptionprivate Function<ResourceLocation,LootItemCondition>
private Map<ResourceLocation,LootContext.DynamicDrop>
private ServerLevel
private Function<ResourceLocation,LootTable>
private float
private Map<LootContextParam<?>,Object>
private ResourceLocation
private Random
private Set<LootItemCondition>
-
Constructor Summary
ModifierConstructorDescription(package private)
LootContext(Random p_78917_, float p_78918_, ServerLevel p_78919_, Function<ResourceLocation,LootTable> p_78920_, Function<ResourceLocation,LootItemCondition> p_78921_, Map<LootContextParam<?>,Object> p_78922_, Map<ResourceLocation,LootContext.DynamicDrop> p_78923_)
private
LootContext(Random rand, float luckIn, ServerLevel worldIn, Function<ResourceLocation,LootTable> lootTableManagerIn, Function<ResourceLocation,LootItemCondition> p_i225885_5_, Map<LootContextParam<?>,Object> parametersIn, Map<ResourceLocation,LootContext.DynamicDrop> conditionsIn, ResourceLocation queriedLootTableId)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDynamicDrops(ResourceLocation p_78943_, Consumer<ItemStack> p_78944_)
boolean
addVisitedCondition(LootItemCondition p_78939_)
boolean
addVisitedTable(LootTable p_78935_)
getCondition(ResourceLocation p_78951_)
getLevel()
int
getLootTable(ResourceLocation p_78941_)
float
getLuck()
<T> T
getParam(LootContextParam<T> p_165125_)
<T> T
getParamOrNull(LootContextParam<T> p_78954_)
boolean
hasParam(LootContextParam<?> p_78937_)
void
removeVisitedCondition(LootItemCondition p_78949_)
void
removeVisitedTable(LootTable p_78947_)
void
setQueriedLootTableId(ResourceLocation queriedLootTableId)
-
Field Details
-
random
-
luck
private final float luck -
level
-
lootTables
-
visitedTables
-
conditions
-
visitedConditions
-
params
-
dynamicDrops
-
queriedLootTableId
-
-
Constructor Details
-
LootContext
LootContext(Random p_78917_, float p_78918_, ServerLevel p_78919_, Function<ResourceLocation,LootTable> p_78920_, Function<ResourceLocation,LootItemCondition> p_78921_, Map<LootContextParam<?>,Object> p_78922_, Map<ResourceLocation,LootContext.DynamicDrop> p_78923_) -
LootContext
private LootContext(Random rand, float luckIn, ServerLevel worldIn, Function<ResourceLocation,LootTable> lootTableManagerIn, Function<ResourceLocation,LootItemCondition> p_i225885_5_, Map<LootContextParam<?>,Object> parametersIn, Map<ResourceLocation,LootContext.DynamicDrop> conditionsIn, ResourceLocation queriedLootTableId)
-
-
Method Details
-
hasParam
-
getParam
-
addDynamicDrops
-
getParamOrNull
-
addVisitedTable
-
removeVisitedTable
-
addVisitedCondition
-
removeVisitedCondition
-
getLootTable
-
getCondition
-
getRandom
-
getLuck
public float getLuck() -
getLevel
-
getLootingModifier
public int getLootingModifier() -
setQueriedLootTableId
-
getQueriedLootTableId
-