Class TagEntry
java.lang.Object
net.minecraft.world.level.storage.loot.entries.LootPoolEntryContainer
net.minecraft.world.level.storage.loot.entries.LootPoolSingletonContainer
net.minecraft.world.level.storage.loot.entries.TagEntry
- All Implemented Interfaces:
ComposableEntryContainer
A loot pool entry container that generates based on an item tag.
If
expand is set to true, it will expand into separate LootPoolEntries for every item in the tag, otherwise it will simply generate all items in the tag.-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.storage.loot.entries.LootPoolSingletonContainer
LootPoolSingletonContainer.Builder<T extends LootPoolSingletonContainer.Builder<T>>, LootPoolSingletonContainer.DummyBuilder, LootPoolSingletonContainer.EntryBase, LootPoolSingletonContainer.EntryConstructor -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<TagEntry> private final booleanFields inherited from class net.minecraft.world.level.storage.loot.entries.LootPoolSingletonContainer
compositeFunction, DEFAULT_QUALITY, DEFAULT_WEIGHT, functions, quality, weightFields inherited from class net.minecraft.world.level.storage.loot.entries.LootPoolEntryContainer
conditionsFields inherited from interface net.minecraft.world.level.storage.loot.entries.ComposableEntryContainer
ALWAYS_FALSE, ALWAYS_TRUE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateTagEntry(TagKey<Item> tag, boolean expand, int weight, int quality, List<LootItemCondition> conditions, List<LootItemFunction> functions) -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateItemStack(Consumer<ItemStack> stackConsumer, LootContext lootContext) Generate the loot stacks of this entry.booleanexpand(LootContext lootContext, Consumer<LootPoolEntry> entryConsumer) Expand this loot pool entry container by callingentryConsumerwith any applicable entriesstatic LootPoolSingletonContainer.Builder<?> private booleanexpandTag(LootContext context, Consumer<LootPoolEntry> generatorConsumer) getType()static LootPoolSingletonContainer.Builder<?> tagContents(TagKey<Item> tag) Methods inherited from class net.minecraft.world.level.storage.loot.entries.LootPoolSingletonContainer
simpleBuilder, singletonFields, validateMethods inherited from class net.minecraft.world.level.storage.loot.entries.LootPoolEntryContainer
canRun, commonFieldsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.level.storage.loot.entries.ComposableEntryContainer
and, or
-
Field Details
-
CODEC
-
tag
-
expand
private final boolean expand
-
-
Constructor Details
-
TagEntry
private TagEntry(TagKey<Item> tag, boolean expand, int weight, int quality, List<LootItemCondition> conditions, List<LootItemFunction> functions)
-
-
Method Details
-
getType
- Specified by:
getTypein classLootPoolEntryContainer
-
createItemStack
Generate the loot stacks of this entry. Contrary to the method name this method does not always generate one stack, it can also generate zero or multiple stacks.- Specified by:
createItemStackin classLootPoolSingletonContainer
-
expandTag
-
expand
Expand this loot pool entry container by callingentryConsumerwith any applicable entries- Specified by:
expandin interfaceComposableEntryContainer- Overrides:
expandin classLootPoolSingletonContainer- Returns:
- whether this loot pool entry container successfully expanded or not
-
tagContents
-
expandTag
-