Class FabricTagProvider.FabricTagBuilder<T>
java.lang.Object
net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider.FabricTagBuilder<T>
- Enclosing class:
- FabricTagProvider<T>
An extension to
AbstractTagProvider.ObjectBuilder
that provides additional functionality.-
Method Summary
Modifier and TypeMethodDescriptionadd
(net.minecraft.util.Identifier id) Add a single element to the tag.add
(net.minecraft.util.Identifier... ids) Add multiple elements to this tag.Add a single element to the tag.final FabricTagProvider<T>.FabricTagBuilder<T>
Add multiple elements to this tag.Add a single element to the tag.final FabricTagProvider<T>.FabricTagBuilder<T>
Add multiple elements to this tag.addOptional
(net.minecraft.util.Identifier id) Add an optionalIdentifier
to the tag.addOptional
(net.minecraft.util.registry.RegistryKey<? extends T> registryKey) Add an optionalRegistryKey
to the tag.addOptionalTag
(net.minecraft.tag.TagKey<T> tag) Add another optional tag to this tag.addOptionalTag
(net.minecraft.util.Identifier id) Add another optional tag to this tag.Add another tag to this tag.forceAddTag
(net.minecraft.tag.TagKey<T> tag) Add another tag to this tag, ignoring any warning.setReplace
(boolean replace) Set the value of the `replace` flag in a Tag.
-
Method Details
-
setReplace
Set the value of the `replace` flag in a Tag.When set to true the tag will replace any existing tag entries.
- Returns:
- the
FabricTagProvider.FabricTagBuilder
instance
-
add
Add a single element to the tag.- Returns:
- the
FabricTagProvider.FabricTagBuilder
instance - Throws:
UnsupportedOperationException
- if the provider is an instance ofFabricTagProvider.DynamicRegistryTagProvider
- See Also:
-
add
Add a single element to the tag.- Returns:
- the
FabricTagProvider.FabricTagBuilder
instance
-
add
public FabricTagProvider<T>.FabricTagBuilder<T> add(net.minecraft.util.registry.RegistryKey<? extends T> registryKey) Add a single element to the tag.- Returns:
- the
FabricTagProvider.FabricTagBuilder
instance
-
addOptional
Add an optionalIdentifier
to the tag.- Returns:
- the
FabricTagProvider.FabricTagBuilder
instance
-
addOptional
public FabricTagProvider<T>.FabricTagBuilder<T> addOptional(net.minecraft.util.registry.RegistryKey<? extends T> registryKey) Add an optionalRegistryKey
to the tag.- Returns:
- the
FabricTagProvider.FabricTagBuilder
instance
-
addTag
Add another tag to this tag.Note: any vanilla tags can be added to the builder, but other tags can only be added if it has a builder registered in the same provider.
Use
forceAddTag(TagKey)
to force add any tag.- Returns:
- the
FabricTagProvider.FabricTagBuilder
instance - See Also:
-
BlockTags
EntityTypeTags
FluidTags
GameEventTags
ItemTags
-
addOptionalTag
Add another optional tag to this tag.- Returns:
- the
FabricTagProvider.FabricTagBuilder
instance
-
addOptionalTag
Add another optional tag to this tag.- Returns:
- the
FabricTagProvider.FabricTagBuilder
instance
-
forceAddTag
Add another tag to this tag, ignoring any warning.Note: only use this method if you sure that the tag will be always available at runtime. If not, use
addOptionalTag(Identifier)
instead.- Returns:
- the
FabricTagProvider.FabricTagBuilder
instance
-
add
Add multiple elements to this tag.- Returns:
- the
FabricTagProvider.FabricTagBuilder
instance - Throws:
UnsupportedOperationException
- if the provider is an instance ofFabricTagProvider.DynamicRegistryTagProvider
-
add
Add multiple elements to this tag.- Returns:
- the
FabricTagProvider.FabricTagBuilder
instance
-
add
@SafeVarargs public final FabricTagProvider<T>.FabricTagBuilder<T> add(net.minecraft.util.registry.RegistryKey<T>... registryKeys) Add multiple elements to this tag.- Returns:
- the
FabricTagProvider.FabricTagBuilder
instance
-