Importing the class

Link to 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.

ZenScript
Copy
import crafttweaker.api.entity.type.misc.Mob;

Extending LivingEntity

Link to extending-livingentity

Mob extends LivingEntity. That means all methods available in LivingEntity are also available in Mob

Implemented Interfaces

Link to implemented-interfaces

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

Name: ate

ZenScript
Copy
// Mob.ate()

myMob.ate();

Name: canBeLeashed

Return Type: boolean

ZenScript
Copy
// Mob.canBeLeashed() as boolean

myMob.canBeLeashed();

Link to canFireProjectileWeapon

Name: canFireProjectileWeapon

Return Type: boolean

ZenScript
Copy
Mob.canFireProjectileWeapon(weapon as ProjectileWeaponItem) as boolean
ParameterType
Parameter
weapon
Type
ProjectileWeaponItem

Name: canHoldItem

Return Type: boolean

ZenScript
Copy
Mob.canHoldItem(stack as ItemStack) as boolean
ParameterType
Parameter
stack
Type
ItemStack

Link to canReplaceEqualItem

Name: canReplaceEqualItem

Return Type: boolean

ZenScript
Copy
Mob.canReplaceEqualItem(toReplace as ItemStack, with as ItemStack) as boolean
ParameterType
Parameter
toReplace
Type
ItemStack
Parameter
with
Type
ItemStack

Link to checkSpawnObstruction

Name: checkSpawnObstruction

Return Type: boolean

ZenScript
Copy
Mob.checkSpawnObstruction(level as LevelReader) as boolean
ParameterType
Parameter
level
Type
LevelReader

Name: checkSpawnRules

Return Type: boolean

ZenScript
Copy
Mob.checkSpawnRules(level as LevelAccessor, spawnType as MobSpawnType) as boolean
ParameterType
Parameter
level
Type
LevelAccessor
Parameter
spawnType
Type
MobSpawnType

Link to clearRestriction

Name: clearRestriction

ZenScript
Copy
// Mob.clearRestriction()

myMob.clearRestriction();

Name: dropLeash

ZenScript
Copy
Mob.dropLeash(broadcastPacket as boolean, dropLeash as boolean)
ParameterType
Parameter
broadcastPacket
Type
boolean
Parameter
dropLeash
Type
boolean

Link to equipItemIfPossible

Name: equipItemIfPossible

Return Type: ItemStack

ZenScript
Copy
Mob.equipItemIfPossible(stack as ItemStack) as ItemStack
ParameterType
Parameter
stack
Type
ItemStack

Link to isMaxGroupSizeReached

Name: isMaxGroupSizeReached

Return Type: boolean

ZenScript
Copy
Mob.isMaxGroupSizeReached(size as int) as boolean
ParameterType
Parameter
size
Type
int

Link to isWithinMeleeAttackRange

Name: isWithinMeleeAttackRange

Return Type: boolean

ZenScript
Copy
Mob.isWithinMeleeAttackRange(entity as LivingEntity) as boolean
ParameterType
Parameter
entity
Type
LivingEntity

Link to isWithinRestriction

Name: isWithinRestriction

Return Type: boolean

ZenScript
Copy
Mob.isWithinRestriction(position as BlockPos) as boolean
ParameterType
Parameter
position
Type
BlockPos

Name: lookAt

ZenScript
Copy
Mob.lookAt(entity as Entity, maxXRotIncrease as float, maxYRotIncrease as float)
ParameterType
Parameter
entity
Type
Entity
Parameter
maxXRotIncrease
Type
float
Parameter
maxYRotIncrease
Type
float

Link to playAmbientSound

Name: playAmbientSound

ZenScript
Copy
// Mob.playAmbientSound()

myMob.playAmbientSound();

Name: restrictTo

ZenScript
Copy
Mob.restrictTo(restrictCenter as BlockPos, restrictRadius as int)
ParameterType
Parameter
restrictCenter
Type
BlockPos
Parameter
restrictRadius
Type
int

Name: setDropChance

ZenScript
Copy
Mob.setDropChance(slot as EquipmentSlot, chance as float)
ParameterType
Parameter
slot
Type
EquipmentSlot
Parameter
chance
Type
float

Link to setGuaranteedDrop

Name: setGuaranteedDrop

ZenScript
Copy
Mob.setGuaranteedDrop(slot as EquipmentSlot)
ParameterType
Parameter
slot
Type
EquipmentSlot

Name: setLeashedTo

ZenScript
Copy
Mob.setLeashedTo(leashHolder as Entity, broadcastPacket as boolean)
ParameterType
Parameter
leashHolder
Type
Entity
Parameter
broadcastPacket
Type
boolean

Link to setPersistenceRequired

Name: setPersistenceRequired

ZenScript
Copy
// Mob.setPersistenceRequired()

myMob.setPersistenceRequired();

Name: wantsToPickUp

Return Type: boolean

ZenScript
Copy
Mob.wantsToPickUp(stack as ItemStack) as boolean
ParameterType
Parameter
stack
Type
ItemStack
NameTypeHas GetterHas Setter
Name
aggressive
Type
Mob
Has Getter
true
Has Setter
true
Name
ambientSoundInterval
Type
int
Has Getter
true
Has Setter
false
Name
baby
Type
Mob
Has Getter
false
Has Setter
true
Name
canPickUpLoot
Type
boolean
Has Getter
true
Has Setter
true
Name
getRestrictCenter
Type
BlockPos
Has Getter
true
Has Setter
false
Name
getRestrictRadius
Type
float
Has Getter
true
Has Setter
false
Name
hasRestriction
Type
boolean
Has Getter
true
Has Setter
false
Name
isPersistenceRequired
Type
boolean
Has Getter
true
Has Setter
false
Name
isWithinRestriction
Type
boolean
Has Getter
true
Has Setter
false
Name
leashed
Type
boolean
Has Getter
true
Has Setter
false
Name
leftHanded
Type
Mob
Has Getter
true
Has Setter
true
Name
maxHeadRotSpeed
Type
int
Has Getter
true
Has Setter
false
Name
maxHeadXRot
Type
int
Has Getter
true
Has Setter
false
Name
maxHeadYRot
Type
int
Has Getter
true
Has Setter
false
Name
maxSpawnClusterSize
Type
int
Has Getter
true
Has Setter
false
Name
noAi
Type
Mob
Has Getter
true
Has Setter
true
Name
target
Type
Mob
Has Getter
false
Has Setter
true