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

Extending Entity

Link to extending-entity

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

Name: addEffect

Return Type: boolean

ZenScript
Copy
LivingEntity.addEffect(effectInstance as MobEffectInstance) as boolean
参数类型
参数
effectInstance
类型
MobEffectInstance

Name: addEffect

Return Type: boolean

ZenScript
Copy
LivingEntity.addEffect(effectInstance as MobEffectInstance, entity as Entity?) as boolean
参数类型
参数
effectInstance
类型
MobEffectInstance
参数
entity
类型
Entity?

Name: attackable

Return Type: boolean

ZenScript
Copy
// LivingEntity.attackable() as boolean

myLivingEntity.attackable();

Name: canAttack

Return Type: boolean

ZenScript
Copy
LivingEntity.canAttack(target as LivingEntity) as boolean
参数类型
参数
target
类型
LivingEntity

Name: canBeAffected

Return Type: boolean

ZenScript
Copy
LivingEntity.canBeAffected(effectInstance as MobEffectInstance) as boolean
参数类型
参数
effectInstance
类型
MobEffectInstance

Link to canBeSeenAsEnemy

Name: canBeSeenAsEnemy

Return Type: boolean

ZenScript
Copy
// LivingEntity.canBeSeenAsEnemy() as boolean

myLivingEntity.canBeSeenAsEnemy();

Link to canBeSeenByAnyone

Name: canBeSeenByAnyone

Return Type: boolean

ZenScript
Copy
// LivingEntity.canBeSeenByAnyone() as boolean

myLivingEntity.canBeSeenByAnyone();

Link to canBreatheUnderwater

Name: canBreatheUnderwater

Return Type: boolean

ZenScript
Copy
// LivingEntity.canBreatheUnderwater() as boolean

myLivingEntity.canBreatheUnderwater();

Link to canSpawnSoulSpeedParticle

Name: canSpawnSoulSpeedParticle

Return Type: boolean

ZenScript
Copy
// LivingEntity.canSpawnSoulSpeedParticle() as boolean

myLivingEntity.canSpawnSoulSpeedParticle();

Name: canStandOnFluid

Return Type: boolean

ZenScript
Copy
LivingEntity.canStandOnFluid(fluid as Fluid) as boolean
参数类型
参数
fluid
类型
Fluid

Name: canTakeItem

Return Type: boolean

ZenScript
Copy
LivingEntity.canTakeItem(stack as ItemStack) as boolean
参数类型
参数
堆叠
类型
物品应用

Link to clearSleepingPos

Name: clearSleepingPos

ZenScript
Copy
// LivingEntity.clearSleepingPos()

myLivingEntity.clearSleepingPos();

Name: die

ZenScript
Copy
LivingEntity.die(source as DamageSource)
参数类型
参数
来源
类型
DamageSource

Name: doHurtTarget

Return Type: boolean

ZenScript
Copy
LivingEntity.doHurtTarget(entity as Entity) as boolean
参数类型
参数
entity
类型
Entity

Name: eat

Return Type: ItemStack

ZenScript
Copy
LivingEntity.eat(level as Level, stack as ItemStack) as ItemStack
参数类型
参数
level
类型
Level
参数
堆叠
类型
物品应用

Name: forceAddEffect

ZenScript
Copy
LivingEntity.forceAddEffect(effectInstance as MobEffectInstance, entity as Entity?)
参数类型
参数
effectInstance
类型
MobEffectInstance
参数
entity
类型
Entity?

Link to getAbsorptionAmount

Name: getAbsorptionAmount

Return Type: float

ZenScript
Copy
// LivingEntity.getAbsorptionAmount() as float

myLivingEntity.getAbsorptionAmount();

Link to getActiveEffects

Name: getActiveEffects

Return Type: Collection<MobEffectInstance>

ZenScript
Copy
// LivingEntity.getActiveEffects() as Collection<MobEffectInstance>

myLivingEntity.getActiveEffects();

Link to getActiveEffectsMap

Name: getActiveEffectsMap

Return Type: MobEffectInstance[MobEffect]

