Uses of Class
net.minecraft.world.level.storage.loot.LootContext
Packages that use LootContext
Package
Description
-
Uses of LootContext in net.minecraft.advancements.critereon
Fields in net.minecraft.advancements.critereon with type parameters of type LootContextModifier and TypeFieldDescriptionprivate final Predicate<LootContext> ContextAwarePredicate.compositePredicatesMethods in net.minecraft.advancements.critereon that return LootContextModifier and TypeMethodDescriptionstatic LootContextEntityPredicate.createContext(ServerPlayer player, Entity entity) Methods in net.minecraft.advancements.critereon with parameters of type LootContextModifier and TypeMethodDescriptionbooleanAnyBlockInteractionTrigger.TriggerInstance.matches(LootContext context) private static booleanBredAnimalsTrigger.TriggerInstance.matches(Optional<ContextAwarePredicate> predicate, LootContext context) booleanBredAnimalsTrigger.TriggerInstance.matches(LootContext parentContext, LootContext partnerContext, LootContext childContext) booleanContextAwarePredicate.matches(LootContext context) booleanCuredZombieVillagerTrigger.TriggerInstance.matches(LootContext zombie, LootContext villager) booleanDefaultBlockInteractionTrigger.TriggerInstance.matches(LootContext context) booleanEffectsChangedTrigger.TriggerInstance.matches(ServerPlayer player, LootContext lootContext) booleanFallAfterExplosionTrigger.TriggerInstance.matches(ServerLevel level, Vec3 startPosition, Vec3 endPosition, LootContext context) booleanFishingRodHookedTrigger.TriggerInstance.matches(ItemStack rod, LootContext context, Collection<ItemStack> stacks) booleanItemUsedOnLocationTrigger.TriggerInstance.matches(LootContext context) booleanKilledTrigger.TriggerInstance.matches(ServerPlayer player, LootContext context, DamageSource source) booleanLightningStrikeTrigger.TriggerInstance.matches(LootContext playerContext, List<LootContext> entityContexts) booleanPickedUpItemTrigger.TriggerInstance.matches(ServerPlayer player, ItemStack stack, LootContext context) booleanPlayerHurtEntityTrigger.TriggerInstance.matches(ServerPlayer player, LootContext context, DamageSource damage, float dealt, float taken, boolean blocked) booleanPlayerInteractTrigger.TriggerInstance.matches(ItemStack item, LootContext lootContext) booleanSummonedEntityTrigger.TriggerInstance.matches(LootContext lootContext) booleanTameAnimalTrigger.TriggerInstance.matches(LootContext lootContext) booleanTargetBlockTrigger.TriggerInstance.matches(LootContext context, Vec3 vector, int signalStrength) booleanTradeTrigger.TriggerInstance.matches(LootContext context, ItemStack stack) Method parameters in net.minecraft.advancements.critereon with type arguments of type LootContextModifier and TypeMethodDescriptionbooleanChanneledLightningTrigger.TriggerInstance.matches(Collection<? extends LootContext> victims) booleanKilledByArrowTrigger.TriggerInstance.matches(Collection<LootContext> context, int uniqueEntityTypes, ItemStack firedFromWeapon) booleanLightningStrikeTrigger.TriggerInstance.matches(LootContext playerContext, List<LootContext> entityContexts) -
Uses of LootContext in net.minecraft.world.item.enchantment
Methods in net.minecraft.world.item.enchantment that return LootContextModifier and TypeMethodDescriptionstatic LootContextEnchantment.blockHitContext(ServerLevel level, int enchantmentLevel, Entity entity, Vec3 origin, BlockState state) static LootContextEnchantment.damageContext(ServerLevel level, int enchantmentLevel, Entity entity, DamageSource damageSource) static LootContextEnchantment.entityContext(ServerLevel level, int enchantmentLevel, Entity entity, Vec3 origin) static LootContextEnchantment.itemContext(ServerLevel level, int enchantmentLevel, ItemStack tool) static LootContextEnchantment.locationContext(ServerLevel level, int enchantmentLevel, Entity entity, boolean enchantmentActive) Methods in net.minecraft.world.item.enchantment with parameters of type LootContextModifier and TypeMethodDescriptionstatic <T> voidEnchantment.applyEffects(List<ConditionalEffect<T>> effects, LootContext context, Consumer<T> applier) booleanConditionalEffect.matches(LootContext context) booleanTargetedConditionalEffect.matches(LootContext context) -
Uses of LootContext in net.minecraft.world.level.storage.loot
Fields in net.minecraft.world.level.storage.loot with type parameters of type LootContextModifier and TypeFieldDescriptionprivate final Predicate<LootContext> LootPool.compositeConditionprivate final BiFunction<ItemStack, LootContext, ItemStack> LootPool.compositeFunctionprivate final BiFunction<ItemStack, LootContext, ItemStack> LootTable.compositeFunctionMethods in net.minecraft.world.level.storage.loot that return LootContextModifier and TypeMethodDescriptionLootContext.Builder.create(Optional<ResourceLocation> sequence) Methods in net.minecraft.world.level.storage.loot with parameters of type LootContextModifier and TypeMethodDescriptionprivate voidLootPool.addRandomItem(Consumer<ItemStack> stackConsumer, LootContext context) voidLootPool.addRandomItems(Consumer<ItemStack> stackConsumer, LootContext lootContext) Generate the random items from this LootPool to the givenstackConsumer.intIntRange.IntLimiter.apply(LootContext lootContext, int value) intIntRange.clamp(LootContext lootContext, int value) Clamp the given value so that it falls within this IntRange.private it.unimi.dsi.fastutil.objects.ObjectArrayList<ItemStack> LootTable.getRandomItems(LootContext context) Generate random items to a List.voidLootTable.getRandomItems(LootContext contextData, Consumer<ItemStack> output) Generate random items to the given Consumer, ensuring they do not exceed their maximum stack size.voidLootTable.getRandomItemsRaw(LootContext context, Consumer<ItemStack> output) Deprecated.booleanIntRange.IntChecker.test(LootContext lootContext, int value) booleanIntRange.test(LootContext lootContext, int value) Check whether the given value falls within this IntRange.Constructors in net.minecraft.world.level.storage.loot with parameters of type LootContext -
Uses of LootContext in net.minecraft.world.level.storage.loot.entries
Fields in net.minecraft.world.level.storage.loot.entries with type parameters of type LootContextModifier and TypeFieldDescriptionprivate final Predicate<LootContext> LootPoolEntryContainer.compositeCondition(package private) final BiFunction<ItemStack, LootContext, ItemStack> LootPoolSingletonContainer.compositeFunctionMethods in net.minecraft.world.level.storage.loot.entries with parameters of type LootContextModifier and TypeMethodDescriptionprotected final booleanLootPoolEntryContainer.canRun(LootContext lootContext) voidDynamicLoot.createItemStack(Consumer<ItemStack> p_79481_, LootContext p_79482_) voidEmptyLootItem.createItemStack(Consumer<ItemStack> p_79531_, LootContext p_79532_) voidLootItem.createItemStack(Consumer<ItemStack> p_79590_, LootContext p_79591_) voidLootPoolEntry.createItemStack(Consumer<ItemStack> stackConsumer, LootContext lootContext) Generate the loot stacks of this entry.protected abstract voidLootPoolSingletonContainer.createItemStack(Consumer<ItemStack> stackConsumer, LootContext lootContext) Generate the loot stacks of this entry.voidNestedLootTable.createItemStack(Consumer<ItemStack> p_331038_, LootContext p_331648_) voidTagEntry.createItemStack(Consumer<ItemStack> p_79854_, LootContext p_79855_) booleanComposableEntryContainer.expand(LootContext lootContext, Consumer<LootPoolEntry> entryConsumer) Expand this loot pool entry container by callingentryConsumerwith any applicable entriesfinal booleanCompositeEntryBase.expand(LootContext p_79439_, Consumer<LootPoolEntry> p_79440_) booleanLootPoolSingletonContainer.expand(LootContext p_79694_, Consumer<LootPoolEntry> p_79695_) booleanTagEntry.expand(LootContext p_79861_, Consumer<LootPoolEntry> p_79862_) private booleanTagEntry.expandTag(LootContext context, Consumer<LootPoolEntry> generatorConsumer) -
Uses of LootContext in net.minecraft.world.level.storage.loot.functions
Fields in net.minecraft.world.level.storage.loot.functions with type parameters of type LootContextModifier and TypeFieldDescriptionprivate final BiFunction<ItemStack, LootContext, ItemStack> SequenceFunction.compositeFunctionprivate final Predicate<LootContext> LootItemConditionalFunction.compositePredicatesstatic final BiFunction<ItemStack, LootContext, ItemStack> LootItemFunctions.IDENTITYMethods in net.minecraft.world.level.storage.loot.functions that return types with arguments of type LootContextModifier and TypeMethodDescriptionstatic BiFunction<ItemStack, LootContext, ItemStack> LootItemFunctions.compose(List<? extends BiFunction<ItemStack, LootContext, ItemStack>> functions) Methods in net.minecraft.world.level.storage.loot.functions with parameters of type LootContextModifier and TypeMethodDescriptionfinal ItemStackLootItemConditionalFunction.apply(ItemStack stack, LootContext context) SequenceFunction.apply(ItemStack stack, LootContext context) static UnaryOperator<Component> SetNameFunction.createResolver(LootContext lootContext, LootContext.EntityTarget resolutionContext) Create a UnaryOperator that resolves Components based on the given LootContext and EntityTarget.LootItemFunction.decorate(BiFunction<ItemStack, LootContext, ItemStack> stackModification, Consumer<ItemStack> originalConsumer, LootContext lootContext) Create a decorated Consumer.CopyComponentsFunction.Source.get(LootContext context) ApplyBonusCount.run(ItemStack stack, LootContext context) ApplyExplosionDecay.run(ItemStack stack, LootContext context) protected ItemStackCopyBlockState.run(ItemStack stack, LootContext context) CopyComponentsFunction.run(ItemStack p_330563_, LootContext p_331220_) CopyCustomDataFunction.run(ItemStack p_330210_, LootContext p_330315_) CopyNameFunction.run(ItemStack stack, LootContext context) EnchantedCountIncreaseFunction.run(ItemStack p_345285_, LootContext p_345560_) EnchantRandomlyFunction.run(ItemStack stack, LootContext context) EnchantWithLevelsFunction.run(ItemStack stack, LootContext context) ExplorationMapFunction.run(ItemStack stack, LootContext context) FillPlayerHead.run(ItemStack stack, LootContext context) FilteredFunction.run(ItemStack p_340845_, LootContext p_341349_) protected ItemStackFunctionReference.run(ItemStack p_279458_, LootContext p_279370_) LimitCount.run(ItemStack stack, LootContext context) protected abstract ItemStackLootItemConditionalFunction.run(ItemStack stack, LootContext context) Called to perform the actual action of this function, after conditions have been checked.ModifyContainerContents.run(ItemStack p_341267_, LootContext p_341214_) SetAttributesFunction.run(ItemStack stack, LootContext context) protected ItemStackSetBannerPatternFunction.run(ItemStack p_165280_, LootContext p_165281_) protected ItemStackSetBookCoverFunction.run(ItemStack p_334048_, LootContext p_334012_) SetComponentsFunction.run(ItemStack p_330211_, LootContext p_331318_) SetContainerContents.run(ItemStack stack, LootContext context) SetContainerLootTable.run(ItemStack stack, LootContext context) SetCustomDataFunction.run(ItemStack p_330737_, LootContext p_331310_) SetCustomModelDataFunction.run(ItemStack p_341195_, LootContext p_341335_) SetEnchantmentsFunction.run(ItemStack p_165346_, LootContext p_165347_) protected ItemStackSetFireworkExplosionFunction.run(ItemStack p_334066_, LootContext p_333987_) protected ItemStackSetFireworksFunction.run(ItemStack p_334053_, LootContext p_333744_) SetInstrumentFunction.run(ItemStack p_231017_, LootContext p_231018_) SetItemCountFunction.run(ItemStack stack, LootContext context) SetItemDamageFunction.run(ItemStack stack, LootContext context) SetItemFunction.run(ItemStack p_340909_, LootContext p_341298_) SetLoreFunction.run(ItemStack stack, LootContext context) SetNameFunction.run(ItemStack stack, LootContext context) SetOminousBottleAmplifierFunction.run(ItemStack p_338554_, LootContext p_338336_) SetPotionFunction.run(ItemStack p_193073_, LootContext p_193074_) SetStewEffectFunction.run(ItemStack stack, LootContext context) protected ItemStackSetWritableBookPagesFunction.run(ItemStack p_333832_, LootContext p_333929_) protected ItemStackSetWrittenBookPagesFunction.run(ItemStack p_333960_, LootContext p_333892_) SmeltItemFunction.run(ItemStack stack, LootContext context) protected ItemStackToggleTooltips.run(ItemStack p_335844_, LootContext p_335764_) SetLoreFunction.updateLore(ItemLore itemLore, LootContext context) private ItemAttributeModifiersSetAttributesFunction.updateModifiers(LootContext context, ItemAttributeModifiers modifiers) Method parameters in net.minecraft.world.level.storage.loot.functions with type arguments of type LootContextModifier and TypeMethodDescriptionstatic BiFunction<ItemStack, LootContext, ItemStack> LootItemFunctions.compose(List<? extends BiFunction<ItemStack, LootContext, ItemStack>> functions) LootItemFunction.decorate(BiFunction<ItemStack, LootContext, ItemStack> stackModification, Consumer<ItemStack> originalConsumer, LootContext lootContext) Create a decorated Consumer. -
Uses of LootContext in net.minecraft.world.level.storage.loot.predicates
Fields in net.minecraft.world.level.storage.loot.predicates with type parameters of type LootContextModifier and TypeFieldDescriptionprivate final Predicate<LootContext> CompositeLootItemCondition.composedPredicateMethods in net.minecraft.world.level.storage.loot.predicates with parameters of type LootContextModifier and TypeMethodDescriptionprotected booleanEntityHasScoreCondition.hasScore(LootContext lootContext, Entity targetEntity, Scoreboard scoreboard, String objectiveName, IntRange scoreRange) booleanBonusLevelTableCondition.test(LootContext context) final booleanCompositeLootItemCondition.test(LootContext context) booleanConditionReference.test(LootContext context) booleanDamageSourceCondition.test(LootContext context) booleanEnchantmentActiveCheck.test(LootContext context) booleanEntityHasScoreCondition.test(LootContext context) booleanExplosionCondition.test(LootContext context) booleanInvertedLootItemCondition.test(LootContext context) booleanLocationCheck.test(LootContext context) booleanLootItemBlockStatePropertyCondition.test(LootContext context) booleanLootItemEntityPropertyCondition.test(LootContext context) booleanLootItemKilledByPlayerCondition.test(LootContext context) booleanLootItemRandomChanceCondition.test(LootContext context) booleanLootItemRandomChanceWithEnchantedBonusCondition.test(LootContext context) booleanMatchTool.test(LootContext context) booleanTimeCheck.test(LootContext context) booleanValueCheckCondition.test(LootContext context) booleanWeatherCheck.test(LootContext context) Constructor parameters in net.minecraft.world.level.storage.loot.predicates with type arguments of type LootContextModifierConstructorDescriptionprotectedCompositeLootItemCondition(List<LootItemCondition> terms, Predicate<LootContext> composedPredicate) -
Uses of LootContext in net.minecraft.world.level.storage.loot.providers.nbt
Methods in net.minecraft.world.level.storage.loot.providers.nbt with parameters of type LootContextModifier and TypeMethodDescriptionContextNbtProvider.get(LootContext p_165573_) ContextNbtProvider.Getter.get(LootContext lootContext) NbtProvider.get(LootContext lootContext) StorageNbtProvider.get(LootContext p_165636_) -
Uses of LootContext in net.minecraft.world.level.storage.loot.providers.number
Methods in net.minecraft.world.level.storage.loot.providers.number with parameters of type LootContextModifier and TypeMethodDescriptionfloatBinomialDistributionGenerator.getFloat(LootContext p_165666_) floatConstantValue.getFloat(LootContext p_165695_) floatEnchantmentLevelProvider.getFloat(LootContext p_344791_) floatNumberProvider.getFloat(LootContext lootContext) floatScoreboardValue.getFloat(LootContext p_165758_) floatStorageValue.getFloat(LootContext p_335884_) floatUniformGenerator.getFloat(LootContext p_165787_) intBinomialDistributionGenerator.getInt(LootContext p_165663_) default intNumberProvider.getInt(LootContext lootContext) intStorageValue.getInt(LootContext p_335703_) intUniformGenerator.getInt(LootContext p_165784_) private NumberStorageValue.getNumericTag(LootContext context, Number defaultValue) -
Uses of LootContext in net.minecraft.world.level.storage.loot.providers.score
Methods in net.minecraft.world.level.storage.loot.providers.score with parameters of type LootContextModifier and TypeMethodDescriptionContextScoreboardNameProvider.getScoreHolder(LootContext p_313828_) FixedScoreboardNameProvider.getScoreHolder(LootContext p_313943_) ScoreboardNameProvider.getScoreHolder(LootContext context) -
Uses of LootContext in net.neoforged.neoforge.common
Methods in net.neoforged.neoforge.common with parameters of type LootContextModifier and TypeMethodDescriptionCommonHooks.modifyLoot(List<ItemStack> list, LootContext context) Deprecated.static it.unimi.dsi.fastutil.objects.ObjectArrayList<ItemStack> CommonHooks.modifyLoot(ResourceLocation lootTableId, it.unimi.dsi.fastutil.objects.ObjectArrayList<ItemStack> generatedLoot, LootContext context) Handles the modification of loot table drops via the registered Global Loot Modifiers, so that custom effects can be processed. -
Uses of LootContext in net.neoforged.neoforge.common.loot
Fields in net.neoforged.neoforge.common.loot with type parameters of type LootContextModifier and TypeFieldDescriptionprivate final Predicate<LootContext> LootModifier.combinedConditionsMethods in net.neoforged.neoforge.common.loot with parameters of type LootContextModifier and TypeMethodDescriptionit.unimi.dsi.fastutil.objects.ObjectArrayList<ItemStack> IGlobalLootModifier.apply(it.unimi.dsi.fastutil.objects.ObjectArrayList<ItemStack> generatedLoot, LootContext context) Applies the modifier to the list of generated loot.final it.unimi.dsi.fastutil.objects.ObjectArrayList<ItemStack> LootModifier.apply(it.unimi.dsi.fastutil.objects.ObjectArrayList<ItemStack> generatedLoot, LootContext context) protected it.unimi.dsi.fastutil.objects.ObjectArrayList<ItemStack> AddTableLootModifier.doApply(it.unimi.dsi.fastutil.objects.ObjectArrayList<ItemStack> generatedLoot, LootContext context) protected abstract it.unimi.dsi.fastutil.objects.ObjectArrayList<ItemStack> LootModifier.doApply(it.unimi.dsi.fastutil.objects.ObjectArrayList<ItemStack> generatedLoot, LootContext context) Applies the modifier to the generated loot (all loot conditions have already been checked and have returned true).booleanCanItemPerformAbility.test(LootContext lootContext) booleanLootTableIdCondition.test(LootContext lootContext)
CommonHooks.modifyLoot(ResourceLocation, ObjectArrayList, LootContext)instead.