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

MobCategory

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.entity.MobCategory;

Implements

MobCategory implements the following interfaces:

StringRepresentable

Undocumented Interfaces

IExtensibleEnum,Comparable<Enum>

Enum Constants

MobCategory is an enum with 8 constants. They are accessible like so:

script.zs
// MobCategory.AMBIENT
<constant:minecraft:mobcategory:ambient>
// MobCategory.AXOLOTLS
<constant:minecraft:mobcategory:axolotls>
// MobCategory.CREATURE
<constant:minecraft:mobcategory:creature>
// MobCategory.MISC
<constant:minecraft:mobcategory:misc>
// MobCategory.MONSTER
<constant:minecraft:mobcategory:monster>
// MobCategory.UNDERGROUND_WATER_CREATURE
<constant:minecraft:mobcategory:underground_water_creature>
// MobCategory.WATER_AMBIENT
<constant:minecraft:mobcategory:water_ambient>
// MobCategory.WATER_CREATURE
<constant:minecraft:mobcategory:water_creature>

Members

Getter
Gets the despawn distance of the mob category.
script.zs
// MobCategory.despawnDistance as int
<constant:minecraft:mobcategory:ambient>.despawnDistance

Return Type: int

despawnDistance() as int
Gets the despawn distance of the mob category.

Returns: The despawn distance of the mob category.

script.zs
// MobCategory.despawnDistance() as int;
<constant:minecraft:mobcategory:ambient>.despawnDistance();

Return Type: int

Getter
Checks if the mob category is friendly.
script.zs
// MobCategory.friendly as bool
<constant:minecraft:mobcategory:ambient>.friendly

Return Type: bool

friendly() as bool
Checks if the mob category is friendly.

Returns: True if the mob category is friendly.

script.zs
// MobCategory.friendly() as bool;
<constant:minecraft:mobcategory:ambient>.friendly();

Return Type: bool

getName() as string
Gets the name of the mob category.

Returns: The name of the mob category.

script.zs
// MobCategory.getName() as string;
<constant:minecraft:mobcategory:ambient>.getName();

Return Type: string

Getter
Gets the maximum number of instances per chunk.
script.zs
// MobCategory.maxInstancesPerChunk as int
<constant:minecraft:mobcategory:ambient>.maxInstancesPerChunk

Return Type: int

maxInstancesPerChunk() as int
Gets the maximum number of instances per chunk.

Returns: The maximum number of instances per chunk.

script.zs
// MobCategory.maxInstancesPerChunk() as int;
<constant:minecraft:mobcategory:ambient>.maxInstancesPerChunk();

Return Type: int

Getter
Gets the no despawn distance of the mob category.
script.zs
// MobCategory.noDespawnDistance as int
<constant:minecraft:mobcategory:ambient>.noDespawnDistance

Return Type: int

noDespawnDistance() as int
Gets the no despawn distance of the mob category.

Returns: The no despawn distance of the mob category.

script.zs
// MobCategory.noDespawnDistance() as int;
<constant:minecraft:mobcategory:ambient>.noDespawnDistance();

Return Type: int

Getter
Checks if the mob category is persistent.
script.zs
// MobCategory.persistent as bool
<constant:minecraft:mobcategory:ambient>.persistent

Return Type: bool

persistent() as bool
Checks if the mob category is persistent.

Returns: True if the mob category is persistent.

script.zs
// MobCategory.persistent() as bool;
<constant:minecraft:mobcategory:ambient>.persistent();

Return Type: bool

Getter
Gets the serialized name.
script.zs
// MobCategory.serializedName as string
<constant:minecraft:mobcategory:ambient>.serializedName

Return Type: string

serializedName() as string
Gets the serialized name.

Returns: the serialized name.

script.zs
// MobCategory.serializedName() as string;
<constant:minecraft:mobcategory:ambient>.serializedName();

Return Type: string