ITagManager<T : Object>
Link to itagmanagert--object
TagManagers are used to handle the different types of Tags within the game. They can be retrieved directly with the ITagManager BEP, and are also used indirectly when creating a tag with the Tag BEP.
Diese Klasse importieren
Link to diese-klasse-importieren
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.ITagManager;
Implemented Interfaces
Link to implemented-interfaces
ITagManager implements the following interfaces. That means all methods defined in these interfaces are also available in ITagManager
Methoden
Link to methoden
Name: exists
Checks if a tag already exists. Does the same as calling .exists
on a tag directly
Returns: Whether this tag already exists
Return Type: boolean
ZenScript CopyITagManager.exists(location as ResourceLocation) as boolean
Parameter | Type | Beschreibung |
---|---|---|
Parameter standort | Type ResourceLocation | Beschreibung The resource location to check for |
Name: exists
Checks if a tag already exists. Does the same as calling .exists
on a tag directly
Returns: Whether or not this tag already exists
Return Type: boolean
ZenScript CopyITagManager.exists(name as string) as boolean
Parameter | Type | Beschreibung |
---|---|---|
Parameter name | Type string | Beschreibung The resource location to check for |
Name: getAllTags
Retrieves a list of all tags currently registered.
Return Type: stdlib.List<MCTag<T>>
ZenScript Copy// ITagManager.getAllTags() as stdlib.List<MCTag<T>>
myITagManager.getAllTags();
Name: getAllTagsFor
Retrieves all tags contain the provided element
Return Type: stdlib.List<MCTag<T>>
ZenScript CopyITagManager.getAllTagsFor(element as T) as stdlib.List<MCTag<T>>
Parameter | Type | Beschreibung |
---|---|---|
Parameter element | Type T | Beschreibung The element whose tags should be returned |
Name: getTag
Retrieves a tag by its name. Will also be called by the BEP.
Note that this method does not yet create the tag if it does not exist. Adding something to the object created by this tag will create it for the game.
Returns: A Tag object.
Return Type: MCTag<T>
ZenScript CopyITagManager.getTag(location as ResourceLocation) as MCTag<T>
Parameter | Type | Beschreibung |
---|---|---|
Parameter standort | Type ResourceLocation | Beschreibung The Resource location of the tag |
Name: getTag
Retrieves a tag by its name. Will also be called by the BEP.
Note that this method does not yet create the tag if it does not exist. Adding something to the object created by this tag will create it for the game.
Returns: A Tag object.
Return Type: MCTag<T>
ZenScript CopyITagManager.getTag(name as string) as MCTag<T>
Parameter | Type | Beschreibung |
---|---|---|
Parameter name | Type string | Beschreibung The Resource location of the tag |
Name: getTagFolder
Get the tag type. In a Bracket call, this will used to determine which ITagManager to use.
<tag:{tag_type
:tag_location:tag_name>}
<tagManager:{tag_type
>}
Return Type: string
ZenScript Copy// ITagManager.getTagFolder() as string
myITagManager.getTagFolder();
Operatoren
Link to operatoren
Name: CONTAINS
Checks if a tag already exists. Does the same as calling .exists
on a tag directly
ZenScript Copyname as string in myITagManager
Properties
Link to properties
Name | Type | Has Getter | Has Setter | Beschreibung |
---|---|---|---|---|
Name all | Type stdlib.List<MCTag<T>> | Has Getter true | Has Setter false | Beschreibung Retrieves a list of all tags currently registered. |
Name tagType | Type string | Has Getter true | Has Setter false | Beschreibung Get the tag type. In a Bracket call, this will used to determine which ITagManager to use. <tag:{tag_type :tag_location:tag_name>} <tagManager:{tag_type >} |