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 or not this tag already exists.

A tag will be created as soon as you add

Importare la Classe

Link to importare-la-classe

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;

Interfacce Implementate

Link to interfacce-implementate

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

Tipo RisultatoImplicito
Tipo Risultato
MCTagWithAmount<T>
Implicito
Tipo Risultato
string
Implicito

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 stdlib.List<T>) as void
ParametroTipoDescrizione
Parametro
items
Tipo
stdlib.List<T>
Descrizione
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>]);
ParametroTipoDescrizione
Parametro
items
Tipo
T[]
Descrizione
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>);
ParametroTipoDescrizione
Parametro
tag
Tipo
MCTag<T>
Descrizione
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>);
ParametroTipoDescrizione
Parametro
tags
Tipo
stdlib.List<MCTag<T>>
Descrizione
The tags to add.

Name: asTagWithAmount

Return Type: MCTagWithAmount<T>

ZenScript
Copy
// MCTag.asTagWithAmount() as MCTagWithAmount<T>

<tag:items:forge:gems>.asTagWithAmount();

Name: contains

Return Type: boolean

ZenScript
Copy
MCTag.contains(element as T) as boolean
ParametroTipoDescrizione
Parametro
element
Tipo
T
Descrizione
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: getId

Return Type: MCResourceLocation

ZenScript
Copy
// MCTag.getId() as MCResourceLocation

<tag:items:forge:gems>.getId();

Name: getManager

Return Type: TagManager<T>

ZenScript
Copy
// MCTag.getManager() as TagManager<T>

<tag:items:forge:gems>.getManager();

Name: remove

Return Type: void

ZenScript
Copy
MCTag.remove(items as stdlib.List<T>) as void
ParametroTipoDescrizione
Parametro
items
Tipo
stdlib.List<T>
Descrizione
No Description Provided

Name: remove

Return Type: void

ZenScript
Copy
MCTag.remove(items as T[]) as void
ParametroTipoDescrizione
Parametro
items
Tipo
T[]
Descrizione
No Description Provided

Name: remove

Return Type: void

ZenScript
Copy
MCTag.remove(tag as MCTag<T>) as void
ParametroTipoDescrizione
Parametro
tag
Tipo
MCTag<T>
Descrizione
No Description Provided

Name: withAmount

Return Type: MCTagWithAmount<T>

ZenScript
Copy
MCTag.withAmount(amount as int) as MCTagWithAmount<T>
ParametroTipoDescrizione
Parametro
amount
Tipo
int
Descrizione
No Description Provided

Name: CONTAINS

ZenScript
Copy
element as T in myMCTag

Name: EQUALS

ZenScript
Copy
myMCTag == other as MCTag<T>

Name: MUL

ZenScript
Copy
myMCTag * amount as int
NomeTipoHa GetterHa SetterDescrizione
Nome
elements
Tipo
stdlib.List<T>
Ha Getter
Ha Setter
no
Descrizione
No Description Provided
Nome
exists
Tipo
boolean
Ha Getter
Ha Setter
no
Descrizione
No Description Provided
Nome
id
Tipo
MCResourceLocation
Ha Getter
Ha Setter
no
Descrizione
No Description Provided
Nome
manager
Tipo
TagManager<T>
Ha Getter
Ha Setter
no
Descrizione
No Description Provided