Home Getting Started With Scripts Commands Examples
BracketDumpers BracketHandlers BracketValidators

LivingEntity

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

Extending Entity

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

Methods

Return Type: boolean

script.zs
LivingEntity.addEffect(effectInstance as MobEffectInstance) as boolean
ParameterTypeDescription
Parameter
effectInstance
Type
MobEffectInstance
Description
No Description Provided

Return Type: boolean

script.zs
LivingEntity.addEffect(effectInstance as MobEffectInstance, entity as Entity) as boolean
ParameterTypeDescription
Parameter
effectInstance
Type
MobEffectInstance
Description
No Description Provided
Parameter
entity
Type
Entity
Description
No Description Provided

Return Type: boolean

script.zs
// LivingEntity.attackable() as boolean
myLivingEntity.attackable();

Return Type: boolean

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

Return Type: boolean

script.zs
LivingEntity.canBeAffected(effectInstance as MobEffectInstance) as boolean
ParameterTypeDescription
Parameter
effectInstance
Type
MobEffectInstance
Description
No Description Provided

Return Type: boolean

script.zs
// LivingEntity.canBeSeenAsEnemy() as boolean
myLivingEntity.canBeSeenAsEnemy();

Return Type: boolean

script.zs
// LivingEntity.canBeSeenByAnyone() as boolean
myLivingEntity.canBeSeenByAnyone();

Return Type: boolean

script.zs
// LivingEntity.canBreatheUnderwater() as boolean
myLivingEntity.canBreatheUnderwater();

Return Type: boolean

script.zs
// LivingEntity.canSpawnSoulSpeedParticle() as boolean
myLivingEntity.canSpawnSoulSpeedParticle();

Return Type: boolean

script.zs
LivingEntity.canStandOnFluid(fluid as Fluid) as boolean
ParameterTypeDescription
Parameter
fluid
Type
Fluid
Description
No Description Provided

Return Type: boolean

script.zs
LivingEntity.canTakeItem(stack as ItemStack) as boolean
ParameterTypeDescription
Parameter
stack
Type
ItemStack
Description
No Description Provided

Return Type: void

script.zs
// LivingEntity.clearSleepingPos() as void
myLivingEntity.clearSleepingPos();

Return Type: void

script.zs
LivingEntity.die(source as DamageSource) as void
ParameterTypeDescription
Parameter
source
Type
DamageSource
Description
No Description Provided

Return Type: boolean

script.zs
LivingEntity.doHurtTarget(entity as Entity) as boolean
ParameterTypeDescription
Parameter
entity
Type
Entity
Description
No Description Provided

Return Type: ItemStack

script.zs
LivingEntity.eat(level as Level, stack as ItemStack) as ItemStack
ParameterTypeDescription
Parameter
level
Type
Level
Description
No Description Provided
Parameter
stack
Type
ItemStack
Description
No Description Provided

Return Type: void

script.zs
LivingEntity.forceAddEffect(effectInstance as MobEffectInstance, entity as Entity) as void
ParameterTypeDescription
Parameter
effectInstance
Type
MobEffectInstance
Description
No Description Provided
Parameter
entity
Type
Entity
Description
No Description Provided

Return Type: float

script.zs
// LivingEntity.getAbsorptionAmount() as float
myLivingEntity.getAbsorptionAmount();

Return Type: Collection<MobEffectInstance>

script.zs
// LivingEntity.getActiveEffects() as Collection<MobEffectInstance>
myLivingEntity.getActiveEffects();

Return Type: MobEffectInstance[MobEffect]

script.zs
// LivingEntity.getActiveEffectsMap() as MobEffectInstance[MobEffect]
myLivingEntity.getActiveEffectsMap();

Return Type: float

script.zs
// LivingEntity.getArmorCoverPercentage() as float
myLivingEntity.getArmorCoverPercentage();

Return Type: int

script.zs
// LivingEntity.getArmorValue() as int
myLivingEntity.getArmorValue();