ZenScript
Copy
// LivingEntity.getActiveEffectsMap() as MobEffectInstance[MobEffect]

myLivingEntity.getActiveEffectsMap();

Link to getArmorCoverPercentage

Name: getArmorCoverPercentage

Return Type: float

ZenScript
Copy
// LivingEntity.getArmorCoverPercentage() as float

myLivingEntity.getArmorCoverPercentage();

Name: getArmorValue

Return Type: int

ZenScript
Copy
// LivingEntity.getArmorValue() as int

myLivingEntity.getArmorValue();

Name: getArrowCount

Return Type: int

ZenScript
Copy
// LivingEntity.getArrowCount() as int

myLivingEntity.getArrowCount();

Name: getAttribute

Return Type: AttributeInstance?

ZenScript
Copy
LivingEntity.getAttribute(attribute as Attribute) as AttributeInstance?
参数类型
参数
attribute
类型
Attribute

Link to getAttributeBaseValue

Name: getAttributeBaseValue

Return Type: double

ZenScript
Copy
LivingEntity.getAttributeBaseValue(attribute as Attribute) as double
参数类型
参数
attribute
类型
Attribute

Link to getAttributeValue

Name: getAttributeValue

Return Type: double

ZenScript
Copy
LivingEntity.getAttributeValue(attribute as Attribute) as double
参数类型
参数
attribute
类型
Attribute

Link to getBedOrientation

Name: getBedOrientation

Return Type: Direction?

ZenScript
Copy
// LivingEntity.getBedOrientation() as Direction?

myLivingEntity.getBedOrientation();

Name: getEffect

Return Type: MobEffectInstance?

ZenScript
Copy
LivingEntity.getEffect(effect as MobEffect) as MobEffectInstance?
参数类型
参数
effect
类型
MobEffect

Link to getFallFlyingTicks

Name: getFallFlyingTicks

Return Type: int

ZenScript
Copy
// LivingEntity.getFallFlyingTicks() as int

myLivingEntity.getFallFlyingTicks();

Name: getHealth

Return Type: float

ZenScript
Copy
// LivingEntity.getHealth() as float

myLivingEntity.getHealth();

Name: getItemBySlot

Return Type: ItemStack

ZenScript
Copy
LivingEntity.getItemBySlot(slot as EquipmentSlot) as ItemStack
参数类型
参数
slot
类型
EquipmentSlot

Name: getItemInHand

Return Type: ItemStack

ZenScript
Copy
LivingEntity.getItemInHand(hand as InteractionHand) as ItemStack
参数类型
参数
hand
类型
InteractionHand

Link to getJumpBoostPower

Name: getJumpBoostPower

Return Type: double

ZenScript
Copy
// LivingEntity.getJumpBoostPower() as double

myLivingEntity.getJumpBoostPower();

Name: getKillCredit

Return Type: LivingEntity?

ZenScript
Copy
// LivingEntity.getKillCredit() as LivingEntity?

myLivingEntity.getKillCredit();

Link to getLastClimbablePos

Name: getLastClimbablePos

Return Type: BlockPos?

ZenScript
Copy
// LivingEntity.getLastClimbablePos() as BlockPos?

myLivingEntity.getLastClimbablePos();

Link to getLastDamageSource

Name: getLastDamageSource

Return Type: DamageSource?

ZenScript
Copy
// LivingEntity.getLastDamageSource() as DamageSource?

myLivingEntity.getLastDamageSource();

Link to getLastHurtByMob

Name: getLastHurtByMob

Return Type: LivingEntity?

ZenScript
Copy
// LivingEntity.getLastHurtByMob() as LivingEntity?

myLivingEntity.getLastHurtByMob();

Link to getLastHurtByMobTimestamp

Name: getLastHurtByMobTimestamp

Return Type: int

ZenScript
Copy
// LivingEntity.getLastHurtByMobTimestamp() as int

myLivingEntity.getLastHurtByMobTimestamp();

Name: getLastHurtMob

Return Type: LivingEntity

ZenScript
Copy
// LivingEntity.getLastHurtMob() as LivingEntity

