Mob
Link to mob
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 Copyimport 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
Methods
Link to methods
Name: ate
ZenScript Copy// Mob.ate()
myMob.ate();
Name: canBeLeashed
Return Type: boolean
ZenScript CopyMob.canBeLeashed(leashHolder as Player) as boolean
Parameter | Type |
---|---|
Parameter leashHolder | Type Player |
Name: canFireProjectileWeapon
Return Type: boolean
ZenScript CopyMob.canFireProjectileWeapon(weapon as ProjectileWeaponItem) as boolean
Parameter | Type |
---|---|
Parameter weapon | Type ProjectileWeaponItem |
Name: canHoldItem
Return Type: boolean
ZenScript CopyMob.canHoldItem(stack as ItemStack) as boolean
Parameter | Type |
---|---|
Parameter stack | Type ItemStack |
Name: checkSpawnObstruction
Return Type: boolean
ZenScript CopyMob.checkSpawnObstruction(level as invalid) as boolean
Parameter | Type |
---|---|
Parameter level | Type invalid |
Name: checkSpawnRules
Return Type: boolean
ZenScript CopyMob.checkSpawnRules(level as invalid, spawnType as MobSpawnType) as boolean
Parameter | Type |
---|---|
Parameter level | Type invalid |
Parameter spawnType | Type MobSpawnType |
Name: clearRestriction
ZenScript Copy// Mob.clearRestriction()
myMob.clearRestriction();
Name: dropLeash
ZenScript CopyMob.dropLeash(broadcastPacket as boolean, dropLeash as boolean)
Parameter | Type |
---|---|
Parameter broadcastPacket | Type boolean |
Parameter dropLeash | Type boolean |
Name: equipItemIfPossible
Return Type: boolean
ZenScript CopyMob.equipItemIfPossible(stack as ItemStack) as boolean
Parameter | Type |
---|---|
Parameter stack | Type ItemStack |
Name: isMaxGroupSizeReached
Return Type: boolean
ZenScript CopyMob.isMaxGroupSizeReached(size as int) as boolean
Parameter | Type |
---|---|
Parameter size | Type int |
Name: isWithinMeleeAttackRange
Return Type: boolean
ZenScript CopyMob.isWithinMeleeAttackRange(entity as LivingEntity) as boolean
Parameter | Type |
---|---|
Parameter entity | Type LivingEntity |
Name: isWithinRestriction
Return Type: boolean
ZenScript CopyMob.isWithinRestriction(position as BlockPos) as boolean
Parameter | Type |
---|---|
Parameter position | Type BlockPos |
Name: lookAt
ZenScript CopyMob.lookAt(entity as Entity, maxXRotIncrease as float, maxYRotIncrease as float)
Parameter | Type |
---|---|
Parameter entity | Type Entity |
Parameter maxXRotIncrease | Type float |
Parameter maxYRotIncrease | Type float |
Name: playAmbientSound
ZenScript Copy// Mob.playAmbientSound()
myMob.playAmbientSound();
Name: restrictTo
ZenScript CopyMob.restrictTo(restrictCenter as BlockPos, restrictRadius as int)
Parameter | Type |
---|---|
Parameter restrictCenter | Type BlockPos |
Parameter restrictRadius | Type int |
Name: setDropChance
ZenScript CopyMob.setDropChance(slot as EquipmentSlot, chance as float)
Parameter | Type |
---|---|
Parameter slot | Type EquipmentSlot |
Parameter chance | Type float |
Name: setGuaranteedDrop
ZenScript CopyMob.setGuaranteedDrop(slot as EquipmentSlot)
Parameter | Type |
---|---|
Parameter slot | Type EquipmentSlot |
Name: setLeashedTo
ZenScript CopyMob.setLeashedTo(leashHolder as Entity, broadcastPacket as boolean)
Parameter | Type |
---|---|
Parameter leashHolder | Type Entity |
Parameter broadcastPacket | Type boolean |
Name: setPersistenceRequired
ZenScript Copy// Mob.setPersistenceRequired()
myMob.setPersistenceRequired();
Name: wantsToPickUp
Return Type: boolean
ZenScript CopyMob.wantsToPickUp(stack as ItemStack) as boolean
Parameter | Type |
---|---|
Parameter stack | Type ItemStack |
Properties
Link to properties
Name | Type | Has Getter | Has 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 |