Home Migration Guide Getting Started With Scripts Commands Examples
BracketHandlers

MCLivingEntity

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.MCLivingEntity;

Extending MCEntity

MCLivingEntity extends MCEntity. That means all methods available in MCEntity are also available in MCLivingEntity

Methods

Return Type: boolean

script.zs
MCLivingEntity.addPotionEffect(effectInstanceIn as MCPotionEffectInstance) as boolean
ParameterTypeDescription
Parameter
effectInstanceIn
Type
MCPotionEffectInstance
Description
No Description Provided

Return Type: boolean

script.zs
MCLivingEntity.attackEntityAsMob(entityIn as MCEntity) as boolean
ParameterTypeDescription
Parameter
entityIn
Type
MCEntity
Description
No Description Provided

Return Type: void

script.zs
MCLivingEntity.attackEntityFrom(damageSource as DamageSource, amount as float) as void
ParameterTypeDescription
Parameter
damageSource
Type
DamageSource
Description
No Description Provided
Parameter
amount
Type
float
Description
No Description Provided

Return Type: boolean

script.zs
MCLivingEntity.canAttack(target as MCLivingEntity) as boolean
ParameterTypeDescription
Parameter
target
Type
MCLivingEntity
Description
No Description Provided

Return Type: boolean

script.zs
MCLivingEntity.canAttack(typeIn as MCEntityType) as boolean
ParameterTypeDescription
Parameter
typeIn
Type
MCEntityType
Description
No Description Provided

Return Type: boolean

script.zs
// MCLivingEntity.canBeRiddenInWater() as boolean
myMCLivingEntity.canBeRiddenInWater();

Return Type: boolean

script.zs
// MCLivingEntity.canBreatheUnderwater() as boolean
myMCLivingEntity.canBreatheUnderwater();

Return Type: boolean

script.zs
MCLivingEntity.canEquip(item as MCItemDefinition) as boolean
ParameterTypeDescription
Parameter
item
Type
MCItemDefinition
Description
No Description Provided

Return Type: boolean

script.zs
// MCLivingEntity.clearActivePotions() as boolean
myMCLivingEntity.clearActivePotions();

Return Type: float

script.zs
// MCLivingEntity.getAIMoveSpeed() as float
myMCLivingEntity.getAIMoveSpeed();

Return Type: MCPotionEffectInstance

script.zs
MCLivingEntity.getActivePotionEffect(potionIn as MCPotionEffect) as MCPotionEffectInstance
ParameterTypeDescription
Parameter
potionIn
Type
MCPotionEffect
Description
No Description Provided

Return Type: Collection<MCPotionEffectInstance>

script.zs
// MCLivingEntity.getActivePotionEffects() as Collection<MCPotionEffectInstance>
myMCLivingEntity.getActivePotionEffects();

Return Type: MCPotionEffectInstance[MCPotionEffect]

script.zs
// MCLivingEntity.getActivePotionMap() as MCPotionEffectInstance[MCPotionEffect]
myMCLivingEntity.getActivePotionMap();

Return Type: float

script.zs
// MCLivingEntity.getArmorCoverPercentage() as float
myMCLivingEntity.getArmorCoverPercentage();

Return Type: stdlib.Iterable<ItemStack>

script.zs
// MCLivingEntity.getArmorInventoryList() as stdlib.Iterable<ItemStack>
myMCLivingEntity.getArmorInventoryList();

Return Type: int

script.zs
// MCLivingEntity.getArrowCountInEntity() as int
myMCLivingEntity.getArrowCountInEntity();

Return Type: MCLivingEntity

script.zs
// MCLivingEntity.getAttackingEntity() as MCLivingEntity
myMCLivingEntity.getAttackingEntity();

Return Type: AttributeInstance?

script.zs
// MCLivingEntity.getAttribute(attribute as Attribute) as AttributeInstance?
myMCLivingEntity.getAttribute(<attribute:minecraft:generic.attack_damage>);
ParameterTypeDescription
Parameter
attribute
Type
Attribute
Description
No Description Provided

Return Type: int

script.zs
// MCLivingEntity.getBeeStingCount() as int
myMCLivingEntity.getBeeStingCount();

Return Type: float

script.zs
// MCLivingEntity.getHealth() as float
myMCLivingEntity.getHealth();

Gets the ItemStack in the specific hand.

Returns: The ItemStack in the specific hand.
Return Type: IItemStack

script.zs
// MCLivingEntity.getHeldItem(hand as MCHand) as IItemStack
myMCLivingEntity.getHeldItem(MCHand.MAIN_HAND);
ParameterTypeDescription
Parameter
hand
Type
MCHand
Description
No Description Provided

Return Type: ItemStack

script.zs
// MCLivingEntity.getHeldItemMainhand() as ItemStack
myMCLivingEntity.getHeldItemMainhand();

Return Type: ItemStack

script.zs
// MCLivingEntity.getHeldItemOffhand() as ItemStack
myMCLivingEntity.getHeldItemOffhand();

Return Type: int

script.zs
// MCLivingEntity.getIdleTime() as int
myMCLivingEntity.getIdleTime();

Gets the ItemStack in the specific slot.

Returns: The ItemStack in the specific slot.
Return Type: IItemStack