myLivingEntity.getLastHurtMob();

Link to getLastHurtMobTimestamp

Name: getLastHurtMobTimestamp

Return Type: int

ZenScript
Copy
// LivingEntity.getLastHurtMobTimestamp() as int

myLivingEntity.getLastHurtMobTimestamp();

Name: getLootTable

Return Type: ResourceLocation

ZenScript
Copy
// LivingEntity.getLootTable() as ResourceLocation

myLivingEntity.getLootTable();

Name: getMainArm

Return Type: HumanoidArm

ZenScript
Copy
// LivingEntity.getMainArm() as HumanoidArm

myLivingEntity.getMainArm();

Name: getMainHandItem

Return Type: ItemStack

ZenScript
Copy
// LivingEntity.getMainHandItem() as ItemStack

myLivingEntity.getMainHandItem();

Name: getMaxHealth

Return Type: float

ZenScript
Copy
// LivingEntity.getMaxHealth() as float

myLivingEntity.getMaxHealth();

Name: getMobType

Return Type: MobType

ZenScript
Copy
// LivingEntity.getMobType() as MobType

myLivingEntity.getMobType();

Name: getNoActionTime

Return Type: int

ZenScript
Copy
// LivingEntity.getNoActionTime() as int

myLivingEntity.getNoActionTime();

Name: getOffhandItem

Return Type: ItemStack

ZenScript
Copy
// LivingEntity.getOffhandItem() as ItemStack

myLivingEntity.getOffhandItem();

Name: getRandom

Return Type: Random

ZenScript
Copy
// LivingEntity.getRandom() as Random

myLivingEntity.getRandom();

Name: getScale

Return Type: float

ZenScript
Copy
// LivingEntity.getScale() as float

myLivingEntity.getScale();

Name: getSleepingPos

Return Type: BlockPos?

ZenScript
Copy
// LivingEntity.getSleepingPos() as BlockPos?

myLivingEntity.getSleepingPos();

Name: getSpeed

Return Type: float

ZenScript
Copy
// LivingEntity.getSpeed() as float

myLivingEntity.getSpeed();

Name: getStingerCount

Return Type: int

ZenScript
Copy
// LivingEntity.getStingerCount() as int

myLivingEntity.getStingerCount();

Name: getSwimAmount

Return Type: float

ZenScript
Copy
LivingEntity.getSwimAmount(partialTicks as float) as float
参数类型
参数
partialTicks
类型
float

Link to getTicksUsingItem

Name: getTicksUsingItem

Return Type: int

ZenScript
Copy
// LivingEntity.getTicksUsingItem() as int

myLivingEntity.getTicksUsingItem();

Name: getUseItem

Return Type: ItemStack

ZenScript
Copy
// LivingEntity.getUseItem() as ItemStack

myLivingEntity.getUseItem();

Link to getUseItemRemainingTicks

Name: getUseItemRemainingTicks

Return Type: int

ZenScript
Copy
// LivingEntity.getUseItemRemainingTicks() as int

myLivingEntity.getUseItemRemainingTicks();

Name: getUsedItemHand

Return Type: InteractionHand

ZenScript
Copy
// LivingEntity.getUsedItemHand() as InteractionHand

myLivingEntity.getUsedItemHand();

Link to getVisibilityPercent

Name: getVisibilityPercent

Return Type: double

ZenScript
Copy
LivingEntity.getVisibilityPercent(lookingEntity as Entity?) as double
参数类型
参数
lookingEntity
类型
Entity?

Name: getVoicePitch

Return Type: float

ZenScript
Copy
// LivingEntity.getVoicePitch() as float

myLivingEntity.getVoicePitch();

Name: hasEffect

Return Type: boolean

ZenScript
Copy
LivingEntity.hasEffect(effect as MobEffect) as boolean
参数类型
参数
effect
类型
MobEffect

Name: hasItemInSlot

Return Type: boolean

ZenScript
Copy
LivingEntity.hasItemInSlot(slot as EquipmentSlot) as boolean
参数类型
参数
slot
类型
EquipmentSlot

Name: hasLineOfSight

