KnownTag<T : Object>
Link to knowntagt--object
A known tag is a tag whose element is known and has been registered as Taggable.
Known tags let you use the actual element to interact with the tag instead of using the registry key of the element
Импорт класса
Link to импорт-класса
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.type.KnownTag;
Implemented Interfaces
Link to implemented-interfaces
KnownTag implements the following interfaces. That means all methods defined in these interfaces are also available in KnownTag
- MCTag
- stdlib.Iterable<T>
Утилиты
Link to утилиты
Result Type | Является неявным |
---|---|
Result Type Many<KnownTag<T>> | Является неявным true |
Result Type string | Является неявным true |
Методы
Link to методы
Name: add
ZenScript CopyKnownTag.add(elements as T[])
Параметр | Тип |
---|---|
Параметр elements | Тип T[] |
Name: add
Adds the given tags to this tag.
ZenScript Copy// KnownTag.add(tags as MCTag[])
myKnownTag.add(<tag:items:minecraft:wool>);
Параметр | Тип | Описание |
---|---|---|
Параметр tags | Тип MCTag[] | Описание The tags to add. |
Name: addId
Adds the elements that correspond to the given ResourceLocation to this tag.
ZenScript Copy// KnownTag.addId(elements as ResourceLocation[])
myKnownTag.addId(<resource:minecraft:diamond>);
Параметр | Тип | Описание |
---|---|---|
Параметр elements | Тип ResourceLocation[] | Описание The registry key of the elements to add. |
Name: clear
Removes all elements in this tag.
ZenScript Copy// KnownTag.clear()
myKnownTag.clear();
Name: contains
Return Type: boolean
ZenScript CopyKnownTag.contains(element as T) as boolean
Параметр | Тип |
---|---|
Параметр element | Тип T |
Name: contains
Checks if this tag contains an element with the given id
Returns: true if it contains the element, false otherwise.
Return Type: boolean
ZenScript Copy// KnownTag.contains(id as ResourceLocation) as boolean
myKnownTag.contains(<resource:minecraft:white_wool>);
Параметр | Тип | Описание |
---|---|---|
Параметр id | Тип ResourceLocation | Описание The ID of the element to check. |
Name: elements
Return Type: stdlib.List<T>
ZenScript Copy// KnownTag.elements() as stdlib.List<T>
myKnownTag.elements();
Name: equals
Checks if this tag equals the other tag.
Returns: true if the tags are equal, false otherwise.
Return Type: boolean
ZenScript Copy// KnownTag.equals(other as MCTag) as boolean
myKnownTag.equals(<tag:items:minecraft:wool>);
Параметр | Тип | Описание |
---|---|---|
Параметр other | Тип MCTag | Описание The tag to check against. |
Name: exists
Checks if this tag exists.
Returns: true if this tag exists, false otherwise.
Return Type: boolean
ZenScript Copy// KnownTag.exists() as boolean
myKnownTag.exists();
Name: id
Return Type: ResourceLocation
ZenScript Copy// KnownTag.id() as ResourceLocation
myKnownTag.id();
Name: idElements
Gets the id's of the elements in this tag.
Returns: The id's elements in this tag.
Return Type: stdlib.List<ResourceLocation>
ZenScript Copy// KnownTag.idElements() as stdlib.List<ResourceLocation>
myKnownTag.idElements();
Name: manager
Return Type: KnownTagManager<T>
ZenScript Copy// KnownTag.manager() as KnownTagManager<T>
myKnownTag.manager();
Name: remove
ZenScript CopyKnownTag.remove(elements as T[])
Параметр | Тип |
---|---|
Параметр elements | Тип T[] |
Name: remove
Removes the given tags from this tag.
ZenScript Copy// KnownTag.remove(tags as MCTag[])
myKnownTag.remove(<tag:items:minecraft:wool>);
Параметр | Тип | Описание |
---|---|---|
Параметр tags | Тип MCTag[] | Описание The tags to remove. |
Name: removeId
Removes the elements that correspond to the given ResourceLocation from this tag.
ZenScript Copy// KnownTag.removeId(elements as ResourceLocation[])
myKnownTag.removeId(<resource:minecraft:diamond>);
Параметр | Тип | Описание |
---|---|---|
Параметр elements | Тип ResourceLocation[] | Описание The registry key of the elements to remove. |
Операторы
Link to операторы
Name: CONTAINS
Checks if this tag contains an element with the given id
ZenScript Copyid as ResourceLocation in myKnownTag
<resource:minecraft:white_wool> in myKnownTag
Name: EQUALS
Checks if this tag equals the other tag.
ZenScript CopymyKnownTag == other as MCTag
myKnownTag == <tag:items:minecraft:wool>
Name: MUL
ZenScript CopymyKnownTag * amount as int
Свойства
Link to свойства
Название | Тип | Имеет Getter | Имеет Setter | Описание |
---|---|---|---|---|
Название elements | Тип stdlib.List<T> | Имеет Getter true | Имеет Setter false | Описание |
Название exists | Тип boolean | Имеет Getter true | Имеет Setter false | Описание Checks if this tag exists. |
Название id | Тип ResourceLocation | Имеет Getter true | Имеет Setter false | Описание |
Название idElements | Тип stdlib.List<ResourceLocation> | Имеет Getter true | Имеет Setter false | Описание Gets the id's of the elements in this tag. |
Название manager | Тип KnownTagManager<T> | Имеет Getter true | Имеет Setter false | Описание |