Uses of Class
net.minecraft.world.level.storage.loot.LootContext
Packages that use LootContext
Package
Description
-
Uses of LootContext in net.minecraft.advancements.criterion
Fields in net.minecraft.advancements.criterion with type parameters of type LootContextModifier and TypeFieldDescriptionprivate final Predicate<LootContext> ContextAwarePredicate.compositePredicatesMethods in net.minecraft.advancements.criterion that return LootContextModifier and TypeMethodDescriptionstatic LootContextEntityPredicate.createContext(ServerPlayer player, Entity entity) Methods in net.minecraft.advancements.criterion with parameters of type LootContextModifier and TypeMethodDescriptionbooleanAnyBlockInteractionTrigger.TriggerInstance.matches(LootContext locationContext) private static booleanBredAnimalsTrigger.TriggerInstance.matches(Optional<ContextAwarePredicate> predicate, LootContext context) booleanBredAnimalsTrigger.TriggerInstance.matches(LootContext parent, LootContext partner, @Nullable LootContext child) booleanContextAwarePredicate.matches(LootContext context) booleanCuredZombieVillagerTrigger.TriggerInstance.matches(LootContext zombie, LootContext villager) booleanDefaultBlockInteractionTrigger.TriggerInstance.matches(LootContext locationContext) booleanEffectsChangedTrigger.TriggerInstance.matches(ServerPlayer player, @Nullable LootContext source) booleanFallAfterExplosionTrigger.TriggerInstance.matches(ServerLevel level, Vec3 enteredPosition, Vec3 playerPosition, @Nullable LootContext cause) booleanFishingRodHookedTrigger.TriggerInstance.matches(ItemStack rod, LootContext hookedIn, Collection<ItemStack> items) booleanItemUsedOnLocationTrigger.TriggerInstance.matches(LootContext locationContext) booleanKilledTrigger.TriggerInstance.matches(ServerPlayer player, LootContext entity, DamageSource killingBlow) booleanLightningStrikeTrigger.TriggerInstance.matches(LootContext bolt, List<LootContext> entitiesAround) booleanPickedUpItemTrigger.TriggerInstance.matches(ServerPlayer player, ItemStack itemStack, LootContext pickedUpBy) booleanPlayerHurtEntityTrigger.TriggerInstance.matches(ServerPlayer player, LootContext victim, DamageSource source, float originalDamage, float actualDamage, boolean blocked) booleanPlayerInteractTrigger.TriggerInstance.matches(ItemStack itemStack, LootContext interactedWith) booleanSummonedEntityTrigger.TriggerInstance.matches(LootContext entity) booleanTameAnimalTrigger.TriggerInstance.matches(LootContext animal) booleanTargetBlockTrigger.TriggerInstance.matches(LootContext projectile, Vec3 hitPosition, int signalStrength) booleanTradeTrigger.TriggerInstance.matches(LootContext villager, ItemStack itemStack) Method parameters in net.minecraft.advancements.criterion with type arguments of type LootContextModifier and TypeMethodDescriptionbooleanChanneledLightningTrigger.TriggerInstance.matches(Collection<? extends LootContext> victims) booleanKilledByArrowTrigger.TriggerInstance.matches(Collection<LootContext> victims, int uniqueEntityTypes, @Nullable ItemStack firedFromWeapon) booleanLightningStrikeTrigger.TriggerInstance.matches(LootContext bolt, List<LootContext> entitiesAround) -
Uses of LootContext in net.minecraft.world.entity.npc.villager
Methods in net.minecraft.world.entity.npc.villager with parameters of type LootContextModifier and TypeMethodDescriptionprivate static voidAbstractVillager.addOffersFromItemListings(LootContext lootContext, MerchantOffers merchantOffers, HolderSet<VillagerTrade> potentialOffers, int numberOfOffers) private static voidAbstractVillager.addOffersFromItemListingsWithoutDuplicates(LootContext lootContext, MerchantOffers merchantOffers, HolderSet<VillagerTrade> potentialOffers, int numberOfOffers) -
Uses of LootContext in net.minecraft.world.item.enchantment
Methods in net.minecraft.world.item.enchantment that return LootContextModifier and TypeMethodDescriptionstatic LootContextEnchantment.blockHitContext(ServerLevel serverLevel, int enchantmentLevel, Entity entity, Vec3 position, BlockState hitBlock) static LootContextEnchantment.damageContext(ServerLevel serverLevel, int enchantmentLevel, Entity victim, DamageSource source) static LootContextEnchantment.entityContext(ServerLevel serverLevel, int enchantmentLevel, Entity entity, Vec3 position) static LootContextEnchantment.itemContext(ServerLevel serverLevel, int enchantmentLevel, ItemInstance itemStack) static LootContextEnchantment.locationContext(ServerLevel serverLevel, int enchantmentLevel, Entity entity, boolean active) Methods in net.minecraft.world.item.enchantment with parameters of type LootContextModifier and TypeMethodDescriptionstatic <T> voidEnchantment.applyEffects(List<ConditionalEffect<T>> effects, LootContext filterData, Enchantment.GenericAction<T> action) private static <T> voidEnchantment.applyEffects(List<ConditionalEffect<T>> effects, LootContext filterData, org.apache.commons.lang3.mutable.MutableFloat value, Enchantment.FloatAction<T> action) booleanConditionalEffect.matches(LootContext context) booleanTargetedConditionalEffect.matches(LootContext context) -
Uses of LootContext in net.minecraft.world.item.slot
Fields in net.minecraft.world.item.slot with type parameters of type LootContextModifier and TypeFieldDescriptionprivate final Function<LootContext, SlotCollection> CompositeSlotSource.compositeSlotSourceMethods in net.minecraft.world.item.slot that return types with arguments of type LootContextModifier and TypeMethodDescriptionstatic Function<LootContext, SlotCollection> SlotSources.group(Collection<? extends SlotSource> list) Methods in net.minecraft.world.item.slot with parameters of type LootContextModifier and TypeMethodDescriptionCompositeSlotSource.provide(LootContext context) EmptySlotSource.provide(LootContext context) final SlotCollectionRangeSlotSource.provide(LootContext context) SlotSource.provide(LootContext context) final SlotCollectionTransformedSlotSource.provide(LootContext context) -
Uses of LootContext in net.minecraft.world.item.trading
Methods in net.minecraft.world.item.trading with parameters of type LootContextModifier and TypeMethodDescriptionintTradeSet.calculateNumberOfTrades(LootContext lootContext) @Nullable MerchantOfferVillagerTrade.getOffer(LootContext lootContext) TradeCost.toItemCost(LootContext lootContext, int additionalCost) -
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<Identifier> randomSequenceKey) Methods in net.minecraft.world.level.storage.loot with parameters of type LootContextModifier and TypeMethodDescriptionprivate voidLootPool.addRandomItem(Consumer<ItemStack> result, LootContext context) voidLootPool.addRandomItems(Consumer<ItemStack> result, LootContext context) Generate the random items from this LootPool to the givenstackConsumer.intIntRange.IntLimiter.apply(LootContext context, int value) intIntRange.clamp(LootContext context, int value) Clamp the given value so that it falls within this IntRange.@Nullable RLootContextArg.get(LootContext context) default @Nullable RLootContextArg.Getter.get(LootContext context) default @Nullable TLootContextArg.SimpleGetter.get(LootContext context) private it.unimi.dsi.fastutil.objects.ObjectArrayList<ItemStack> LootTable.getRandomItems(LootContext context) Generate random items to a List.voidLootTable.getRandomItems(LootContext context, 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 context, int value) booleanIntRange.test(LootContext context, 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.compositeConditionprivate 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 context) voidDynamicLoot.createItemStack(Consumer<ItemStack> output, LootContext context) voidEmptyLootItem.createItemStack(Consumer<ItemStack> output, LootContext context) voidLootItem.createItemStack(Consumer<ItemStack> output, LootContext context) voidLootPoolEntry.createItemStack(Consumer<ItemStack> output, LootContext context) Generate the loot stacks of this entry.protected abstract voidLootPoolSingletonContainer.createItemStack(Consumer<ItemStack> output, LootContext context) Generate the loot stacks of this entry.voidNestedLootTable.createItemStack(Consumer<ItemStack> output, LootContext context) voidSlotLoot.createItemStack(Consumer<ItemStack> output, LootContext context) voidTagEntry.createItemStack(Consumer<ItemStack> output, LootContext context) booleanComposableEntryContainer.expand(LootContext context, Consumer<LootPoolEntry> output) Expand this loot pool entry container by callingentryConsumerwith any applicable entriesfinal booleanCompositeEntryBase.expand(LootContext context, Consumer<LootPoolEntry> output) booleanLootPoolSingletonContainer.expand(LootContext context, Consumer<LootPoolEntry> output) booleanTagEntry.expand(LootContext context, Consumer<LootPoolEntry> output) private booleanTagEntry.expandTag(LootContext context, Consumer<LootPoolEntry> output) -
Uses of LootContext in net.minecraft.world.level.storage.loot.functions
Subinterfaces with type arguments of type LootContext in net.minecraft.world.level.storage.loot.functionsModifier and TypeInterfaceDescriptioninterfaceA LootItemFunction modifies an ItemStack based on the current LootContext.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 itemStack, LootContext context) SequenceFunction.apply(ItemStack stack, LootContext context) static UnaryOperator<Component> SetNameFunction.createResolver(LootContext context, @Nullable LootContext.EntityTarget entityTarget) Create a UnaryOperator that resolves Components based on the given LootContext and EntityTarget.LootItemFunction.decorate(BiFunction<ItemStack, LootContext, ItemStack> function, Consumer<ItemStack> output, LootContext context) Create a decorated Consumer.private ItemStackEnchantRandomlyFunction.enchantItem(ItemStack itemStack, Holder<Enchantment> enchantment, LootContext context) ApplyBonusCount.run(ItemStack itemStack, LootContext context) ApplyExplosionDecay.run(ItemStack itemStack, LootContext context) protected ItemStackCopyBlockState.run(ItemStack itemStack, LootContext context) CopyComponentsFunction.run(ItemStack itemStack, LootContext context) CopyCustomDataFunction.run(ItemStack itemStack, LootContext context) CopyNameFunction.run(ItemStack itemStack, LootContext context) protected ItemStackDiscardItem.run(ItemStack itemStack, LootContext context) EnchantedCountIncreaseFunction.run(ItemStack itemStack, LootContext context) EnchantRandomlyFunction.run(ItemStack itemStack, LootContext context) EnchantWithLevelsFunction.run(ItemStack itemStack, LootContext context) ExplorationMapFunction.run(ItemStack itemStack, LootContext context) FillPlayerHead.run(ItemStack itemStack, LootContext context) FilteredFunction.run(ItemStack itemStack, LootContext context) protected ItemStackFunctionReference.run(ItemStack itemStack, LootContext context) LimitCount.run(ItemStack itemStack, LootContext context) protected abstract ItemStackLootItemConditionalFunction.run(ItemStack itemStack, LootContext context) Called to perform the actual action of this function, after conditions have been checked.ModifyContainerContents.run(ItemStack itemStack, LootContext context) SetAttributesFunction.run(ItemStack itemStack, LootContext context) protected ItemStackSetBannerPatternFunction.run(ItemStack itemStack, LootContext context) protected ItemStackSetBookCoverFunction.run(ItemStack itemStack, LootContext context) SetComponentsFunction.run(ItemStack itemStack, LootContext context) SetContainerContents.run(ItemStack itemStack, LootContext context) SetContainerLootTable.run(ItemStack itemStack, LootContext context) SetCustomDataFunction.run(ItemStack itemStack, LootContext context) SetCustomModelDataFunction.run(ItemStack itemStack, LootContext context) SetEnchantmentsFunction.run(ItemStack itemStack, LootContext context) protected ItemStackSetFireworkExplosionFunction.run(ItemStack itemStack, LootContext context) protected ItemStackSetFireworksFunction.run(ItemStack itemStack, LootContext context) SetInstrumentFunction.run(ItemStack itemStack, LootContext context) SetItemCountFunction.run(ItemStack itemStack, LootContext context) SetItemDamageFunction.run(ItemStack itemStack, LootContext context) SetItemFunction.run(ItemStack itemStack, LootContext context) SetLoreFunction.run(ItemStack itemStack, LootContext context) SetNameFunction.run(ItemStack itemStack, LootContext context) SetOminousBottleAmplifierFunction.run(ItemStack itemStack, LootContext context) SetPotionFunction.run(ItemStack itemStack, LootContext context) SetRandomDyesFunction.run(ItemStack itemStack, LootContext context) SetRandomPotionFunction.run(ItemStack itemStack, LootContext context) SetStewEffectFunction.run(ItemStack itemStack, LootContext context) protected ItemStackSetWritableBookPagesFunction.run(ItemStack itemStack, LootContext context) protected ItemStackSetWrittenBookPagesFunction.run(ItemStack itemStack, LootContext context) SmeltItemFunction.run(ItemStack itemStack, LootContext context) protected ItemStackToggleTooltips.run(ItemStack itemStack, LootContext context) SetLoreFunction.updateLore(@Nullable ItemLore itemLore, LootContext context) private ItemAttributeModifiersSetAttributesFunction.updateModifiers(LootContext context, ItemAttributeModifiers itemModifiers) 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> function, Consumer<ItemStack> output, LootContext context) Create a decorated Consumer. -
Uses of LootContext in net.minecraft.world.level.storage.loot.predicates
Subinterfaces with type arguments of type LootContext in net.minecraft.world.level.storage.loot.predicatesFields 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 context, Entity entity, Scoreboard scoreboard, String objectiveName, IntRange range) booleanBonusLevelTableCondition.test(LootContext context) final booleanCompositeLootItemCondition.test(LootContext context) booleanConditionReference.test(LootContext lootContext) booleanDamageSourceCondition.test(LootContext context) booleanEnchantmentActiveCheck.test(LootContext lootContext) 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 TypeMethodDescription@Nullable TagContextNbtProvider.get(LootContext context) @Nullable TagNbtProvider.get(LootContext context) StorageNbtProvider.get(LootContext context) -
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 context) floatConstantValue.getFloat(LootContext random) floatEnchantmentLevelProvider.getFloat(LootContext context) floatNumberProvider.getFloat(LootContext context) floatScoreboardValue.getFloat(LootContext context) floatStorageValue.getFloat(LootContext context) floatSum.getFloat(LootContext context) floatUniformGenerator.getFloat(LootContext context) intBinomialDistributionGenerator.getInt(LootContext context) default intNumberProvider.getInt(LootContext context) intStorageValue.getInt(LootContext context) intSum.getInt(LootContext context) intUniformGenerator.getInt(LootContext context) private NumberStorageValue.getNumericTag(LootContext context, Number _default) -
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 TypeMethodDescription@Nullable ScoreHolderContextScoreboardNameProvider.getScoreHolder(LootContext context) FixedScoreboardNameProvider.getScoreHolder(LootContext context) @Nullable ScoreHolderScoreboardNameProvider.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(Identifier 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(Identifier, ObjectArrayList, LootContext)instead.