UnknownTag
An unknown tag is a tag whose element is not known or has not been registered as Taggable.
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.type.UnknownTag;Implemented Interfaces
UnknownTag implements the following interfaces. That means all methods defined in these interfaces are also available in UnknownTag
Casters
| Result Type | Is Implicit |
|---|---|
Result Type Many<UnknownTag> | Is Implicit true |
Result Type string | Is Implicit true |
Methods
Adds the given tags to this tag.
// UnknownTag.add(tags as MCTag[])
myUnknownTag.add(<tag:items:minecraft:wool>);| Parameter | Type | Description |
|---|---|---|
Parameter tags | Type MCTag[] | Description The tags to add. |
Adds the elements that correspond to the given ResourceLocation to this tag.
// UnknownTag.addId(elements as ResourceLocation[])
myUnknownTag.addId(<resource:minecraft:diamond>);| Parameter | Type | Description |
|---|---|---|
Parameter elements | Type ResourceLocation[] | Description The registry key of the elements to add. |
Return Type: Many<UnknownTag>
// UnknownTag.asTagWithAmount() as Many<UnknownTag>
myUnknownTag.asTagWithAmount();Removes all elements in this tag.
// UnknownTag.clear()
myUnknownTag.clear();Checks if this tag contains an element with the given id
Returns: true if it contains the element, false otherwise.
Return Type: boolean
// UnknownTag.contains(id as ResourceLocation) as boolean
myUnknownTag.contains(<resource:minecraft:white_wool>);| Parameter | Type | Description |
|---|---|---|
Parameter id | Type ResourceLocation | Description The ID of the element to check. |
Checks if this tag equals the other tag.
Returns: true if the tags are equal, false otherwise.
Return Type: boolean
// UnknownTag.equals(other as MCTag) as boolean
myUnknownTag.equals(<tag:items:minecraft:wool>);| Parameter | Type | Description |
|---|---|---|
Parameter other | Type MCTag | Description The tag to check against. |
Checks if this tag exists.
Returns: true if this tag exists, false otherwise.
Return Type: boolean
// UnknownTag.exists() as boolean
myUnknownTag.exists();Return Type: ResourceLocation
// UnknownTag.id() as ResourceLocation
myUnknownTag.id();Gets the id’s of the elements in this tag.
Returns: The id’s elements in this tag.
Return Type: stdlib.List<ResourceLocation>
// UnknownTag.idElements() as stdlib.List<ResourceLocation>
myUnknownTag.idElements();Return Type: UnknownTagManager
// UnknownTag.manager() as UnknownTagManager
myUnknownTag.manager();Removes the given tags from this tag.
// UnknownTag.remove(tags as MCTag[])
myUnknownTag.remove(<tag:items:minecraft:wool>);| Parameter | Type | Description |
|---|---|---|
Parameter tags | Type MCTag[] | Description The tags to remove. |
Removes the elements that correspond to the given ResourceLocation from this tag.
// UnknownTag.removeId(elements as ResourceLocation[])
myUnknownTag.removeId(<resource:minecraft:diamond>);| Parameter | Type | Description |
|---|---|---|
Parameter elements | Type ResourceLocation[] | Description The registry key of the elements to remove. |
Return Type: Many<UnknownTag>
UnknownTag.withAmount(amount as int) as Many<UnknownTag>| Parameter | Type |
|---|---|
Parameter amount | Type int |
Operators
Checks if this tag contains an element with the given id
id as ResourceLocation in myUnknownTag<resource:minecraft:white_wool> in myUnknownTagChecks if this tag equals the other tag.
myUnknownTag == other as MCTagmyUnknownTag == <tag:items:minecraft:wool>myUnknownTag * amount as intProperties
| Name | Type | Has Getter | Has Setter | Description |
|---|---|---|---|---|
Name exists | Type boolean | Has Getter true | Has Setter false | Description Checks if this tag exists. |
Name id | Type ResourceLocation | Has Getter true | Has Setter false | Description |
Name idElements | Type stdlib.List<ResourceLocation> | Has Getter true | Has Setter false | Description Gets the id’s of the elements in this tag. |
Name manager | Type UnknownTagManager | Has Getter true | Has Setter false | Description |