Class FabricTagProvider.FabricTagBuilder
java.lang.Object
net.minecraft.data.server.tag.TagProvider.ProvidedTagBuilder<T>
net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider.FabricTagBuilder
- Enclosing class:
FabricTagProvider<T>
An extension to
TagProvider.ProvidedTagBuilder
that provides additional functionality.-
Method Summary
Modifier and TypeMethodDescriptionadd
(RegistryKey<T> registryKey) Add an element to the tag.final FabricTagProvider<T>.FabricTagBuilder
add
(RegistryKey<T>... registryKeys) Add multiple elements to this tag.add
(Identifier id) Add a single element to the tag.add
(Identifier... ids) Add multiple elements to this tag.Add an element to the tag.final FabricTagProvider<T>.FabricTagBuilder
Add multiple elements to the tag.addOptional
(RegistryKey<? extends T> registryKey) Add an optionalRegistryKey
to the tag.Add an optionalIdentifier
to the tag.addOptionalTag
(TagKey<T> tag) Add another optional tag to this tag.Add another optional tag to this tag.Add another tag to this tag.forceAddTag
(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.Methods inherited from class net.minecraft.data.server.tag.TagProvider.ProvidedTagBuilder
add
-
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<T>.FabricTagBuilder
instance
-
add
Add an element to the tag.- Returns:
- the
FabricTagProvider<T>.FabricTagBuilder
instance
-
add
Add multiple elements to the tag.- Returns:
- the
FabricTagProvider<T>.FabricTagBuilder
instance
-
add
Add an element to the tag.- Overrides:
add
in classTagProvider.ProvidedTagBuilder<T>
- Returns:
- the
FabricTagProvider<T>.FabricTagBuilder
instance - See Also:
-
add
Add a single element to the tag.- Returns:
- the
FabricTagProvider<T>.FabricTagBuilder
instance
-
addOptional
Add an optionalIdentifier
to the tag.- Overrides:
addOptional
in classTagProvider.ProvidedTagBuilder<T>
- Returns:
- the
FabricTagProvider<T>.FabricTagBuilder
instance
-
addOptional
Add an optionalRegistryKey
to the tag.- Returns:
- the
FabricTagProvider<T>.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.- Overrides:
addTag
in classTagProvider.ProvidedTagBuilder<T>
- Returns:
- the
FabricTagProvider<T>.FabricTagBuilder
instance - See Also:
-
addOptionalTag
Add another optional tag to this tag.- Overrides:
addOptionalTag
in classTagProvider.ProvidedTagBuilder<T>
- Returns:
- the
FabricTagProvider<T>.FabricTagBuilder
instance
-
addOptionalTag
Add another optional tag to this tag.- Returns:
- the
FabricTagProvider<T>.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<T>.FabricTagBuilder
instance
-
add
Add multiple elements to this tag.- Returns:
- the
FabricTagProvider<T>.FabricTagBuilder
instance
-
add
Add multiple elements to this tag.- Overrides:
add
in classTagProvider.ProvidedTagBuilder<T>
- Returns:
- the
FabricTagProvider<T>.FabricTagBuilder
instance
-