Class LootContext
java.lang.Object
net.minecraft.world.level.storage.loot.LootContext
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static interface
static enum
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Function<ResourceLocation,
LootItemCondition> private final Map<ResourceLocation,
LootContext.DynamicDrop> private final ServerLevel
private final Function<ResourceLocation,
LootTable> private final float
private final Map<LootContextParam<?>,
Object> private ResourceLocation
private final RandomSource
private final Set<LootItemCondition>
-
Constructor Summary
ModifierConstructorDescription(package private)
LootContext
(RandomSource p_230900_, float p_230901_, ServerLevel p_230902_, Function<ResourceLocation, LootTable> p_230903_, Function<ResourceLocation, LootItemCondition> p_230904_, Map<LootContextParam<?>, Object> p_230905_, Map<ResourceLocation, LootContext.DynamicDrop> p_230906_) private
LootContext
(RandomSource 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(RandomSource p_230900_, float p_230901_, ServerLevel p_230902_, Function<ResourceLocation, LootTable> p_230903_, Function<ResourceLocation, LootItemCondition> p_230904_, Map<LootContextParam<?>, Object> p_230905_, Map<ResourceLocation, LootContext.DynamicDrop> p_230906_) -
LootContext
private LootContext(RandomSource 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
-