Diese Klasse importieren

Link to diese-klasse-importieren

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
Copy
import crafttweaker.api.item.Rarity;

Extending Enum<Rarity>

Link to extending-enumrarity

Rarity extends Enum<Rarity>. That means all methods available in Enum<Rarity> are also available in Rarity

Name: create

Creates a new Rarity with the given name and given color.

Returns: A new Rarity with the given name and color
Return Type: Rarity

ZenScript
Copy
// Rarity.create(name as string, formatting as TextFormatting) as Rarity

Rarity.create("insanely_epic", <formatting:obfucated>);
ParameterTypeBeschreibung
Parameter
name
Type
string
Beschreibung
The name of the new Rarity.
Parameter
formatieren
Type
TextFormatting
Beschreibung
The color of the rarity.

Static Properties

Link to static-properties

NameTypeHas GetterHas SetterBeschreibung
Name
COMMON
Type
Rarity
Has Getter
true
Has Setter
false
Beschreibung
No Description Provided
Name
EPIC
Type
Rarity
Has Getter
true
Has Setter
false
Beschreibung
No Description Provided
Name
RARE
Type
Rarity
Has Getter
true
Has Setter
false
Beschreibung
No Description Provided
Name
UNCOMMON
Type
Rarity
Has Getter
true
Has Setter
false
Beschreibung
No Description Provided

Name: color

Gets the color of this Rarity

Returns: The color of this Rarity.
Return Type: TextFormatting

ZenScript
Copy
// Rarity.color() as TextFormatting

myRarity.color();
NameTypeHas GetterHas SetterBeschreibung
Name
color
Type
TextFormatting
Has Getter
true
Has Setter
false
Beschreibung
Gets the color of this Rarity