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

Rarity

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.item.property.Rarity;

Implements

Undocumented Interfaces

IExtensibleEnum,Comparable<Enum>

Enum Constants

Rarity is an enum with 4 constants. They are accessible like so:

script.zs
// Rarity.COMMON
<constant:minecraft:item/rarity:common>
// Rarity.EPIC
<constant:minecraft:item/rarity:epic>
// Rarity.RARE
<constant:minecraft:item/rarity:rare>
// Rarity.UNCOMMON
<constant:minecraft:item/rarity:uncommon>

Members

Getter
Gets the color of this Rarity
script.zs
// Rarity.color as ChatFormatting
<constant:minecraft:item/rarity:common>.color

Return Type: ChatFormatting

color() as ChatFormatting
Gets the color of this Rarity

Returns: The color of this Rarity.

script.zs
// Rarity.color() as ChatFormatting;
<constant:minecraft:item/rarity:common>.color();

Return Type: ChatFormatting