Return Type: int

script.zs
// LivingEntity.getArrowCount() as int
myLivingEntity.getArrowCount();

Return Type: AttributeInstance

script.zs
LivingEntity.getAttribute(attribute as Attribute) as AttributeInstance
ParameterTypeDescription
Parameter
attribute
Type
Attribute
Description
No Description Provided

Return Type: double

script.zs
LivingEntity.getAttributeBaseValue(attribute as Attribute) as double
ParameterTypeDescription
Parameter
attribute
Type
Attribute
Description
No Description Provided

Return Type: double

script.zs
LivingEntity.getAttributeValue(attribute as Attribute) as double
ParameterTypeDescription
Parameter
attribute
Type
Attribute
Description
No Description Provided

Return Type: Direction

script.zs
// LivingEntity.getBedOrientation() as Direction
myLivingEntity.getBedOrientation();

Return Type: MobEffectInstance

script.zs
LivingEntity.getEffect(effect as MobEffect) as MobEffectInstance
ParameterTypeDescription
Parameter
effect
Type
MobEffect
Description
No Description Provided

Return Type: int

script.zs
// LivingEntity.getFallFlyingTicks() as int
myLivingEntity.getFallFlyingTicks();

Return Type: float

script.zs
// LivingEntity.getHealth() as float
myLivingEntity.getHealth();

Return Type: ItemStack

script.zs
LivingEntity.getItemBySlot(slot as EquipmentSlot) as ItemStack
ParameterTypeDescription
Parameter
slot
Type
EquipmentSlot
Description
No Description Provided

Return Type: ItemStack

script.zs
LivingEntity.getItemInHand(hand as InteractionHand) as ItemStack
ParameterTypeDescription
Parameter
hand
Type
InteractionHand
Description
No Description Provided

Return Type: double

script.zs
// LivingEntity.getJumpBoostPower() as double
myLivingEntity.getJumpBoostPower();

Return Type: LivingEntity

script.zs
// LivingEntity.getKillCredit() as LivingEntity
myLivingEntity.getKillCredit();

Return Type: BlockPos

script.zs
// LivingEntity.getLastClimbablePos() as BlockPos
myLivingEntity.getLastClimbablePos();

Return Type: DamageSource

script.zs
// LivingEntity.getLastDamageSource() as DamageSource
myLivingEntity.getLastDamageSource();

Return Type: LivingEntity

script.zs
// LivingEntity.getLastHurtByMob() as LivingEntity
myLivingEntity.getLastHurtByMob();

Return Type: int

script.zs
// LivingEntity.getLastHurtByMobTimestamp() as int
myLivingEntity.getLastHurtByMobTimestamp();

Return Type: LivingEntity

script.zs
// LivingEntity.getLastHurtMob() as LivingEntity
myLivingEntity.getLastHurtMob();

Return Type: int

script.zs
// LivingEntity.getLastHurtMobTimestamp() as int
myLivingEntity.getLastHurtMobTimestamp();

Return Type: ResourceLocation

script.zs
// LivingEntity.getLootTable() as ResourceLocation
myLivingEntity.getLootTable();

Return Type: HumanoidArm

script.zs
// LivingEntity.getMainArm() as HumanoidArm
myLivingEntity.getMainArm();

Return Type: ItemStack

script.zs
// LivingEntity.getMainHandItem() as ItemStack
myLivingEntity.getMainHandItem();

Return Type: float

script.zs
// LivingEntity.getMaxHealth() as float
myLivingEntity.getMaxHealth();

Return Type: MobType

script.zs
// LivingEntity.getMobType() as MobType
myLivingEntity.getMobType();

Return Type: int

script.zs
// LivingEntity.getNoActionTime() as int
myLivingEntity.getNoActionTime();

Return Type: ItemStack

script.zs
// LivingEntity.getOffhandItem() as ItemStack
myLivingEntity.getOffhandItem();

Return Type: Random

