Class LootContext
java.lang.Object
net.minecraft.world.level.storage.loot.LootContext
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static enum
static final record
-
Field Summary
Modifier and TypeFieldDescriptionprivate final HolderGetter.Provider
private final LootParams
private ResourceLocation
private final RandomSource
private final Set
<LootContext.VisitedEntry<?>> -
Constructor Summary
ModifierConstructorDescription(package private)
LootContext
(LootParams p_287722_, RandomSource p_287702_, HolderGetter.Provider p_335850_) private
LootContext
(LootParams p_287722_, RandomSource p_287702_, HolderGetter.Provider p_287619_, ResourceLocation queriedLootTableId) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDynamicDrops
(ResourceLocation p_78943_, Consumer<ItemStack> p_78944_) createVisitedEntry
(LootItemFunction p_279163_) static LootContext.VisitedEntry
<LootTable> createVisitedEntry
(LootTable p_279327_) createVisitedEntry
(LootItemCondition p_279250_) getLevel()
int
float
getLuck()
<T> T
getParam
(LootContextParam<T> p_165125_) <T> T
getParamOrNull
(LootContextParam<T> p_78954_) boolean
hasParam
(LootContextParam<?> p_78937_) boolean
hasVisitedElement
(LootContext.VisitedEntry<?> p_279182_) void
popVisitedElement
(LootContext.VisitedEntry<?> p_279198_) boolean
pushVisitedElement
(LootContext.VisitedEntry<?> p_279152_) void
setQueriedLootTableId
(ResourceLocation queriedLootTableId)
-
Field Details
-
params
-
random
-
lootDataResolver
-
visitedElements
-
queriedLootTableId
-
-
Constructor Details
-
LootContext
LootContext(LootParams p_287722_, RandomSource p_287702_, HolderGetter.Provider p_335850_) -
LootContext
private LootContext(LootParams p_287722_, RandomSource p_287702_, HolderGetter.Provider p_287619_, ResourceLocation queriedLootTableId)
-
-
Method Details
-
hasParam
-
getParam
-
addDynamicDrops
-
getParamOrNull
-
hasVisitedElement
-
pushVisitedElement
-
popVisitedElement
-
getResolver
-
getRandom
-
getLuck
public float getLuck() -
getLevel
-
createVisitedEntry
-
createVisitedEntry
public static LootContext.VisitedEntry<LootItemCondition> createVisitedEntry(LootItemCondition p_279250_) -
createVisitedEntry
public static LootContext.VisitedEntry<LootItemFunction> createVisitedEntry(LootItemFunction p_279163_) -
getLootingModifier
public int getLootingModifier() -
setQueriedLootTableId
-
getQueriedLootTableId
-