Home Migration Guide Getting Started With Scripts Commands Examples
BracketHandlers

TagManagerFluid

Importing the class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

script.zs
import crafttweaker.api.tag.TagManagerFluid;

Implemented Interfaces

TagManagerFluid implements the following interfaces. That means all methods defined in these interfaces are also available in TagManagerFluid

Methods

Checks if a tag already exists. Does the same as calling .exists on a tag directly

Returns: Whether or not this tag already exists
Return Type: boolean

script.zs
TagManagerFluid.exists(location as MCResourceLocation) as boolean
ParameterTypeDescription
Parameter
location
Type
MCResourceLocation
Description
The resource location to check for

Checks if a tag already exists. Does the same as calling .exists on a tag directly

Returns: Whether or not this tag already exists
Return Type: boolean

script.zs
TagManagerFluid.exists(name as string) as boolean
ParameterTypeDescription
Parameter
name
Type
string
Description
The resource location to check for

Retrieves a list of all tags currently registered.

Return Type: stdlib.List<MCTag<T>>

script.zs
// TagManagerFluid.getAllTags() as stdlib.List<MCTag<T>>
myTagManagerFluid.getAllTags();

Retrieves a tag by its name. Will also be called by the BEP.

Note that this method does not yet create the tag if it does not exist. Adding something to the object created by this tag will create it for the game.

Returns: A Tag object.
Return Type: MCTag<T>

script.zs
TagManagerFluid.getTag(location as MCResourceLocation) as MCTag<T>
ParameterTypeDescription
Parameter
location
Type
MCResourceLocation
Description
The Resource location of the tag

Retrieves a tag by its name. Will also be called by the BEP.

Note that this method does not yet create the tag if it does not exist. Adding something to the object created by this tag will create it for the game.

Returns: A Tag object.
Return Type: MCTag<T>

script.zs
TagManagerFluid.getTag(name as string) as MCTag<T>
ParameterTypeDescription
Parameter
name
Type
string
Description
The Resource location of the tag

Operators

Checks if a tag already exists. Does the same as calling .exists on a tag directly

script.zs
name as string in myTagManagerFluid

Properties

NameTypeHas GetterHas SetterDescription
Name
all
Type
stdlib.List<MCTag<T>>
Has Getter
true
Has Setter
false
Description
Retrieves a list of all tags currently registered.