Home Commands Examples Getting Started With Scripts Global Keywords
BracketDumpers BracketHandlers BracketValidators ResourceLocationBracketHandler

UnknownTag

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.

script.zs
import crafttweaker.api.tag.type.UnknownTag;

Description

An unknown tag is a tag whose element is not known or has not been registered as Taggable.
Modders should use MCTag instead of this class for parameters as a previously unknown tag could become a known tag in the future..

Loaders

This type is available in the following loaders:

  • crafttweaker
  • tags

Implements

UnknownTag implements the following interfaces:

MCTag,CommandStringDisplayable

Undocumented Interfaces

Comparable<MCTag>

Operators

in(id as ResourceLocation) as bool
Checks if this tag contains an element with the given id
script.zs
// ((id as ResourceLocation) in UnknownTag) as bool
myResourceLocation in myUnknownTag

Parameters:

id Type: ResourceLocation - The ID of the element to check.

Return Type: bool

==(other as MCTag) as bool
Checks if this tag equals the other tag.
script.zs
// (UnknownTag == (other as MCTag)) as bool
myUnknownTag == myMCTag

Parameters:

other Type: MCTag - The tag to check against.

Return Type: bool

*(amount as int) as Many<UnknownTag>
script.zs
// (UnknownTag * (amount as int)) as Many<UnknownTag>
myUnknownTag * myInt

Parameters:

amount Type: int

Return Type: Many<UnknownTag>

Members

add(tags as MCTag[])
Adds the given tags to this tag.
script.zs
// UnknownTag.add(tags as MCTag[]);
myUnknownTag.add(<tag:items:minecraft:wool>);

Parameters:

tags Type: MCTag[] - The tags to add.
addId(elements as ResourceLocation[])
Adds the elements that correspond to the given ResourceLocation to this tag.
script.zs
// UnknownTag.addId(elements as ResourceLocation[]);
myUnknownTag.addId(<resource:minecraft:diamond>);

Parameters:

elements Type: ResourceLocation[] - The registry key of the elements to add.
asTagWithAmount() as Many<UnknownTag>
script.zs
// UnknownTag.asTagWithAmount() as Many<UnknownTag>;
myUnknownTag.asTagWithAmount();

Return Type: Many<UnknownTag>

implicit as Many<UnknownTag>
script.zs
// UnknownTag as Many<UnknownTag>
myUnknownTag as Many<UnknownTag>

Return Type: Many<UnknownTag>

clear()
Removes all elements in this tag.
script.zs
// UnknownTag.clear();
myUnknownTag.clear();
Getter
Returns the BEP to get this thingy
script.zs
// UnknownTag.commandString as string
myUnknownTag.commandString

Return Type: string

commandString() as string
Returns the BEP to get this thingy
script.zs
// UnknownTag.commandString() as string;
myUnknownTag.commandString();

Return Type: string

contains(id as ResourceLocation) as bool
Checks if this tag contains an element with the given id

Returns: true if it contains the element, false otherwise.

script.zs
// UnknownTag.contains(id as ResourceLocation) as bool;
myUnknownTag.contains(<resource:minecraft:white_wool>);

Parameters:

id Type: ResourceLocation - The ID of the element to check.

Return Type: bool

equals(other as MCTag) as bool
Checks if this tag equals the other tag.

Returns: true if the tags are equal, false otherwise.

script.zs
// UnknownTag.equals(other as MCTag) as bool;
myUnknownTag.equals(<tag:items:minecraft:wool>);

Parameters:

other Type: MCTag - The tag to check against.

Return Type: bool

Getter
Checks if this tag exists.
script.zs
// UnknownTag.exists as bool
myUnknownTag.exists

Return Type: bool

exists() as bool
Checks if this tag exists.

Returns: true if this tag exists, false otherwise.

script.zs
// UnknownTag.exists() as bool;
myUnknownTag.exists();

Return Type: bool

Getter
script.zs
// UnknownTag.id as ResourceLocation
myUnknownTag.id

Return Type: ResourceLocation

id() as ResourceLocation
script.zs
// UnknownTag.id() as ResourceLocation;
myUnknownTag.id();

Return Type: ResourceLocation

Getter
Gets the id's of the elements in this tag.
script.zs
// UnknownTag.idElements as List<ResourceLocation>
myUnknownTag.idElements

Return Type: List<ResourceLocation>

idElements() as List<ResourceLocation>
Gets the id's of the elements in this tag.

Returns: The id's elements in this tag.

script.zs
// UnknownTag.idElements() as List<ResourceLocation>;
myUnknownTag.idElements();

Return Type: List<ResourceLocation>

Getter
script.zs
// UnknownTag.manager as UnknownTagManager
myUnknownTag.manager

Return Type: UnknownTagManager

manager() as UnknownTagManager
script.zs
// UnknownTag.manager() as UnknownTagManager;
myUnknownTag.manager();

Return Type: UnknownTagManager

remove(tags as MCTag[])
Removes the given tags from this tag.
script.zs
// UnknownTag.remove(tags as MCTag[]);
myUnknownTag.remove(<tag:items:minecraft:wool>);

Parameters:

tags Type: MCTag[] - The tags to remove.
removeId(elements as ResourceLocation[])
Removes the elements that correspond to the given ResourceLocation from this tag.
script.zs
// UnknownTag.removeId(elements as ResourceLocation[]);
myUnknownTag.removeId(<resource:minecraft:diamond>);

Parameters:

elements Type: ResourceLocation[] - The registry key of the elements to remove.
implicit as string
script.zs
// UnknownTag as string
myUnknownTag as string

Return Type: string

withAmount(amount as int) as Many<UnknownTag>
script.zs
// UnknownTag.withAmount(amount as int) as Many<UnknownTag>;
myUnknownTag.withAmount(myInt);

Parameters:

amount Type: int

Return Type: Many<UnknownTag>