Return Type: boolean

ZenScript
Copy
LivingEntity.hasLineOfSight(entity as Entity) as boolean
参数类型
参数
entity
类型
Entity

Name: heal

ZenScript
Copy
LivingEntity.heal(amount as float)
参数类型
参数
amount
类型
float

Link to isAffectedByPotions

Name: isAffectedByPotions

Return Type: boolean

ZenScript
Copy
// LivingEntity.isAffectedByPotions() as boolean

myLivingEntity.isAffectedByPotions();

Link to isAutoSpinAttack

Name: isAutoSpinAttack

Return Type: boolean

ZenScript
Copy
// LivingEntity.isAutoSpinAttack() as boolean

myLivingEntity.isAutoSpinAttack();

Name: isBaby

Return Type: boolean

ZenScript
Copy
// LivingEntity.isBaby() as boolean

myLivingEntity.isBaby();

Name: isBlocking

Return Type: boolean

ZenScript
Copy
// LivingEntity.isBlocking() as boolean

myLivingEntity.isBlocking();

Link to isCurrentlyGlowing

Name: isCurrentlyGlowing

Return Type: boolean

ZenScript
Copy
// LivingEntity.isCurrentlyGlowing() as boolean

myLivingEntity.isCurrentlyGlowing();

Link to isDamageSourceBlocked

Name: isDamageSourceBlocked

Return Type: boolean

ZenScript
Copy
LivingEntity.isDamageSourceBlocked(source as DamageSource) as boolean
参数类型
参数
来源
类型
DamageSource

Name: isDeadOrDying

Return Type: boolean

ZenScript
Copy
// LivingEntity.isDeadOrDying() as boolean

myLivingEntity.isDeadOrDying();

Name: isFallFlying

Return Type: boolean

ZenScript
Copy
// LivingEntity.isFallFlying() as boolean

myLivingEntity.isFallFlying();

Name: isHolding

Return Type: boolean

ZenScript
Copy
LivingEntity.isHolding(item as ItemDefinition) as boolean
参数类型
参数
item
类型
ItemDefinition

Name: isHolding

Return Type: boolean

ZenScript
Copy
LivingEntity.isHolding(predicate as Predicate<ItemStack>) as boolean
参数类型
参数
predicate
类型
Predicate<ItemStack>

Link to isInvertedHealAndHarm

Name: isInvertedHealAndHarm

Return Type: boolean

ZenScript
Copy
// LivingEntity.isInvertedHealAndHarm() as boolean

myLivingEntity.isInvertedHealAndHarm();

Link to isSensitiveToWater

Name: isSensitiveToWater

Return Type: boolean

ZenScript
Copy
// LivingEntity.isSensitiveToWater() as boolean

myLivingEntity.isSensitiveToWater();

Name: isSleeping

Return Type: boolean

ZenScript
Copy
// LivingEntity.isSleeping() as boolean

myLivingEntity.isSleeping();

Link to isSuppressingSlidingDownLadder

Name: isSuppressingSlidingDownLadder

Return Type: boolean

ZenScript
Copy
// LivingEntity.isSuppressingSlidingDownLadder() as boolean

myLivingEntity.isSuppressingSlidingDownLadder();

Name: isUsingItem

Return Type: boolean

ZenScript
Copy
// LivingEntity.isUsingItem() as boolean

myLivingEntity.isUsingItem();

Link to isVisuallySwimming

Name: isVisuallySwimming

Return Type: boolean

ZenScript
Copy
// LivingEntity.isVisuallySwimming() as boolean

myLivingEntity.isVisuallySwimming();

Name: knockback

ZenScript
Copy
LivingEntity.knockback(x as double, y as double, z as double)
参数类型
参数
x
类型
double
参数
y
类型
double
参数
z
类型
double

Link to releaseUsingItem

Name: releaseUsingItem

ZenScript
Copy
// LivingEntity.releaseUsingItem()

myLivingEntity.releaseUsingItem();

Link to removeAllEffects

Name: removeAllEffects

Return Type: boolean

ZenScript
Copy
// LivingEntity.removeAllEffects() as boolean