script.zs
// LivingEntity.getRandom() as Random
myLivingEntity.getRandom();

Return Type: float

script.zs
// LivingEntity.getScale() as float
myLivingEntity.getScale();

Return Type: BlockPos

script.zs
// LivingEntity.getSleepingPos() as BlockPos
myLivingEntity.getSleepingPos();

Return Type: float

script.zs
// LivingEntity.getSpeed() as float
myLivingEntity.getSpeed();

Return Type: int

script.zs
// LivingEntity.getStingerCount() as int
myLivingEntity.getStingerCount();

Return Type: float

script.zs
LivingEntity.getSwimAmount(partialTicks as float) as float
ParameterTypeDescription
Parameter
partialTicks
Type
float
Description
No Description Provided

Return Type: int

script.zs
// LivingEntity.getTicksUsingItem() as int
myLivingEntity.getTicksUsingItem();

Return Type: ItemStack

script.zs
// LivingEntity.getUseItem() as ItemStack
myLivingEntity.getUseItem();

Return Type: int

script.zs
// LivingEntity.getUseItemRemainingTicks() as int
myLivingEntity.getUseItemRemainingTicks();

Return Type: InteractionHand

script.zs
// LivingEntity.getUsedItemHand() as InteractionHand
myLivingEntity.getUsedItemHand();

Return Type: double

script.zs
LivingEntity.getVisibilityPercent(lookingEntity as Entity) as double
ParameterTypeDescription
Parameter
lookingEntity
Type
Entity
Description
No Description Provided

Return Type: float

script.zs
// LivingEntity.getVoicePitch() as float
myLivingEntity.getVoicePitch();

Return Type: boolean

script.zs
LivingEntity.hasEffect(effect as MobEffect) as boolean
ParameterTypeDescription
Parameter
effect
Type
MobEffect
Description
No Description Provided

Return Type: boolean

script.zs
LivingEntity.hasItemInSlot(slot as EquipmentSlot) as boolean
ParameterTypeDescription
Parameter
slot
Type
EquipmentSlot
Description
No Description Provided

Return Type: boolean

script.zs
LivingEntity.hasLineOfSight(entity as Entity) as boolean
ParameterTypeDescription
Parameter
entity
Type
Entity
Description
No Description Provided

Return Type: void

script.zs
LivingEntity.heal(amount as float) as void
ParameterTypeDescription
Parameter
amount
Type
float
Description
No Description Provided

Return Type: boolean

script.zs
// LivingEntity.isAffectedByPotions() as boolean
myLivingEntity.isAffectedByPotions();

Return Type: boolean

script.zs
// LivingEntity.isAutoSpinAttack() as boolean
myLivingEntity.isAutoSpinAttack();

Return Type: boolean

script.zs
// LivingEntity.isBaby() as boolean
myLivingEntity.isBaby();

Return Type: boolean

script.zs
// LivingEntity.isBlocking() as boolean
myLivingEntity.isBlocking();

Return Type: boolean

script.zs
// LivingEntity.isCurrentlyGlowing() as boolean
myLivingEntity.isCurrentlyGlowing();

Return Type: boolean

script.zs
LivingEntity.isDamageSourceBlocked(source as DamageSource) as boolean
ParameterTypeDescription
Parameter
source
Type
DamageSource
Description
No Description Provided

Return Type: boolean

script.zs
// LivingEntity.isDeadOrDying() as boolean
myLivingEntity.isDeadOrDying();

Return Type: boolean

script.zs
// LivingEntity.isFallFlying() as boolean
myLivingEntity.isFallFlying();

Return Type: boolean

script.zs
LivingEntity.isHolding(item as ItemDefinition) as boolean
ParameterTypeDescription
Parameter
item
Type
ItemDefinition
Description
No Description Provided

Return Type: boolean

script.zs
LivingEntity.isHolding(predicate as Predicate<ItemStack>) as boolean
ParameterTypeDescription
Parameter
predicate
Type
Predicate<ItemStack>
Description
No Description Provided

