Home Commands Examples Getting Started With Scripts Global Keywords

MobCategory

Importing the class

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.

script.zs
import crafttweaker.api.entity.MobCategory;

Implemented Interfaces

MobCategory implements the following interfaces. That means all methods defined in these interfaces are also available in MobCategory

Enum Constants

MobCategory is an enum. It has 8 enum constants. They are accessible using the code below.

script.zs
<constant:minecraft:mobcategory:monster>
<constant:minecraft:mobcategory:creature>
<constant:minecraft:mobcategory:ambient>
<constant:minecraft:mobcategory:axolotls>
<constant:minecraft:mobcategory:underground_water_creature>
<constant:minecraft:mobcategory:water_creature>
<constant:minecraft:mobcategory:water_ambient>
<constant:minecraft:mobcategory:misc>

Methods

Return Type: int

script.zs
// MobCategory.getDespawnDistance() as int
myMobCategory.getDespawnDistance();

Return Type: int

script.zs
// MobCategory.getMaxInstancesPerChunk() as int
myMobCategory.getMaxInstancesPerChunk();

Return Type: string

script.zs
// MobCategory.getName() as string
myMobCategory.getName();

Return Type: int

script.zs
// MobCategory.getNoDespawnDistance() as int
myMobCategory.getNoDespawnDistance();

Return Type: boolean

script.zs
// MobCategory.isFriendly() as boolean
myMobCategory.isFriendly();

Return Type: boolean

script.zs
// MobCategory.isPersistent() as boolean
myMobCategory.isPersistent();

Properties

NameTypeHas GetterHas Setter
Name
despawnDistance
Type
int
Has Getter
true
Has Setter
false
Name
friendly
Type
boolean
Has Getter
true
Has Setter
false
Name
maxInstancesPerChunk
Type
int
Has Getter
true
Has Setter
false
Name
noDespawnDistance
Type
int
Has Getter
true
Has Setter
false
Name
persistent
Type
boolean
Has Getter
true
Has Setter
false