myLivingEntity.removeAllEffects();

Name: removeEffect

Return Type: boolean

ZenScript
Copy
LivingEntity.removeEffect(effect as MobEffect) as boolean
参数类型
参数
effect
类型
MobEffect

Link to removeEffectNoUpdate

Name: removeEffectNoUpdate

Return Type: MobEffectInstance?

ZenScript
Copy
LivingEntity.removeEffectNoUpdate(effect as MobEffect?) as MobEffectInstance?
参数类型
参数
effect
类型
MobEffect?

Link to setAbsorptionAmount

Name: setAbsorptionAmount

ZenScript
Copy
LivingEntity.setAbsorptionAmount(absorption as float)
参数类型
参数
absorption
类型
float

Name: setArrowCount

ZenScript
Copy
LivingEntity.setArrowCount(count as int)
参数类型
参数
count
类型
int

Link to setDiscardFriction

Name: setDiscardFriction

ZenScript
Copy
LivingEntity.setDiscardFriction(discardFriction as boolean)
参数类型
参数
discardFriction
类型
布尔值

Name: setHealth

ZenScript
Copy
LivingEntity.setHealth(health as float)
参数类型
参数
health
类型
float

Name: setItemInHand

ZenScript
Copy
LivingEntity.setItemInHand(hand as InteractionHand, stack as ItemStack)
参数类型
参数
hand
类型
InteractionHand
参数
堆叠
类型
物品应用

Name: setJumping

ZenScript
Copy
LivingEntity.setJumping(jumping as boolean)
参数类型
参数
jumping
类型
布尔值

Link to setLastHurtByMob

Name: setLastHurtByMob

ZenScript
Copy
LivingEntity.setLastHurtByMob(entity as LivingEntity?)
参数类型
参数
entity
类型
LivingEntity?

Link to setLastHurtByPlayer

Name: setLastHurtByPlayer

ZenScript
Copy
LivingEntity.setLastHurtByPlayer(player as Player?)
参数类型
参数
player
类型
Player?

Name: setLastHurtMob

ZenScript
Copy
LivingEntity.setLastHurtMob(entity as Entity)
参数类型
参数
entity
类型
Entity

Name: setNoActionTime

ZenScript
Copy
LivingEntity.setNoActionTime(idleTime as int)
参数类型
参数
idleTime
类型
int

Name: setSleepingPos

ZenScript
Copy
LivingEntity.setSleepingPos(pos as BlockPos)
参数类型
参数
类型
BlockPos

Name: setSpeed

ZenScript
Copy
LivingEntity.setSpeed(speed as float)
参数类型
参数
speed
类型
float

Name: setStingerCount

ZenScript
Copy
LivingEntity.setStingerCount(count as int)
参数类型
参数
count
类型
int

Link to shouldDiscardFriction

Name: shouldDiscardFriction

Return Type: boolean

ZenScript
Copy
// LivingEntity.shouldDiscardFriction() as boolean

myLivingEntity.shouldDiscardFriction();

Name: startSleeping

ZenScript
Copy
LivingEntity.startSleeping(pos as BlockPos)
参数类型
参数
类型
BlockPos

Name: startUsingItem

ZenScript
Copy
LivingEntity.startUsingItem(param0 as InteractionHand)
参数类型
参数
param0
类型
InteractionHand

Name: stopSleeping

ZenScript
Copy
// LivingEntity.stopSleeping()

myLivingEntity.stopSleeping();

Name: stopUsingItem

ZenScript
Copy
// LivingEntity.stopUsingItem()

myLivingEntity.stopUsingItem();

Name: swing

ZenScript
Copy
LivingEntity.swing(hand as InteractionHand)
参数类型
参数
hand
类型
InteractionHand

Name: swing

ZenScript
Copy
LivingEntity.swing(hand as InteractionHand, updateSelf as boolean)
参数类型
参数
hand
类型
InteractionHand
参数
updateSelf
类型
布尔值

Name: travel

