TagBuilder

open class TagBuilder<T>

A type-safe tag builder for creating a TagFile.

Unlike the vanilla net.minecraft.tags.TagBuilder, this one also has a setReplace method to set the value of the replace field in the resulting TagFile. It also has additional type-safe methods which enforce the correct type of entries to be added.

Inheritors

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

The current value of the replace field.

Functions

Link copied to clipboard
fun add(key: ResourceKey<T>): TagBuilder<T>
fun add(id: ResourceLocation): TagBuilder<T>

Add an element to this tag.

fun add(entry: TagEntry): TagBuilder<T>

Add a TagEntry to this tag.

Link copied to clipboard
fun addOptional(key: ResourceKey<T>): TagBuilder<T>
fun addOptional(id: ResourceLocation): TagBuilder<T>

Add an optional element to this tag.

Link copied to clipboard
fun addOptionalTag(id: ResourceLocation): TagBuilder<T>
fun addOptionalTag(key: TagKey<T>): TagBuilder<T>

Add another optional tag to this tag.

Link copied to clipboard
fun addTag(id: ResourceLocation): TagBuilder<T>
fun addTag(key: TagKey<T>): TagBuilder<T>

Add another tag to this tag.

Link copied to clipboard
fun build(): TagFile

Build the final TagFile

Link copied to clipboard
fun setReplace(replace: Boolean): TagBuilder<T>

Set the value of the replace field.