Return Type: boolean

script.zs
// LivingEntity.isInvertedHealAndHarm() as boolean
myLivingEntity.isInvertedHealAndHarm();

Return Type: boolean

script.zs
// LivingEntity.isSensitiveToWater() as boolean
myLivingEntity.isSensitiveToWater();

Return Type: boolean

script.zs
// LivingEntity.isSleeping() as boolean
myLivingEntity.isSleeping();

Return Type: boolean

script.zs
// LivingEntity.isSuppressingSlidingDownLadder() as boolean
myLivingEntity.isSuppressingSlidingDownLadder();

Return Type: boolean

script.zs
// LivingEntity.isUsingItem() as boolean
myLivingEntity.isUsingItem();

Return Type: boolean

script.zs
// LivingEntity.isVisuallySwimming() as boolean
myLivingEntity.isVisuallySwimming();

Return Type: void

script.zs
LivingEntity.knockback(x as double, y as double, z as double) as void
ParameterTypeDescription
Parameter
x
Type
double
Description
No Description Provided
Parameter
y
Type
double
Description
No Description Provided
Parameter
z
Type
double
Description
No Description Provided

Return Type: void

script.zs
// LivingEntity.releaseUsingItem() as void
myLivingEntity.releaseUsingItem();

Return Type: boolean

script.zs
// LivingEntity.removeAllEffects() as boolean
myLivingEntity.removeAllEffects();

Return Type: boolean

script.zs
LivingEntity.removeEffect(effect as MobEffect) as boolean
ParameterTypeDescription
Parameter
effect
Type
MobEffect
Description
No Description Provided

Return Type: MobEffectInstance

script.zs
LivingEntity.removeEffectNoUpdate(effect as MobEffect) as MobEffectInstance
ParameterTypeDescription
Parameter
effect
Type
MobEffect
Description
No Description Provided

Return Type: void

script.zs
LivingEntity.setAbsorptionAmount(absorption as float) as void
ParameterTypeDescription
Parameter
absorption
Type
float
Description
No Description Provided

Return Type: void

script.zs
LivingEntity.setArrowCount(count as int) as void
ParameterTypeDescription
Parameter
count
Type
int
Description
No Description Provided

Return Type: void

script.zs
LivingEntity.setDiscardFriction(discardFriction as boolean) as void
ParameterTypeDescription
Parameter
discardFriction
Type
boolean
Description
No Description Provided

Return Type: void

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

Return Type: void

script.zs
LivingEntity.setItemInHand(hand as InteractionHand, stack as ItemStack) as void
ParameterTypeDescription
Parameter
hand
Type
InteractionHand
Description
No Description Provided
Parameter
stack
Type
ItemStack
Description
No Description Provided

Return Type: void

script.zs
LivingEntity.setJumping(jumping as boolean) as void
ParameterTypeDescription
Parameter
jumping
Type
boolean
Description
No Description Provided

Return Type: void

script.zs
LivingEntity.setLastHurtByMob(entity as LivingEntity) as void
ParameterTypeDescription
Parameter
entity
Type
LivingEntity
Description
No Description Provided

Return Type: void

script.zs
LivingEntity.setLastHurtByPlayer(player as Player) as void
ParameterTypeDescription
Parameter
player
Type
Player
Description
No Description Provided

Return Type: void

script.zs
LivingEntity.setLastHurtMob(entity as Entity) as void
ParameterTypeDescription
Parameter
entity
Type
Entity
Description
No Description Provided

Return Type: void

script.zs
LivingEntity.setNoActionTime(idleTime as int) as void
ParameterTypeDescription
Parameter
idleTime
Type
int
Description
No Description Provided

Return Type: void

script.zs
LivingEntity.setSleepingPos(pos as BlockPos) as void
ParameterTypeDescription
Parameter
pos
Type
BlockPos
Description
No Description Provided

Return Type: void

