KnownTagManager<T : Object>
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.
import crafttweaker.api.tag.manager.type.KnownTagManager;
Implemented Interfaces
KnownTagManager implements the following interfaces. That means all methods defined in these interfaces are also available in KnownTagManager
- ITagManager<KnownTag<T>>
Methods
KnownTagManager.addElements(to as KnownTag<T>, values as T[])
Parameter | Type |
---|---|
Parameter to | Type KnownTag<T> |
Parameter values | Type T[] |
Gets the elements of the given tag.
Returns: The list of elements in the tag.
Return Type: stdlib.List<T>
// KnownTagManager.elements(of as KnownTag<T>) as stdlib.List<T>
myKnownTagManager.elements(<tag:items:minecraft:dirt>);
Parameter | Type | Description |
---|---|---|
Parameter of | Type KnownTag<T> | Description The tag to get the elements of. |
Checks if a tag with the given id exists and is registered.
Returns: true if it exists, false otherwise.
Return Type: boolean
// KnownTagManager.exists(id as ResourceLocation) as boolean
myKnownTagManager.exists(<resource:minecraft:wool>);
Parameter | Type | Description |
---|---|---|
Parameter id | Type ResourceLocation | Description The id of the tag to check. |
Checks if a tag with the given id exists and is registered.
Returns: true if it exists, false otherwise.
Return Type: boolean
// KnownTagManager.exists(id as string) as boolean
myKnownTagManager.exists("minecraft:wool");
Parameter | Type | Description |
---|---|---|
Parameter id | Type string | Description The id of the tag to check. |
Checks if the given tag exists and is registered.
Returns: true if it exists, false otherwise.
Return Type: boolean
// KnownTagManager.exists(tag as T) as boolean
myKnownTagManager.exists(<tag:items:minecraft:wool>);
Parameter | Type | Description |
---|---|---|
Parameter tag | Type T | Description The tag to check. |
Ges the tags that contain the given element.
Returns: The tags that contain the given elements.
Return Type: stdlib.List<T>
KnownTagManager.getTagsFor(element as ResourceLocation) as stdlib.List<T>
Parameter | Type |
---|---|
Parameter element | Type ResourceLocation |
Return Type: stdlib.List<KnownTag<T>>
KnownTagManager.getTagsFor(element as T) as stdlib.List<KnownTag<T>>
Parameter | Type |
---|---|
Parameter element | Type T |
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>
// KnownTagManager.idElements(of as T) as stdlib.List<ResourceLocation>
myKnownTagManager.idElements(<tag:items:minecraft:wool>);
Parameter | Type | Description |
---|---|---|
Parameter of | Type T | Description The tag to get the elements of. |
KnownTagManager.removeElements(from as KnownTag<T>, values as T[])
Parameter | Type |
---|---|
Parameter from | Type KnownTag<T> |
Parameter values | Type T[] |
KnownTagManager.removeId(from as KnownTag<T>, values as ResourceLocation[])
Parameter | Type |
---|---|
Parameter from | Type KnownTag<T> |
Parameter values | Type ResourceLocation[] |
Return Type: KnownTag<T>
KnownTagManager.tag(id as ResourceLocation) as KnownTag<T>
Parameter | Type |
---|---|
Parameter id | Type ResourceLocation |
Return Type: KnownTag<T>
KnownTagManager.tag(id as string) as KnownTag<T>
Parameter | Type |
---|---|
Parameter id | Type string |
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
// KnownTagManager.tagFolder() as string
myKnownTagManager.tagFolder();
Return Type: KnownTag<T>[ResourceLocation]
// KnownTagManager.tagMap() as KnownTag<T>[ResourceLocation]
myKnownTagManager.tagMap();
Ges the tags that this manager knows about.
Returns: The tags that this manager knows about.
Return Type: stdlib.List<T>
// KnownTagManager.tags() as stdlib.List<T>
myKnownTagManager.tags();
Operators
Checks if a tag with the given id exists and is registered.
id as string in myKnownTagManager"minecraft:wool" in myKnownTagManager
Properties
Name | Type | Has Getter | Has Setter | Description |
---|---|---|---|---|
Name tagFolder | Type string | Has Getter true | Has Setter false | Description Gets the tagFolder of this manager. The tag folder is usually the folder on disk without the tags/ prefix. Examples:
|
Name tagMap | Type KnownTag<T>[ResourceLocation] | Has Getter true | Has Setter false | Description |
Name tags | Type stdlib.List<T> | Has Getter true | Has Setter false | Description Ges the tags that this manager knows about. |