Home Commands Examples Getting Started With Scripts Global Keywords
BracketDumpers BracketHandlers BracketValidators ResourceLocationBracketHandler

KnownTagManager

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

script.zs
import crafttweaker.api.tag.manager.type.KnownTagManager;

Implements

KnownTagManager<T> implements the following interfaces:

ITagManager<KnownTag<T>>,CommandStringDisplayable

Undocumented Interfaces

Iterable<MCTag>,Comparable<ITagManager<?>>

Operators

in(id as string) as bool
Checks if a tag with the given id exists and is registered.
script.zs
// ((id as string) in KnownTagManager<T>) as bool
myString in myKnownTagManager

Parameters:

id Type: string - The id of the tag to check.

Return Type: bool

in(id as ResourceLocation) as bool
Checks if a tag with the given id exists and is registered.
script.zs
// ((id as ResourceLocation) in KnownTagManager<T>) as bool
myResourceLocation in myKnownTagManager

Parameters:

id Type: ResourceLocation - The id of the tag to check.

Return Type: bool

in(tag as MCTag) as bool
Checks if the given tag exists and is registered.
script.zs
// ((tag as MCTag) in KnownTagManager<T>) as bool
myT in myKnownTagManager

Parameters:

tag Type: MCTag - The tag to check.

Return Type: bool

Members

addElements(to as KnownTag<T>, values as T[])
script.zs
// KnownTagManager<T>.addElements(to as KnownTag<T>, values as T[]);
myKnownTagManager.addElements(myKnownTag, myT[]);

Parameters:

to Type: KnownTag<T>
values Type: T[]
Getter
Returns the BEP to get this thingy
script.zs
// KnownTagManager<T>.commandString as string
myKnownTagManager.commandString

Return Type: string

commandString() as string
Returns the BEP to get this thingy
script.zs
// KnownTagManager<T>.commandString() as string;
myKnownTagManager.commandString();

Return Type: string

elements(of as KnownTag<T>) as List<T>
Gets the elements of the given tag.

Returns: The list of elements in the tag.

script.zs
// KnownTagManager<T>.elements(of as KnownTag<T>) as List<T>;
myKnownTagManager.elements(<tag:items:minecraft:dirt>);

Parameters:

of Type: KnownTag<T> - The tag to get the elements of.

Return Type: List<T>

exists(id as string) as bool
Checks if a tag with the given id exists and is registered.

Returns: true if it exists, false otherwise.

script.zs
// KnownTagManager<T>.exists(id as string) as bool;
myKnownTagManager.exists("minecraft:wool");

Parameters:

id Type: string - The id of the tag to check.

Return Type: bool

exists(id as ResourceLocation) as bool
Checks if a tag with the given id exists and is registered.

Returns: true if it exists, false otherwise.

script.zs
// KnownTagManager<T>.exists(id as ResourceLocation) as bool;
myKnownTagManager.exists(<resource:minecraft:wool>);

Parameters:

id Type: ResourceLocation - The id of the tag to check.

Return Type: bool

exists(tag as MCTag) as bool
Checks if the given tag exists and is registered.

Returns: true if it exists, false otherwise.

script.zs
// KnownTagManager<T>.exists(tag as MCTag) as bool;
myKnownTagManager.exists(<tag:items:minecraft:wool>);

Parameters:

tag Type: MCTag - The tag to check.

Return Type: bool

getTagsFor(element as T) as List<KnownTag<T>>
script.zs
// KnownTagManager<T>.getTagsFor(element as T) as List<KnownTag<T>>;
myKnownTagManager.getTagsFor(myT);

Parameters:

element Type: T

Return Type: List<KnownTag<T>>

getTagsFor(element as ResourceLocation) as List<MCTag>
Ges the tags that contain the given element.
This method needs to be overriden with a covariant return type and exposed to ZenCode.

Returns: The tags that contain the given elements.

script.zs
// KnownTagManager<T>.getTagsFor(element as ResourceLocation) as List<MCTag>;
myKnownTagManager.getTagsFor(myResourceLocation);

Parameters:

Return Type: List<MCTag>

idElements(of as MCTag) as List<ResourceLocation>
Gets the ResourceLocation ids of the elements in the given tag.

Returns: A List of ResourceLocation ids of the elements in the given tag.

script.zs
// KnownTagManager<T>.idElements(of as MCTag) as List<ResourceLocation>;
myKnownTagManager.idElements(<tag:items:minecraft:wool>);

Parameters:

of Type: MCTag - The tag to get the elements of.

Return Type: List<ResourceLocation>

removeElements(from as KnownTag<T>, values as T[])
script.zs
// KnownTagManager<T>.removeElements(from as KnownTag<T>, values as T[]);
myKnownTagManager.removeElements(myKnownTag, myT[]);

Parameters:

from Type: KnownTag<T>
values Type: T[]
removeId(from as KnownTag<T>, values as ResourceLocation[])
script.zs
// KnownTagManager<T>.removeId(from as KnownTag<T>, values as ResourceLocation[]);
myKnownTagManager.removeId(myKnownTag, myResourceLocation[]);

Parameters:

from Type: KnownTag<T>
tag(id as string) as KnownTag<T>
script.zs
// KnownTagManager<T>.tag(id as string) as KnownTag<T>;
myKnownTagManager.tag(myString);

Parameters:

id Type: string

Return Type: KnownTag<T>

tag(id as ResourceLocation) as KnownTag<T>
script.zs
// KnownTagManager<T>.tag(id as ResourceLocation) as KnownTag<T>;
myKnownTagManager.tag(myResourceLocation);

Parameters:

Return Type: KnownTag<T>

Getter
Gets the tagFolder of this manager.

The tag folder is usually the folder on disk without the tags/ prefix.


Examples:



  1. tags/items turns into items

  2. tags/potion turns into potion

  3. tags/worldgen/biome turns into worldgen/biome
script.zs
// KnownTagManager<T>.tagFolder as string
myKnownTagManager.tagFolder

Return Type: string

tagFolder() as string
Gets the tagFolder of this manager.

The tag folder is usually the folder on disk without the tags/ prefix.


Examples:



  1. tags/items turns into items

  2. tags/potion turns into potion

  3. tags/worldgen/biome turns into worldgen/biome

Returns: The tag folder of this manager.

script.zs
// KnownTagManager<T>.tagFolder() as string;
myKnownTagManager.tagFolder();

Return Type: string

Getter
script.zs
// KnownTagManager<T>.tagMap as KnownTag<T>[ResourceLocation]
myKnownTagManager.tagMap

Return Type: KnownTag<T>[ResourceLocation]

tagMap() as KnownTag<T>[ResourceLocation]
script.zs
// KnownTagManager<T>.tagMap() as KnownTag<T>[ResourceLocation];
myKnownTagManager.tagMap();

Return Type: KnownTag<T>[ResourceLocation]

Getter
Ges the tags that this manager knows about.
This method needs to be overriden with a covariant return type and exposed to ZenCode.
script.zs
// KnownTagManager<T>.tags as List<MCTag>
myKnownTagManager.tags

Return Type: List<MCTag>

tags() as List<MCTag>
Ges the tags that this manager knows about.
This method needs to be overriden with a covariant return type and exposed to ZenCode.

Returns: The tags that this manager knows about.

script.zs
// KnownTagManager<T>.tags() as List<MCTag>;
myKnownTagManager.tags();

Return Type: List<MCTag>