script.zs
LivingEntity.setSpeed(speed as float) as void
ParameterTypeDescription
Parameter
speed
Type
float
Description
No Description Provided

Return Type: void

script.zs
LivingEntity.setStingerCount(count as int) as void
ParameterTypeDescription
Parameter
count
Type
int
Description
No Description Provided

Return Type: boolean

script.zs
// LivingEntity.shouldDiscardFriction() as boolean
myLivingEntity.shouldDiscardFriction();

Return Type: void

script.zs
LivingEntity.startAutoSpinAttack(ticks as int) as void
ParameterTypeDescription
Parameter
ticks
Type
int
Description
No Description Provided

Return Type: void

script.zs
LivingEntity.startSleeping(pos as BlockPos) as void
ParameterTypeDescription
Parameter
pos
Type
BlockPos
Description
No Description Provided

Return Type: void

script.zs
LivingEntity.startUsingItem(param0 as InteractionHand) as void
ParameterTypeDescription
Parameter
param0
Type
InteractionHand
Description
No Description Provided

Return Type: void

script.zs
// LivingEntity.stopSleeping() as void
myLivingEntity.stopSleeping();

Return Type: void

script.zs
// LivingEntity.stopUsingItem() as void
myLivingEntity.stopUsingItem();

Return Type: void

script.zs
LivingEntity.swing(hand as InteractionHand) as void
ParameterTypeDescription
Parameter
hand
Type
InteractionHand
Description
No Description Provided

Return Type: void

script.zs
LivingEntity.swing(hand as InteractionHand, updateSelf as boolean) as void
ParameterTypeDescription
Parameter
hand
Type
InteractionHand
Description
No Description Provided
Parameter
updateSelf
Type
boolean
Description
No Description Provided

Return Type: void

script.zs
LivingEntity.travel(vec as Vec3) as void
ParameterTypeDescription
Parameter
vec
Type
Vec3
Description
No Description Provided

Properties

NameTypeHas GetterHas SetterDescription
Name
absorptionAmount
Type
float
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
activeEFfectsMap
Type
MobEffectInstance[MobEffect]
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
activeEffects
Type
Collection<MobEffectInstance>
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
armorCoverPercentage
Type
float
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
armorValue
Type
int
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
arrowCount
Type
int
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
attackable
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
bedOrientation
Type
Direction
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
canBeSeenAsEnemy
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
canBeSeenByAnyone
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
canBreatheUnderwater
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
fallFlyingTicks
Type
int
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
health
Type
float
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
isAffectedByPotions
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
isAutoSpinAttack
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
isBaby
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
isBlocking
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
isCurrentlyGlowing
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
isDeadOrDying
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
isFallFlying
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
isInvertedHealAndHarm
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
isSensitiveToWater
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
isSleeping
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
isSuppressingSlidingDownLadder
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
isUsingItem
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
isVisuallySwimming
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
jumpBoostPower
Type
double
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
killCredit
Type
LivingEntity
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
lastClimbablePos
Type
BlockPos
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
lastDamageSource
Type
DamageSource
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
lastHurtByMob
Type
LivingEntity
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
lastHurtByMobTimestamp
Type
int
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
lastHurtMob
Type
LivingEntity
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
lastHurtMobTimestamp
Type
int
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
lootTable
Type
ResourceLocation
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
mainArm
Type
HumanoidArm
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
mainHandItem
Type
ItemStack
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
maxHealth
Type
float
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
mobType
Type
MobType
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
noActionTime
Type
int
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
offHandItem
Type
ItemStack
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
random
Type
Random
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
scale
Type
float
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
shouldDiscardFriction
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
sleepingPos
Type
BlockPos
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
speed
Type
float
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
stingerCount
Type
int
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
ticksUsingItem
Type
int
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
useItem
Type
ItemStack
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
useItemRemainingTicks
Type
int
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
usedItemHand
Type
InteractionHand
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
voicePitch
Type
float
Has Getter
true
Has Setter
false
Description
No Description Provided