Difficulty
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.world.Difficulty;
Implements
Difficulty
implements the following interfaces:
Undocumented Interfaces
Comparable<Enum>
Enum Constants
Difficulty is an enum with 4 constants. They are accessible like so:
// Difficulty.EASY<constant:minecraft:world/difficulty:easy>// Difficulty.HARD<constant:minecraft:world/difficulty:hard>// Difficulty.NORMAL<constant:minecraft:world/difficulty:normal>// Difficulty.PEACEFUL<constant:minecraft:world/difficulty:peaceful>
Members
Getter
// Difficulty.id as int<constant:minecraft:world/difficulty:easy>.id
Return Type:
int
id() as int
// Difficulty.id() as int;<constant:minecraft:world/difficulty:easy>.id();
Return Type:
int
Getter
// Difficulty.key as string<constant:minecraft:world/difficulty:easy>.key
Return Type:
string
key() as string
// Difficulty.key() as string;<constant:minecraft:world/difficulty:easy>.key();
Return Type:
string
Getter
Gets the serialized name.script.zs
// Difficulty.serializedName as string<constant:minecraft:world/difficulty:easy>.serializedName
Return Type:
string
serializedName() as string
Gets the serialized name.script.zs
Returns: the serialized name.
// Difficulty.serializedName() as string;<constant:minecraft:world/difficulty:easy>.serializedName();
Return Type:
string