Importing the class

Link to 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.

ZenScript
Copy
import crafttweaker.api.tag.MCTag;

Implemented Interfaces

Link to implemented-interfaces

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

Name: add

Adds the given tags to this tag.

ZenScript
Copy
// MCTag.add(tags as MCTag[])

<tag:item:minecraft:wool>.add(<tag:item:minecraft:wool>);
ParameterTypeDescription
Parameter
tags
Type
MCTag[]
Description
The tags to add.

Name: addId

Adds the elements that correspond to the given ResourceLocation to this tag.

ZenScript
Copy
// MCTag.addId(elements as ResourceLocation[])

<tag:item:minecraft:wool>.addId(<resource:minecraft:diamond>);
ParameterTypeDescription
Parameter
elements
Type
ResourceLocation[]
Description
The registry key of the elements to add.

Name: clear

Removes all elements in this tag.

ZenScript
Copy
// MCTag.clear()

<tag:item:minecraft:wool>.clear();

Name: contains

Checks if this tag contains an element with the given id

Returns: true if it contains the element, false otherwise.
Return Type: boolean

ZenScript
Copy
// MCTag.contains(id as ResourceLocation) as boolean

<tag:item:minecraft:wool>.contains(<resource:minecraft:white_wool>);
ParameterTypeDescription
Parameter
id
Type
ResourceLocation
Description
The ID of the element to check.

Name: equals

Checks if this tag equals the other tag.

Returns: true if the tags are equal, false otherwise.
Return Type: boolean

ZenScript
Copy
// MCTag.equals(other as MCTag) as boolean

<tag:item:minecraft:wool>.equals(<tag:item:minecraft:wool>);
ParameterTypeDescription
Parameter
other
Type
MCTag
Description
The tag to check against.

Name: exists

Checks if this tag exists.

Returns: true if this tag exists, false otherwise.
Return Type: boolean

ZenScript
Copy
// MCTag.exists() as boolean

<tag:item:minecraft:wool>.exists();

Name: id

Gets the id of this tag.

Returns: The id of this tag.
Return Type: ResourceLocation

ZenScript
Copy
// MCTag.id() as ResourceLocation

<tag:item:minecraft:wool>.id();

Name: idElements

Gets the id's of the elements in this tag.

Returns: The id's elements in this tag.
Return Type: stdlib.List<ResourceLocation>

ZenScript
Copy
// MCTag.idElements() as stdlib.List<ResourceLocation>

<tag:item:minecraft:wool>.idElements();

Name: remove

Removes the given tags from this tag.

ZenScript
Copy
// MCTag.remove(tags as MCTag[])

<tag:item:minecraft:wool>.remove(<tag:item:minecraft:wool>);
ParameterTypeDescription
Parameter
tags
Type
MCTag[]
Description
The tags to remove.

Name: removeId

Removes the elements that correspond to the given ResourceLocation from this tag.

ZenScript
Copy
// MCTag.removeId(elements as ResourceLocation[])

<tag:item:minecraft:wool>.removeId(<resource:minecraft:diamond>);
ParameterTypeDescription
Parameter
elements
Type
ResourceLocation[]
Description
The registry key of the elements to remove.

Name: CONTAINS

Checks if this tag contains an element with the given id

ZenScript
Copy
id as ResourceLocation in myMCTag
<resource:minecraft:white_wool> in <tag:item:minecraft:wool>

Name: EQUALS

Checks if this tag equals the other tag.

ZenScript
Copy
myMCTag == other as MCTag
<tag:item:minecraft:wool> == <tag:item:minecraft:wool>
NameTypeHas GetterHas SetterDescription
Name
exists
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks if this tag exists.
Name
id
Type
ResourceLocation
Has Getter
true
Has Setter
false
Description
Gets the id of this tag.
Name
idElements
Type
stdlib.List<ResourceLocation>
Has Getter
true
Has Setter
false
Description
Gets the id's of the elements in this tag.