Class LootContext
java.lang.Object
net.minecraft.world.level.storage.loot.LootContext
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interfacestatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Function<ResourceLocation,LootItemCondition>private Map<ResourceLocation,LootContext.DynamicDrop>private ServerLevelprivate Function<ResourceLocation,LootTable>private floatprivate Map<LootContextParam<?>,Object>private ResourceLocationprivate Randomprivate Set<LootItemCondition> -
Constructor Summary
ConstructorsModifierConstructorDescription(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_)privateLootContext(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 TypeMethodDescriptionvoidaddDynamicDrops(ResourceLocation p_78943_, Consumer<ItemStack> p_78944_)booleanaddVisitedCondition(LootItemCondition p_78939_)booleanaddVisitedTable(LootTable p_78935_)getCondition(ResourceLocation p_78951_)getLevel()intgetLootTable(ResourceLocation p_78941_)floatgetLuck()<T> TgetParam(LootContextParam<T> p_165125_)<T> TgetParamOrNull(LootContextParam<T> p_78954_)booleanhasParam(LootContextParam<?> p_78937_)voidremoveVisitedCondition(LootItemCondition p_78949_)voidremoveVisitedTable(LootTable p_78947_)voidsetQueriedLootTableId(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
-