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.
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
LivingEntity.addEffect(effectInstance as MobEffectInstance) as boolean
Parameter | Type |
---|---|
Parameter effectInstance | Type MobEffectInstance |
Return Type: boolean
LivingEntity.addEffect(effectInstance as MobEffectInstance, entity as Entity?) as boolean
Parameter | Type |
---|---|
Parameter effectInstance | Type MobEffectInstance |
Parameter entity | Type Entity? |
Return Type: boolean
// LivingEntity.attackable() as boolean
myLivingEntity.attackable();
Return Type: boolean
LivingEntity.canAttack(target as LivingEntity) as boolean
Parameter | Type |
---|---|
Parameter target | Type LivingEntity |
Return Type: boolean
LivingEntity.canBeAffected(effectInstance as MobEffectInstance) as boolean
Parameter | Type |
---|---|
Parameter effectInstance | Type MobEffectInstance |
Return Type: boolean
// LivingEntity.canBeSeenAsEnemy() as boolean
myLivingEntity.canBeSeenAsEnemy();
Return Type: boolean
// LivingEntity.canBeSeenByAnyone() as boolean
myLivingEntity.canBeSeenByAnyone();
Return Type: boolean
// LivingEntity.canBreatheUnderwater() as boolean
myLivingEntity.canBreatheUnderwater();
Return Type: boolean
// LivingEntity.canSpawnSoulSpeedParticle() as boolean
myLivingEntity.canSpawnSoulSpeedParticle();
Return Type: boolean
LivingEntity.canStandOnFluid(fluid as Fluid) as boolean
Parameter | Type |
---|---|
Parameter fluid | Type Fluid |
Return Type: boolean
LivingEntity.canTakeItem(stack as ItemStack) as boolean
Parameter | Type |
---|---|
Parameter stack | Type ItemStack |
// LivingEntity.clearSleepingPos()
myLivingEntity.clearSleepingPos();
LivingEntity.die(source as DamageSource)
Parameter | Type |
---|---|
Parameter source | Type DamageSource |
Return Type: boolean
LivingEntity.doHurtTarget(entity as Entity) as boolean
Parameter | Type |
---|---|
Parameter entity | Type Entity |
LivingEntity.forceAddEffect(effectInstance as MobEffectInstance, entity as Entity?)
Parameter | Type |
---|---|
Parameter effectInstance | Type MobEffectInstance |
Parameter entity | Type Entity? |
Return Type: float
// LivingEntity.getAbsorptionAmount() as float
myLivingEntity.getAbsorptionAmount();
Return Type: Collection<MobEffectInstance>
// LivingEntity.getActiveEffects() as Collection<MobEffectInstance>
myLivingEntity.getActiveEffects();
Return Type: MobEffectInstance[MobEffect]
// LivingEntity.getActiveEffectsMap() as MobEffectInstance[MobEffect]
myLivingEntity.getActiveEffectsMap();
Return Type: float
// LivingEntity.getArmorCoverPercentage() as float
myLivingEntity.getArmorCoverPercentage();
Return Type: int
// LivingEntity.getArmorValue() as int
myLivingEntity.getArmorValue();
Return Type: int
// LivingEntity.getArrowCount() as int
myLivingEntity.getArrowCount();
Return Type: AttributeInstance?
LivingEntity.getAttribute(attribute as Attribute) as AttributeInstance?
Parameter | Type |
---|---|
Parameter attribute | Type Attribute |
Return Type: double
LivingEntity.getAttributeBaseValue(attribute as Attribute) as double
Parameter | Type |
---|---|
Parameter attribute | Type Attribute |
Return Type: double
LivingEntity.getAttributeValue(attribute as Attribute) as double
Parameter | Type |
---|---|
Parameter attribute | Type Attribute |
Return Type: Direction?
// LivingEntity.getBedOrientation() as Direction?
myLivingEntity.getBedOrientation();
Return Type: MobEffectInstance?
LivingEntity.getEffect(effect as MobEffect) as MobEffectInstance?
Parameter | Type |
---|---|
Parameter effect | Type MobEffect |
Return Type: int
// LivingEntity.getFallFlyingTicks() as int
myLivingEntity.getFallFlyingTicks();
Return Type: float
// LivingEntity.getHealth() as float
myLivingEntity.getHealth();
Return Type: ItemStack
LivingEntity.getItemBySlot(slot as EquipmentSlot) as ItemStack
Parameter | Type |
---|---|
Parameter slot | Type EquipmentSlot |
Return Type: ItemStack
LivingEntity.getItemInHand(hand as InteractionHand) as ItemStack
Parameter | Type |
---|---|
Parameter hand | Type InteractionHand |
Return Type: double
// LivingEntity.getJumpBoostPower() as double
myLivingEntity.getJumpBoostPower();
Return Type: LivingEntity?
// LivingEntity.getKillCredit() as LivingEntity?
myLivingEntity.getKillCredit();
Return Type: BlockPos?
// LivingEntity.getLastClimbablePos() as BlockPos?
myLivingEntity.getLastClimbablePos();
Return Type: DamageSource?
// LivingEntity.getLastDamageSource() as DamageSource?
myLivingEntity.getLastDamageSource();
Return Type: LivingEntity?
// LivingEntity.getLastHurtByMob() as LivingEntity?
myLivingEntity.getLastHurtByMob();
Return Type: int
// LivingEntity.getLastHurtByMobTimestamp() as int
myLivingEntity.getLastHurtByMobTimestamp();
Return Type: LivingEntity
// LivingEntity.getLastHurtMob() as LivingEntity
myLivingEntity.getLastHurtMob();
Return Type: int
// LivingEntity.getLastHurtMobTimestamp() as int
myLivingEntity.getLastHurtMobTimestamp();
Return Type: ResourceLocation
// LivingEntity.getLootTable() as ResourceLocation
myLivingEntity.getLootTable();
Return Type: HumanoidArm
// LivingEntity.getMainArm() as HumanoidArm
myLivingEntity.getMainArm();
Return Type: ItemStack
// LivingEntity.getMainHandItem() as ItemStack
myLivingEntity.getMainHandItem();
Return Type: float
// LivingEntity.getMaxHealth() as float
myLivingEntity.getMaxHealth();
Return Type: MobType
// LivingEntity.getMobType() as MobType
myLivingEntity.getMobType();
Return Type: int
// LivingEntity.getNoActionTime() as int
myLivingEntity.getNoActionTime();
Return Type: ItemStack
// LivingEntity.getOffhandItem() as ItemStack
myLivingEntity.getOffhandItem();
Return Type: RandomSource
// LivingEntity.getRandom() as RandomSource
myLivingEntity.getRandom();
Return Type: float
// LivingEntity.getScale() as float
myLivingEntity.getScale();
Return Type: BlockPos?
// LivingEntity.getSleepingPos() as BlockPos?
myLivingEntity.getSleepingPos();
Return Type: float
// LivingEntity.getSpeed() as float
myLivingEntity.getSpeed();
Return Type: int
// LivingEntity.getStingerCount() as int
myLivingEntity.getStingerCount();
Return Type: float
LivingEntity.getSwimAmount(partialTicks as float) as float
Parameter | Type |
---|---|
Parameter partialTicks | Type float |
Return Type: int
// LivingEntity.getTicksUsingItem() as int
myLivingEntity.getTicksUsingItem();
Return Type: ItemStack
// LivingEntity.getUseItem() as ItemStack
myLivingEntity.getUseItem();
Return Type: int
// LivingEntity.getUseItemRemainingTicks() as int
myLivingEntity.getUseItemRemainingTicks();
Return Type: InteractionHand
// LivingEntity.getUsedItemHand() as InteractionHand
myLivingEntity.getUsedItemHand();
Return Type: double
LivingEntity.getVisibilityPercent(lookingEntity as Entity?) as double
Parameter | Type |
---|---|
Parameter lookingEntity | Type Entity? |
Return Type: float
// LivingEntity.getVoicePitch() as float
myLivingEntity.getVoicePitch();
Return Type: boolean
LivingEntity.hasEffect(effect as MobEffect) as boolean
Parameter | Type |
---|---|
Parameter effect | Type MobEffect |
Return Type: boolean
LivingEntity.hasItemInSlot(slot as EquipmentSlot) as boolean
Parameter | Type |
---|---|
Parameter slot | Type EquipmentSlot |
Return Type: boolean
LivingEntity.hasLineOfSight(entity as Entity) as boolean
Parameter | Type |
---|---|
Parameter entity | Type Entity |
LivingEntity.heal(amount as float)
Parameter | Type |
---|---|
Parameter amount | Type float |
Return Type: boolean
// LivingEntity.isAffectedByPotions() as boolean
myLivingEntity.isAffectedByPotions();
Return Type: boolean
// LivingEntity.isAutoSpinAttack() as boolean
myLivingEntity.isAutoSpinAttack();
Return Type: boolean
// LivingEntity.isBaby() as boolean
myLivingEntity.isBaby();
Return Type: boolean
// LivingEntity.isBlocking() as boolean
myLivingEntity.isBlocking();
Return Type: boolean
// LivingEntity.isCurrentlyGlowing() as boolean
myLivingEntity.isCurrentlyGlowing();
Return Type: boolean
LivingEntity.isDamageSourceBlocked(source as DamageSource) as boolean
Parameter | Type |
---|---|
Parameter source | Type DamageSource |
Return Type: boolean
// LivingEntity.isDeadOrDying() as boolean
myLivingEntity.isDeadOrDying();
Return Type: boolean
// LivingEntity.isFallFlying() as boolean
myLivingEntity.isFallFlying();
Return Type: boolean
LivingEntity.isHolding(item as ItemDefinition) as boolean
Parameter | Type |
---|---|
Parameter item | Type ItemDefinition |
Return Type: boolean
LivingEntity.isHolding(predicate as Predicate<ItemStack>) as boolean
Parameter | Type |
---|---|
Parameter predicate | Type Predicate<ItemStack> |
Return Type: boolean
// LivingEntity.isInvertedHealAndHarm() as boolean
myLivingEntity.isInvertedHealAndHarm();
Return Type: boolean
// LivingEntity.isSensitiveToWater() as boolean
myLivingEntity.isSensitiveToWater();
Return Type: boolean
// LivingEntity.isSleeping() as boolean
myLivingEntity.isSleeping();
Return Type: boolean
// LivingEntity.isSuppressingSlidingDownLadder() as boolean
myLivingEntity.isSuppressingSlidingDownLadder();
Return Type: boolean
// LivingEntity.isUsingItem() as boolean
myLivingEntity.isUsingItem();
Return Type: boolean
// LivingEntity.isVisuallySwimming() as boolean
myLivingEntity.isVisuallySwimming();
LivingEntity.knockback(x as double, y as double, z as double)
Parameter | Type |
---|---|
Parameter x | Type double |
Parameter y | Type double |
Parameter z | Type double |
// LivingEntity.releaseUsingItem()
myLivingEntity.releaseUsingItem();
Return Type: boolean
// LivingEntity.removeAllEffects() as boolean
myLivingEntity.removeAllEffects();
Return Type: boolean
LivingEntity.removeEffect(effect as MobEffect) as boolean
Parameter | Type |
---|---|
Parameter effect | Type MobEffect |
Return Type: MobEffectInstance?
LivingEntity.removeEffectNoUpdate(effect as MobEffect?) as MobEffectInstance?
Parameter | Type |
---|---|
Parameter effect | Type MobEffect? |
LivingEntity.setAbsorptionAmount(absorption as float)
Parameter | Type |
---|---|
Parameter absorption | Type float |
LivingEntity.setArrowCount(count as int)
Parameter | Type |
---|---|
Parameter count | Type int |
LivingEntity.setDiscardFriction(discardFriction as boolean)
Parameter | Type |
---|---|
Parameter discardFriction | Type boolean |
LivingEntity.setHealth(health as float)
Parameter | Type |
---|---|
Parameter health | Type float |
LivingEntity.setItemInHand(hand as InteractionHand, stack as ItemStack)
Parameter | Type |
---|---|
Parameter hand | Type InteractionHand |
Parameter stack | Type ItemStack |
LivingEntity.setJumping(jumping as boolean)
Parameter | Type |
---|---|
Parameter jumping | Type boolean |
LivingEntity.setLastHurtByMob(entity as LivingEntity?)
Parameter | Type |
---|---|
Parameter entity | Type LivingEntity? |
LivingEntity.setLastHurtByPlayer(player as Player?)
Parameter | Type |
---|---|
Parameter player | Type Player? |
LivingEntity.setLastHurtMob(entity as Entity)
Parameter | Type |
---|---|
Parameter entity | Type Entity |
LivingEntity.setNoActionTime(idleTime as int)
Parameter | Type |
---|---|
Parameter idleTime | Type int |
LivingEntity.setSleepingPos(pos as BlockPos)
Parameter | Type |
---|---|
Parameter pos | Type BlockPos |
LivingEntity.setSpeed(speed as float)
Parameter | Type |
---|---|
Parameter speed | Type float |
LivingEntity.setStingerCount(count as int)
Parameter | Type |
---|---|
Parameter count | Type int |
Return Type: boolean
// LivingEntity.shouldDiscardFriction() as boolean
myLivingEntity.shouldDiscardFriction();
LivingEntity.startSleeping(pos as BlockPos)
Parameter | Type |
---|---|
Parameter pos | Type BlockPos |
LivingEntity.startUsingItem(param0 as InteractionHand)
Parameter | Type |
---|---|
Parameter param0 | Type InteractionHand |
// LivingEntity.stopSleeping()
myLivingEntity.stopSleeping();
// LivingEntity.stopUsingItem()
myLivingEntity.stopUsingItem();
LivingEntity.swing(hand as InteractionHand)
Parameter | Type |
---|---|
Parameter hand | Type InteractionHand |
LivingEntity.swing(hand as InteractionHand, updateSelf as boolean)
Parameter | Type |
---|---|
Parameter hand | Type InteractionHand |
Parameter updateSelf | Type boolean |
LivingEntity.travel(vec as Vec3)
Parameter | Type |
---|---|
Parameter vec | Type Vec3 |
Properties
Name | Type | Has Getter | Has Setter |
---|---|---|---|
Name absorptionAmount | Type float | Has Getter true | Has Setter false |
Name activeEFfectsMap | Type MobEffectInstance[MobEffect] | Has Getter true | Has Setter false |
Name activeEffects | Type Collection<MobEffectInstance> | Has Getter true | Has Setter false |
Name armorCoverPercentage | Type float | Has Getter true | Has Setter false |
Name armorValue | Type int | Has Getter true | Has Setter false |
Name arrowCount | Type int | Has Getter true | Has Setter false |
Name attackable | Type boolean | Has Getter true | Has Setter false |
Name bedOrientation | Type Direction? | Has Getter true | Has Setter false |
Name canBeSeenAsEnemy | Type boolean | Has Getter true | Has Setter false |
Name canBeSeenByAnyone | Type boolean | Has Getter true | Has Setter false |
Name canBreatheUnderwater | Type boolean | Has Getter true | Has Setter false |
Name fallFlyingTicks | Type int | Has Getter true | Has Setter false |
Name health | Type float | Has Getter true | Has Setter false |
Name isAffectedByPotions | Type boolean | Has Getter true | Has Setter false |
Name isAutoSpinAttack | Type boolean | Has Getter true | Has Setter false |
Name isBaby | Type boolean | Has Getter true | Has Setter false |
Name isBlocking | Type boolean | Has Getter true | Has Setter false |
Name isCurrentlyGlowing | Type boolean | Has Getter true | Has Setter false |
Name isDeadOrDying | Type boolean | Has Getter true | Has Setter false |
Name isFallFlying | Type boolean | Has Getter true | Has Setter false |
Name isInvertedHealAndHarm | Type boolean | Has Getter true | Has Setter false |
Name isSensitiveToWater | Type boolean | Has Getter true | Has Setter false |
Name isSleeping | Type boolean | Has Getter true | Has Setter false |
Name isSuppressingSlidingDownLadder | Type boolean | Has Getter true | Has Setter false |
Name isUsingItem | Type boolean | Has Getter true | Has Setter false |
Name isVisuallySwimming | Type boolean | Has Getter true | Has Setter false |
Name jumpBoostPower | Type double | Has Getter true | Has Setter false |
Name killCredit | Type LivingEntity? | Has Getter true | Has Setter false |
Name lastClimbablePos | Type BlockPos? | Has Getter true | Has Setter false |
Name lastDamageSource | Type DamageSource? | Has Getter true | Has Setter false |
Name lastHurtByMob | Type LivingEntity? | Has Getter true | Has Setter false |
Name lastHurtByMobTimestamp | Type int | Has Getter true | Has Setter false |
Name lastHurtMob | Type LivingEntity | Has Getter true | Has Setter false |
Name lastHurtMobTimestamp | Type int | Has Getter true | Has Setter false |
Name lootTable | Type ResourceLocation | Has Getter true | Has Setter false |
Name mainArm | Type HumanoidArm | Has Getter true | Has Setter false |
Name mainHandItem | Type ItemStack | Has Getter true | Has Setter false |
Name maxHealth | Type float | Has Getter true | Has Setter false |
Name mobType | Type MobType | Has Getter true | Has Setter false |
Name noActionTime | Type int | Has Getter true | Has Setter false |
Name offHandItem | Type ItemStack | Has Getter true | Has Setter false |
Name random | Type RandomSource | Has Getter true | Has Setter false |
Name scale | Type float | Has Getter true | Has Setter false |
Name shouldDiscardFriction | Type boolean | Has Getter true | Has Setter false |
Name sleepingPos | Type BlockPos? | Has Getter true | Has Setter false |
Name speed | Type float | Has Getter true | Has Setter false |
Name stingerCount | Type int | Has Getter true | Has Setter false |
Name ticksUsingItem | Type int | Has Getter true | Has Setter false |
Name useItem | Type ItemStack | Has Getter true | Has Setter false |
Name useItemRemainingTicks | Type int | Has Getter true | Has Setter false |
Name usedItemHand | Type InteractionHand | Has Getter true | Has Setter false |
Name voicePitch | Type float | Has Getter true | Has Setter false |