script.zs
MCLivingEntity.getItemStackFromSlot(slot as MCEquipmentSlotType) as IItemStack
ParameterTypeDescription
Parameter
slot
Type
MCEquipmentSlotType
Description
No Description Provided

Return Type: MCLivingEntity

script.zs
// MCLivingEntity.getLastAttackedEntity() as MCLivingEntity
myMCLivingEntity.getLastAttackedEntity();

Return Type: int

script.zs
// MCLivingEntity.getLastAttackedEntityTime() as int
myMCLivingEntity.getLastAttackedEntityTime();

Return Type: float

script.zs
// MCLivingEntity.getMaxHealth() as float
myMCLivingEntity.getMaxHealth();

Return Type: MCLivingEntity

script.zs
// MCLivingEntity.getRevengeTarget() as MCLivingEntity
myMCLivingEntity.getRevengeTarget();

Return Type: int

script.zs
// MCLivingEntity.getRevengeTimer() as int
myMCLivingEntity.getRevengeTimer();

Return Type: boolean

script.zs
// MCLivingEntity.getShouldBeDead() as boolean
myMCLivingEntity.getShouldBeDead();

Return Type: int

script.zs
// MCLivingEntity.getTotalArmorValue() as int
myMCLivingEntity.getTotalArmorValue();

Return Type: void

script.zs
MCLivingEntity.heal(healAmount as float) as void
ParameterTypeDescription
Parameter
healAmount
Type
float
Description
No Description Provided

Return Type: boolean

script.zs
// MCLivingEntity.isAlive() as boolean
myMCLivingEntity.isAlive();

Return Type: boolean

script.zs
// MCLivingEntity.isChild() as boolean
myMCLivingEntity.isChild();

Return Type: boolean

script.zs
// MCLivingEntity.isEntityUndead() as boolean
myMCLivingEntity.isEntityUndead();

Return Type: boolean

script.zs
// MCLivingEntity.isOnLadder() as boolean
myMCLivingEntity.isOnLadder();

Return Type: boolean

script.zs
MCLivingEntity.isPotionActive(potionIn as MCPotionEffect) as boolean
ParameterTypeDescription
Parameter
potionIn
Type
MCPotionEffect
Description
No Description Provided

Return Type: boolean

script.zs
MCLivingEntity.isPotionApplicable(potioneffectIn as MCPotionEffectInstance) as boolean
ParameterTypeDescription
Parameter
potioneffectIn
Type
MCPotionEffectInstance
Description
No Description Provided

Return Type: boolean

script.zs
// MCLivingEntity.isWaterSensitive() as boolean
myMCLivingEntity.isWaterSensitive();

Return Type: MCPotionEffectInstance

script.zs
MCLivingEntity.removeActivePotionEffect(potioneffectin as MCPotionEffect) as MCPotionEffectInstance
ParameterTypeDescription
Parameter
potioneffectin
Type
MCPotionEffect
Description
No Description Provided

Return Type: boolean

script.zs
MCLivingEntity.removePotionEffect(effectIn as MCPotionEffect) as boolean
ParameterTypeDescription
Parameter
effectIn
Type
MCPotionEffect
Description
No Description Provided

Return Type: void

script.zs
MCLivingEntity.setAIMoveSpeed(speedIn as float) as void
ParameterTypeDescription
Parameter
speedIn
Type
float
Description
No Description Provided

Return Type: void

script.zs
MCLivingEntity.setArrowCountInEntity(count as int) as void
ParameterTypeDescription
Parameter
count
Type
int
Description
No Description Provided

Return Type: void

script.zs
MCLivingEntity.setBeeStingCount(p_226300_1_ as int) as void
ParameterTypeDescription
Parameter
p_226300_1_
Type
int
Description
No Description Provided

Return Type: void

script.zs
MCLivingEntity.setHealth(health as float) as void
ParameterTypeDescription
Parameter
health
Type
float
Description
No Description Provided

Sets a copied given itemStack to the hand

Return Type: void

script.zs
// MCLivingEntity.setHeldItem(hand as MCHand, itemStack as IItemStack) as void
myMCLivingEntity.setHeldItem(MCHand.MAIN_HAND, <item:minecraft:diamond>);
ParameterTypeDescription
Parameter
hand
Type
MCHand
Description
No Description Provided
Parameter
itemStack
Type
IItemStack
Description
No Description Provided

Return Type: void

script.zs
MCLivingEntity.setIdleTime(idleTimeIn as int) as void
ParameterTypeDescription
Parameter
idleTimeIn
Type
int
Description
No Description Provided

Sets a copied given itemStack to the slot

Return Type: void

script.zs
MCLivingEntity.setItemStackToSlot(slot as MCEquipmentSlotType, itemStack as IItemStack) as void
ParameterTypeDescription
Parameter
slot
Type
MCEquipmentSlotType
Description
No Description Provided
Parameter
itemStack
Type
IItemStack
Description
No Description Provided

Return Type: void

script.zs
MCLivingEntity.setLastAttackedEntity(entityIn as MCEntity) as void
ParameterTypeDescription
Parameter
entityIn
Type
MCEntity
Description
No Description Provided

Return Type: void

script.zs
MCLivingEntity.setRevengeTarget(livingBase as MCLivingEntity) as void
ParameterTypeDescription
Parameter
livingBase
Type
MCLivingEntity
Description
No Description Provided