KnownTag
Importing the class
If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.
import crafttweaker.api.tag.type.KnownTag;
Description
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
Implements
KnownTag<T>
implements the following interfaces:
MCTag
,CommandStringDisplayable
Undocumented Interfaces
Iterable<T>
,Comparable<MCTag>
Operators
// ((element as T) in KnownTag<T>) as boolmyT in myKnownTag
Parameters:
element: T
Type: T
Return Type:
bool
Members
// KnownTag<T>.add(elements as T[]);myKnownTag.add(myT[]);
Parameters:
elements: T[]
Type: T[]
ResourceLocation
to this tag.myKnownTag.addId(<resource:minecraft:diamond>);
Parameters:
// KnownTag<T>.clear();myKnownTag.clear();
// KnownTag<T>.commandString as stringmyKnownTag.commandString
Return Type:
string
// KnownTag<T>.commandString() as string;myKnownTag.commandString();
Return Type:
string
// KnownTag<T>.contains(element as T) as bool;myKnownTag.contains(myT);
Parameters:
element: T
Type: T
Return Type:
bool
Returns: true if it contains the element, false otherwise.
myKnownTag.contains(<resource:minecraft:white_wool>);
Parameters:
Return Type:
bool
// KnownTag<T>.elements as List<T>myKnownTag.elements
Return Type:
List<T>
// KnownTag<T>.elements() as List<T>;myKnownTag.elements();
Return Type:
List<T>
// KnownTag<T>.exists as boolmyKnownTag.exists
Return Type:
bool
Returns: true if this tag exists, false otherwise.
// KnownTag<T>.exists() as bool;myKnownTag.exists();
Return Type:
bool
// KnownTag<T>.id as ResourceLocationmyKnownTag.id
Return Type:
ResourceLocation
myKnownTag.idElements
Return Type:
List<ResourceLocation>
Returns: The id's elements in this tag.
myKnownTag.idElements();
Return Type:
List<ResourceLocation>
myKnownTag.manager
Return Type:
KnownTagManager<T>
// KnownTag<T>.remove(elements as T[]);myKnownTag.remove(myT[]);
Parameters:
elements: T[]
Type: T[]
ResourceLocation
from this tag.myKnownTag.removeId(<resource:minecraft:diamond>);
Parameters:
// KnownTag<T> as stringmyKnownTag as string
Return Type:
string