ITagManager<T : MCTag>
Link to itagmanagert--mctag
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 Copyimport crafttweaker.api.tag.manager.ITagManager;
Interfacce Implementate
Link to interfacce-implementate
ITagManager implements the following interfaces. That means all methods defined in these interfaces are also available in ITagManager
- CommandStringDisplayable
- stdlib.Iterable<T>
- Comparable<ITagManager>
Metodi
Link to metodi
Name: addId
Adds the elements that correspond to the given ResourceLocation to the given tag.
ZenScript Copy// ITagManager.addId(to as T, values as ResourceLocation[])
<tagmanager:items>.addId(<tag:items:minecraft:wool>, <resource:minecraft:diamond>);
Parametro | Tipo | Descrizione |
---|---|---|
Parametro to | Tipo T | Descrizione The tag to add to. |
Parametro values | Tipo ResourceLocation[] | Descrizione The registry key of the elements to add. |
Name: clear
Clears all values of the given tag.
ZenScript Copy// ITagManager.clear(from as T)
<tagmanager:items>.clear(<tag:items:minecraft:wool>);
Parametro | Tipo | Descrizione |
---|---|---|
Parametro from | Tipo T | Descrizione The tag to clear. |
Name: exists
Checks if a tag with the given id exists and is registered.
Returns: true if it exists, false otherwise.
Return Type: boolean
ZenScript Copy// ITagManager.exists(id as ResourceLocation) as boolean
<tagmanager:items>.exists(<resource:minecraft:wool>);
Parametro | Tipo | Descrizione |
---|---|---|
Parametro id | Tipo ResourceLocation | Descrizione The id of the tag to check. |
Name: exists
Checks if a tag with the given id exists and is registered.
Returns: true if it exists, false otherwise.
Return Type: boolean
ZenScript Copy// ITagManager.exists(id as string) as boolean
<tagmanager:items>.exists("minecraft:wool");
Parametro | Tipo | Descrizione |
---|---|---|
Parametro id | Tipo string | Descrizione The id of the tag to check. |
Name: exists
Checks if the given tag exists and is registered.
Returns: true if it exists, false otherwise.
Return Type: boolean
ZenScript Copy// ITagManager.exists(tag as T) as boolean
<tagmanager:items>.exists(<tag:items:minecraft:wool>);
Parametro | Tipo | Descrizione |
---|---|---|
Parametro tag | Tipo T | Descrizione The tag to check. |
Name: getTagsFor
Ges the tags that contain the given element.
Returns: The tags that contain the given elements.
Return Type: stdlib.List<T>
ZenScript CopyITagManager.getTagsFor(element as ResourceLocation) as stdlib.List<T>
Parametro | Tipo |
---|---|
Parametro element | Tipo ResourceLocation |
Name: idElements
Gets the ResourceLocation ids of the elements in the given tag.
Returns: A List of ResourceLocation ids of the elements in the given tag.
Return Type: stdlib.List<ResourceLocation>
ZenScript Copy// ITagManager.idElements(of as T) as stdlib.List<ResourceLocation>
<tagmanager:items>.idElements(<tag:items:minecraft:wool>);
Parametro | Tipo | Descrizione |
---|---|---|
Parametro of | Tipo T | Descrizione The tag to get the elements of. |
Name: removeId
Removes the elements that correspond to the given ResourceLocation from the given tag.
ZenScript Copy// ITagManager.removeId(from as T, values as ResourceLocation[])
<tagmanager:items>.removeId(<tag:items:minecraft:wool>, <resource:minecraft:diamond>);
Parametro | Tipo | Descrizione |
---|---|---|
Parametro from | Tipo T | Descrizione The tag to remove from. |
Parametro values | Tipo ResourceLocation[] | Descrizione The registry key of the elements to remove. |
Name: tag
Gets a tag with the given id.
Returns: A tag with the given id.
Return Type: T
ZenScript Copy// ITagManager.tag(id as ResourceLocation) as T
<tagmanager:items>.tag(<resource:minecraft:wool>);
Parametro | Tipo | Descrizione |
---|---|---|
Parametro id | Tipo ResourceLocation | Descrizione The id of the tag. |
Name: tag
Gets a tag with the given id.
Returns: A tag with the given id.
Return Type: T
ZenScript Copy// ITagManager.tag(id as string) as T
<tagmanager:items>.tag("minecraft:wool");
Parametro | Tipo | Descrizione |
---|---|---|
Parametro id | Tipo string | Descrizione The id of the tag. |
Name: tagFolder
Gets the tagFolder of this manager.
The tag folder is usually the folder on disk without the tags/
prefix.
Examples:
- `tags/items` turns into `items`
- `tags/potion` turns into `potion`
- `tags/worldgen/biome` turns into `worldgen/biome`
Returns: The tag folder of this manager.
Return Type: string
ZenScript Copy// ITagManager.tagFolder() as string
<tagmanager:items>.tagFolder();
Name: tagKeys
Gets the keys of the tags that this manager knows about.
Returns: A List of keys of the tags that this manager knows about.
Return Type: stdlib.List<ResourceLocation>
ZenScript Copy// ITagManager.tagKeys() as stdlib.List<ResourceLocation>
<tagmanager:items>.tagKeys();
Name: tagMap
Gets a map of id to tag that this manager knows about.
Returns: a map of id to tag.
Return Type: T[ResourceLocation]
ZenScript Copy// ITagManager.tagMap() as T[ResourceLocation]
<tagmanager:items>.tagMap();
Name: tags
Ges the tags that this manager knows about.
Returns: The tags that this manager knows about.
Return Type: stdlib.List<T>
ZenScript Copy// ITagManager.tags() as stdlib.List<T>
<tagmanager:items>.tags();
Operators
Link to operators
Name: CONTAINS
Checks if a tag with the given id exists and is registered.
ZenScript Copyid as string in myITagManager
"minecraft:wool" in <tagmanager:items>
Proprietà
Link to proprietà
Nome | Tipo | Ha Getter | Ha Setter | Descrizione |
---|---|---|---|---|
Nome tagFolder | Tipo string | Ha Getter sì | Ha Setter no | Descrizione Gets the tagFolder of this manager. The tag folder is usually the folder on disk without the tags/ prefix. Examples:
|
Nome tagKeys | Tipo stdlib.List<ResourceLocation> | Ha Getter sì | Ha Setter no | Descrizione Gets the keys of the tags that this manager knows about. |
Nome tagMap | Tipo T[ResourceLocation] | Ha Getter sì | Ha Setter no | Descrizione Gets a map of id to tag that this manager knows about. |
Nome tags | Tipo stdlib.List<T> | Ha Getter sì | Ha Setter no | Descrizione Ges the tags that this manager knows about. |