MCTag<T : Object>
Link to mctagt--object
A reference to a Tag object. Note that this tag may not exist in the game already, such as when you create new tags. See the MCTag<T>#exists() Method on whether this tag already exists.
A tag will be created as soon as you add
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 Copyimport 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
- CommandStringDisplayable
- stdlib.Iterable<T>
Casters
Link to casters
Result type | Is Implicit |
---|---|
Result type Many<MCTag<T>> | Is Implicit true |
Result type string | Is Implicit true |
Methods
Link to methods
Name: add
Adds the given items to the tag. Creates the tag if it does not exist.
Return Type: void
ZenScript CopyMCTag.add(items as stdlib.List<T>) as void
Parameter | Type | Description |
---|---|---|
Parameter items | Type stdlib.List<T> | Description The items to add. Provided as list. |
Name: add
Adds the given items to the tag. Creates the tag if it does not exist.
Return Type: void
ZenScript Copy// MCTag.add(items as T[]) as void
<tag:items:forge:gems>.add(<item:minecraft:bedrock>);
<tag:items:forge:gems>.add(<item:minecraft:iron_ingot>, <item:minecraft:gold_ingot>);
<tag:items:forge:gems>.add([<item:minecraft:iron_ingot>, <item:minecraft:gold_ingot>]);
Parameter | Type | Description |
---|---|---|
Parameter items | Type T[] | Description The items to add. Can be one or more items. |
Name: add
Adds the given tag to this tag. Creates the tag if it does not exist.
Return Type: void
ZenScript Copy// MCTag.add(tag as MCTag<T>) as void
<tag:items:forge:gems>.add(<tag:items:forge:rods>);
Parameter | Type | Description |
---|---|---|
Parameter tag | Type MCTag<T> | Description The tag to add. |
Name: addTags
Adds the given tags to this tag. Creates the tag if it does not exist.
Return Type: void
ZenScript Copy// MCTag.addTags(tags as stdlib.List<MCTag<T>>) as void
<tag:items:forge:gems>.addTags(<tag:items:forge:rods>);
Parameter | Type | Description |
---|---|---|
Parameter tags | Type stdlib.List<MCTag<T>> | Description The tags to add. |
Name: contains
Return Type: boolean
ZenScript CopyMCTag.contains(element as T) as boolean
Parameter | Type | Description |
---|---|---|
Parameter element | Type T | Description No Description Provided |
Name: exists
Return Type: boolean
ZenScript Copy// MCTag.exists() as boolean
<tag:items:forge:gems>.exists();
Name: getElements
Return Type: stdlib.List<T>
ZenScript Copy// MCTag.getElements() as stdlib.List<T>
<tag:items:forge:gems>.getElements();
Name: id
Return Type: ResourceLocation
ZenScript Copy// MCTag.id() as ResourceLocation
<tag:items:forge:gems>.id();
Name: manager
Return Type: ITagManager<T>
ZenScript Copy// MCTag.manager() as ITagManager<T>
<tag:items:forge:gems>.manager();
Name: remove
Return Type: void
ZenScript CopyMCTag.remove(items as stdlib.List<T>) as void
Parameter | Type | Description |
---|---|---|
Parameter items | Type stdlib.List<T> | Description No Description Provided |
Name: remove
Return Type: void
ZenScript CopyMCTag.remove(items as T[]) as void
Parameter | Type | Description |
---|---|---|
Parameter items | Type T[] | Description No Description Provided |
Name: remove
Return Type: void
ZenScript CopyMCTag.remove(tag as MCTag<T>) as void
Parameter | Type | Description |
---|---|---|
Parameter tag | Type MCTag<T> | Description No Description Provided |
Operadores
Link to operadores
Name: CONTAINS
ZenScript Copyelement as T in myMCTag
Name: EQUALS
ZenScript CopymyMCTag == other as MCTag<T>
Name: MUL
ZenScript CopymyMCTag * amount as int
Properties
Link to properties
Nombre | Type | Has Getter | Has Setter | Description |
---|---|---|---|---|
Nombre elements | Type stdlib.List<T> | Has Getter true | Has Setter false | Description No Description Provided |
Nombre exists | Type boolean | Has Getter true | Has Setter false | Description No Description Provided |
Nombre id | Type ResourceLocation | Has Getter true | Has Setter false | Description No Description Provided |
Nombre manager | Type ITagManager<T> | Has Getter true | Has Setter false | Description No Description Provided |