ZenScript
Copy
LivingEntity.travel(vec as Vec3)
参数类型
参数
vec
类型
Vec3
名称类型可获得可设置
名称
absorptionAmount
类型
float
可获得
true
可设置
false
名称
activeEFfectsMap
类型
MobEffectInstance[MobEffect]
可获得
true
可设置
false
名称
activeEffects
类型
Collection<MobEffectInstance>
可获得
true
可设置
false
名称
armorCoverPercentage
类型
float
可获得
true
可设置
false
名称
armorValue
类型
int
可获得
true
可设置
false
名称
arrowCount
类型
int
可获得
true
可设置
false
名称
attackable #可攻击的
类型
布尔值
可获得
true
可设置
false
名称
bedOrientation
类型
Direction?
可获得
true
可设置
false
名称
canBeSeenAsEnemy
类型
布尔值
可获得
true
可设置
false
名称
canBeSeenByAnyone
类型
布尔值
可获得
true
可设置
false
名称
canBreatheUnderwater #可以水下呼吸
类型
布尔值
可获得
true
可设置
false
名称
fallFlyingTicks
类型
int
可获得
true
可设置
false
名称
health
类型
float
可获得
true
可设置
false
名称
isAffectedByPotions
类型
布尔值
可获得
true
可设置
false
名称
isAutoSpinAttack
类型
布尔值
可获得
true
可设置
false
名称
isBaby
类型
布尔值
可获得
true
可设置
false
名称
isBlocking
类型
布尔值
可获得
true
可设置
false
名称
isCurrentlyGlowing
类型
布尔值
可获得
true
可设置
false
名称
isDeadOrDying
类型
布尔值
可获得
true
可设置
false
名称
isFallFlying
类型
布尔值
可获得
true
可设置
false
名称
isInvertedHealAndHarm
类型
布尔值
可获得
true
可设置
false
名称
isSensitiveToWater
类型
布尔值
可获得
true
可设置
false
名称
isSleeping
类型
布尔值
可获得
true
可设置
false
名称
isSuppressingSlidingDownLadder
类型
布尔值
可获得
true
可设置
false
名称
isUsingItem
类型
布尔值
可获得
true
可设置
false
名称
isVisuallySwimming
类型
布尔值
可获得
true
可设置
false
名称
jumpBoostPower
类型
double
可获得
true
可设置
false
名称
killCredit
类型
LivingEntity?
可获得
true
可设置
false
名称
lastClimbablePos
类型
BlockPos?
可获得
true
可设置
false
名称
lastDamageSource
类型
DamageSource?
可获得
true
可设置
false
名称
lastHurtByMob
类型
LivingEntity?
可获得
true
可设置
false
名称
lastHurtByMobTimestamp
类型
int
可获得
true
可设置
false
名称
lastHurtMob
类型
LivingEntity
可获得
true
可设置
false
名称
lastHurtMobTimestamp
类型
int
可获得
true
可设置
false
名称
lootTable
类型
资源位置
可获得
true
可设置
false
名称
mainArm
类型
HumanoidArm
可获得
true
可设置
false
名称
mainHandItem
类型
物品应用
可获得
true
可设置
false
名称
maxHealth
类型
float
可获得
true
可设置
false
名称
mobType
类型
MobType
可获得
true
可设置
false
名称
noActionTime
类型
int
可获得
true
可设置
false
名称
offHandItem
类型
物品应用
可获得
true
可设置
false
名称
random
类型
Random
可获得
true
可设置
false
名称
scale
类型
float
可获得
true
可设置
false
名称
shouldDiscardFriction
类型
布尔值
可获得
true
可设置
false
名称
sleepingPos
类型
BlockPos?
可获得
true
可设置
false
名称
speed
类型
float
可获得
true
可设置
false
名称
stingerCount
类型
int
可获得
true
可设置
false
名称
ticksUsingItem
类型
int
可获得
true
可设置
false
名称
useItem
类型
物品应用
可获得
true
可设置
false
名称
useItemRemainingTicks
类型
int
可获得
true
可设置
false
名称
usedItemHand
类型
InteractionHand
可获得
true
可设置
false
名称
voicePitch
类型
float
可获得
true
可设置
false