Class LivingEntity
- All Implemented Interfaces:
CommandOutput,Nameable
- Direct Known Subclasses:
ArmorStandEntity,MobEntity,PlayerEntity
public abstract class LivingEntity extends Entity
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.entity.Entity
Entity.PositionUpdater -
Field Summary
Fields inherited from class net.minecraft.entity.Entity
age, chunkX, chunkY, chunkZ, dataTracker, distanceTraveled, fallDistance, field_25599, firstUpdate, FLAGS, fluidHeight, glowing, horizontalCollision, horizontalSpeed, ignoreCameraFrustum, inanimate, inNetherPortal, lastNetherPortalPosition, lastRenderX, lastRenderY, lastRenderZ, LOGGER, movementMultiplier, netherPortalTime, noClip, onGround, pitch, POSE, prevHorizontalSpeed, prevPitch, prevX, prevY, prevYaw, prevZ, pushSpeedReduction, random, removed, ridingCooldown, stepHeight, submergedInWater, teleporting, timeUntilRegen, touchingWater, updateNeeded, uuid, uuidString, velocityDirty, velocityModified, verticalCollision, world, yawFields inherited from interface net.minecraft.server.command.CommandOutput
DUMMY -
Constructor Summary
Constructors Modifier Constructor Description protectedLivingEntity(EntityType<? extends LivingEntity> type, World world) -
Method Summary
Modifier and Type Method Description protected voidaddSoulSpeedBoostIfNeeded()booleanaddStatusEffect(StatusEffectInstance effect)voidanimateDamage()protected floatapplyArmorToDamage(DamageSource source, float amount)private Vec3dapplyClimbingSpeed(Vec3d motion)protected voidapplyDamage(DamageSource source, float amount)protected floatapplyEnchantmentsToDamage(DamageSource source, float amount)private voidapplyFoodEffects(ItemStack stack, World world, LivingEntity targetEntity)protected voidapplyMovementEffects(BlockPos pos)voidapplyStatusEffect(StatusEffectInstance effect)protected voidattackLivingEntity(LivingEntity target)voidbaseTick()private booleanblockedByShield(DamageSource source)booleancanBeRiddenInWater()booleancanBreatheInWater()private booleancanEnterTrapdoor(BlockPos pos, BlockState state)booleancanEquip(ItemStack stack)booleancanHaveStatusEffect(StatusEffectInstance effect)booleancanMoveVoluntarily()booleancanSee(Entity entity)booleancanTarget(EntityType<?> type)booleancanTarget(LivingEntity target)booleancanWalkOnFluid(Fluid fluid)voidclearActiveItem()protected voidclearPotionSwirls()voidclearSleepingPosition()booleanclearStatusEffects()booleancollides()protected intcomputeFallDamage(float fallDistance, float damageMultiplier)protected voidconsumeItem()static booleancontainsOnlyAmbientEffects(Collection<StatusEffectInstance> effects)protected Brain.Profile<?>createBrainProfile()static DefaultAttributeContainer.BuildercreateLivingAttributes()Packet<?>createSpawnPacket()booleandamage(DamageSource source, float amount)protected voiddamageArmor(DamageSource source, float amount)protected voiddamageShield(float amount)protected Brain<?>deserializeBrain(com.mojang.serialization.Dynamic<?> dynamic)protected voiddisplaySoulSpeedEffects()protected voiddrop(DamageSource source)protected voiddropEquipment(DamageSource source, int lootingMultiplier, boolean allowDrops)protected voiddropInventory()protected voiddropLoot(DamageSource source, boolean causedByPlayer)protected voiddropXp()Drops experience when this entity is killed.ItemStackeatFood(World world, ItemStack stack)voidendCombat()voidenterCombat()abstract voidequipStack(EquipmentSlot slot, ItemStack stack)protected voidfall(double heightDifference, boolean onGround, BlockState landedState, BlockPos landedPosition)floatgetAbsorptionAmount()protected floatgetActiveEyeHeight(EntityPose pose, EntityDimensions dimensions)HandgetActiveHand()ItemStackgetActiveItem()Map<StatusEffect,StatusEffectInstance>getActiveStatusEffects()intgetArmor()abstract Iterable<ItemStack>getArmorItems()floatgetArmorVisibility()ItemStackgetArrowType(ItemStack stack)doublegetAttackDistanceScalingFactor(Entity entity)LivingEntitygetAttacker()LivingEntitygetAttacking()doublegetAttributeBaseValue(EntityAttribute attribute)EntityAttributeInstancegetAttributeInstance(EntityAttribute attribute)AttributeContainergetAttributes()doublegetAttributeValue(EntityAttribute attribute)protected floatgetBaseMovementSpeedMultiplier()BlockStategetBlockState()BoxgetBoundingBox(EntityPose pose)Brain<?>getBrain()Optional<BlockPos>getClimbingPos()DamageTrackergetDamageTracker()protected SoundEventgetDeathSound()intgetDespawnCounter()EntityDimensionsgetDimensions(EntityPose pose)protected SoundEventgetDrinkSound(ItemStack stack)SoundEventgetEatSound(ItemStack stack)private static bytegetEquipmentBreakStatus(EquipmentSlot slot)abstract ItemStackgetEquippedStack(EquipmentSlot slot)protected floatgetEyeHeight(EntityPose pose, EntityDimensions dimensions)protected SoundEventgetFallSound(int distance)EntityGroupgetGroup()private intgetHandSwingDuration()floatgetHandSwingProgress(float tickDelta)floatgetHeadYaw()floatgetHealth()protected SoundEventgetHurtSound(DamageSource source)intgetItemUseTime()intgetItemUseTimeLeft()protected floatgetJumpVelocity()intgetLastAttackedTime()intgetLastAttackTime()floatgetLeaningPitch(float tickDelta)protected LootContext.BuildergetLootContextBuilder(boolean causedByPlayer, DamageSource source)IdentifiergetLootTable()abstract ArmgetMainArm()ItemStackgetMainHandStack()floatgetMaxHealth()floatgetMovementSpeed()private floatgetMovementSpeed(float slipperiness)protected intgetNextAirOnLand(int air)protected intgetNextAirUnderwater(int air)ItemStackgetOffHandStack()ImmutableList<EntityPose>getPoses()LivingEntitygetPrimeAdversary()RandomgetRandom()DamageSourcegetRecentDamageSource()intgetRoll()floatgetScaleFactor()DirectiongetSleepingDirection()Optional<BlockPos>getSleepingPosition()protected floatgetSoundPitch()protected floatgetSoundVolume()ItemStackgetStackInHand(Hand hand)StatusEffectInstancegetStatusEffect(StatusEffect effect)Collection<StatusEffectInstance>getStatusEffects()intgetStingerCount()intgetStuckArrowCount()protected floatgetVelocityMultiplier()BoxgetVisibilityBoundingBox()protected intgetXpToDrop(PlayerEntity player)Called when this entity is killed and returns the amount of experience to drop.floatgetYaw(float tickDelta)booleanhandleFallDamage(float fallDistance, float damageMultiplier)voidhandleStatus(byte status)booleanhasStackEquipped(EquipmentSlot slot)booleanhasStatusEffect(StatusEffect effect)voidheal(float amount)Heals this entity by the givenamountof half-hearts.booleanhurtByWater()protected voidinitDataTracker()booleanisAffectedBySplashPotions()booleanisAlive()booleanisBaby()booleanisBlocking()booleanisClimbing()booleanisDead()booleanisFallFlying()booleanisHolding(Predicate<Item> predicate)Checks if this entity is holding a certain item.booleanisHolding(Item item)Checks if this entity is holding a certain item.booleanisHoldingOntoLadder()protected booleanisImmobile()booleanisInsideWall()booleanisInSwimmingPose()booleanisMobOrPlayer()protected booleanisOnSoulSpeedBlock()booleanisPushable()booleanisSleeping()private booleanisSleepingInBed()booleanisTarget(LivingEntity entity, TargetPredicate predicate)booleanisUndead()booleanisUsingItem()booleanisUsingRiptide()protected voidjump()voidkill()protected voidknockback(LivingEntity target)protected voidknockDownwards()voidlookAt(EntityAnchorArgumentType.EntityAnchor anchorPoint, Vec3d target)protected voidmarkEffectsDirty()Vec3dmethod_26317(double double2, boolean bool, Vec3d vec3d)Vec3dmethod_26318(Vec3d vec3d, float float2)voidmethod_29242(LivingEntity livingEntity, boolean bool)voidmethod_29499(ItemEntity itemEntity)protected booleanmethod_29500(BlockState blockState)protected booleanmethod_29920()private voidmethod_30121(Map<EquipmentSlot,ItemStack> map)private voidmethod_30122(EquipmentSlot equipmentSlot, ItemStack itemStack)private voidmethod_30123(Map<EquipmentSlot,ItemStack> map)private voidmethod_30124(EquipmentSlot equipmentSlot, ItemStack itemStack)private ItemStackmethod_30125(EquipmentSlot equipmentSlot)private ItemStackmethod_30126(EquipmentSlot equipmentSlot)private voidmethod_30127()private voidmethod_30128()private Map<EquipmentSlot,ItemStack>method_30129()protected Vec3dmethod_30633(Direction.Axis axis, PortalUtil.Rectangle rectangle)static Vec3dmethod_31079(Vec3d vec3d)voidonAttacking(Entity target)voidonDeath(DamageSource source)private voidonDismounted(Entity vehicle)protected voidonEquipStack(ItemStack stack)protected voidonKilledBy(LivingEntity adversary)Performs secondary effects after this mob has been killed.protected voidonStatusEffectApplied(StatusEffectInstance effect)protected voidonStatusEffectRemoved(StatusEffectInstance effect)protected voidonStatusEffectUpgraded(StatusEffectInstance effect, boolean reapplyEffect)voidonTrackedDataSet(TrackedData<?> data)protected voidplayBlockFallSound()private voidplayEquipmentBreakEffects(ItemStack stack)protected voidplayHurtSound(DamageSource source)protected voidpushAway(Entity entity)voidpushAwayFrom(Entity entity)voidreadCustomDataFromNbt(NbtCompound nbt)protected voidremoveSoulSpeedBoost()booleanremoveStatusEffect(StatusEffect type)Removes a status effect from this entity.StatusEffectInstanceremoveStatusEffectInternal(StatusEffect type)Removes a status effect from this entity without calling any listener.protected voidscheduleVelocityUpdate()voidsendEquipmentBreakStatus(EquipmentSlot slot)voidsendPickup(Entity item, int count)voidsendToolBreakStatus(Hand hand)voidsetAbsorptionAmount(float amount)voidsetAttacker(LivingEntity attacker)voidsetAttacking(PlayerEntity attacking)voidsetBodyYaw(float bodyYaw)voidsetCurrentHand(Hand hand)voidsetDespawnCounter(int despawnCounter)voidsetHeadYaw(float headYaw)voidsetHealth(float health)voidsetJumping(boolean jumping)protected voidsetLivingFlag(int mask, boolean value)voidsetMovementSpeed(float movementSpeed)voidsetNearbySongPlaying(BlockPos songPosition, boolean playing)voidsetOnGround(boolean onGround)private voidsetPositionInBed(BlockPos pos)voidsetRiptideTicks(int riptideTicks)voidsetSleepingPosition(BlockPos pos)voidsetSprinting(boolean sprinting)voidsetStackInHand(Hand hand, ItemStack stack)voidsetStingerCount(int stingerCount)voidsetStuckArrowCount(int stuckArrowCount)protected booleanshouldAlwaysDropXp()Returns if this entity may always drop experience, skipping any other checks.booleanshouldDisplaySoulSpeedEffects()protected booleanshouldDropLoot()protected booleanshouldDropXp()Returns if this entity should drop experience on death when the doMobLoot game rule is enabled and has been attacked by a player.booleanshouldRenderName()private booleanshouldSpawnConsumptionEffects()voidsleep(BlockPos pos)protected voidspawnConsumptionEffects(ItemStack stack, int particleCount)private voidspawnItemParticles(ItemStack stack, int count)voidstopRiding()voidstopUsingItem()protected voidswimUpward(Tag<Fluid> fluid)voidswingHand(Hand hand)voidswingHand(Hand hand, boolean fromServerPlayer)voidtakeKnockback(float float2, double double2, double double3)protected voidtakeShieldHit(LivingEntity attacker)booleanteleport(double x, double y, double z, boolean particleEffects)voidtick()private voidtickActiveItemStack()protected voidtickCramming()private voidtickFallFlying()protected voidtickHandSwing()protected voidtickInVoid()Called when the entity is 64 blocks below the world's minimum Y position which is0.voidtickMovement()protected voidtickNewAi()voidtickRiding()protected voidtickRiptide(Box a, Box b)protected voidtickStatusEffects()voidtravel(Vec3d movementInput)booleantryAttack(Entity target)private booleantryUseTotem(DamageSource source)protected floatturnHead(float bodyRotation, float headRotation)private voidupdateLeaningPitch()protected voidupdatePostDeath()protected voidupdatePotionVisibility()voidupdateTrackedHeadRotation(float yaw, int interpolationSteps)voidupdateTrackedPositionAndAngles(double x, double y, double z, float yaw, float pitch, int interpolationSteps, boolean interpolate)voidwakeUp()voidwriteCustomDataToNbt(NbtCompound nbt)Methods inherited from class net.minecraft.entity.Entity
addPassenger, addScoreboardTag, addVelocity, adjustMovementForCollisions, adjustMovementForCollisions, adjustMovementForPiston, adjustMovementForSneaking, adjustSingleAxisMovementForCollisions, afterSpawn, applyMirror, applyRotation, bypassesLandingEffects, bypassesSteppingEffects, calculateBoundsForPose, calculateDimensions, calculateNextStepSoundDistance, canAddPassenger, canAvoidTraps, canBeSpectated, canClimb, canExplosionDestroyBlock, canStartRiding, canUsePortals, changeLookDirection, checkBlockCollision, checkDespawn, checkWaterState, collidesWith, copyFrom, copyPositionAndRotation, dealDamage, detach, distanceTo, doesNotCollide, doesRenderOnFire, dropItem, dropItem, dropStack, dropStack, entityDataRequiresOperator, equals, equip, extinguish, getAir, getBlockPos, getBodyY, getBoundingBox, getBrightnessAtEyes, getBurningDuration, getCameraPosVec, getClientCameraPosVec, getCommandSource, getCustomName, getDataTracker, getDefaultName, getDefaultNetherPortalCooldown, getDisplayName, getEffectiveExplosionResistance, getEntityId, getEntityName, getEntityWorld, getEyeHeight, getEyeY, getFireTicks, getFlag, getFluidHeight, getHeight, getHeightOffset, getHighSpeedSplashSound, getHorizontalFacing, getHoverEvent, getItemsEquipped, getItemsHand, getJumpVelocityMultiplier, getLandingBlockState, getLandingPos, getMaxAir, getMaxNetherPortalTime, getMountedHeightOffset, getMovementDirection, getName, getOppositeRotationVector, getOppositeRotationVector, getParticleX, getParticleZ, getPassengerDismountOffset, getPassengerList, getPassengersDeep, getPermissionLevel, getPistonBehavior, getPitch, getPos, getPose, getPrimaryPassenger, getRandomBodyY, getRenderDistanceMultiplier, getRootVehicle, getRotationClient, getRotationVec, getRotationVecClient, getRotationVector, getRotationVector, getSafeFallDistance, getSavedEntityId, getScoreboardTags, getScoreboardTeam, getServer, getSoundCategory, getSplashSound, getStandingEyeHeight, getSwimSound, getTargetingMargin, getTeamColorValue, getTeleportTarget, getTrackedPosition, getType, getUuid, getUuidAsString, getVehicle, getVelocity, getVelocityAffectingPos, getWidth, getX, getY, getZ, handleAttack, hasCustomName, hashCode, hasNetherPortalCooldown, hasNoGravity, hasPassenger, hasPassengerDeep, hasPassengers, hasPassengerType, hasPermissionLevel, hasPlayerRider, hasVehicle, hasWings, interact, interactAt, isAttackable, isChunkPosUpdateRequested, isCollidable, isConnectedThroughVehicle, isCustomNameVisible, isDescending, isFireImmune, isGlowing, isImmuneToExplosion, isInLava, isInRange, isInsideWaterOrBubbleColumn, isInSneakingPose, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableTo, isLiving, isLogicalSideForUpdatingMovement, isOnFire, isOnGround, isPartOf, isPushedByFluids, isSilent, isSneaking, isSneaky, isSpectator, isSprinting, isSubmergedIn, isSubmergedInWater, isSwimming, isTeammate, isTeamPlayer, isTouchingWater, isTouchingWaterOrRain, isWet, method_29239, method_29241, method_29919, method_30076, method_30330, method_30632, method_30950, method_30951, move, moveToBoundingBoxCenter, moveToWorld, offsetX, offsetZ, onBlockCollision, onBubbleColumnCollision, onBubbleColumnSurfaceCollision, onKilledOther, onPassengerLookAround, onPlayerCollision, onStartedTrackingBy, onStoppedTrackingBy, onStruckByLightning, onSwimmingStart, playFlySound, playSound, playStepSound, playSwimSound, populateCrashReport, pushOutOfBlocks, raycast, readNbt, refreshPosition, refreshPositionAfterTeleport, refreshPositionAfterTeleport, refreshPositionAndAngles, refreshPositionAndAngles, remove, removeAllPassengers, removePassenger, removeScoreboardTag, requestTeleport, resetNetherPortalCooldown, resetPosition, saveNbt, saveSelfNbt, sendSystemMessage, setAir, setBoundingBox, setCustomName, setCustomNameVisible, setEntityId, setFireTicks, setFlag, setGlowing, setInNetherPortal, setInvisible, setInvulnerable, setNoGravity, setOnFireFor, setOnFireFromLava, setPos, setPose, setPosition, setRenderDistanceMultiplier, setRotation, setSilent, setSneaking, setSwimming, setUuid, setVelocity, setVelocity, setVelocityClient, setWorld, shouldBroadcastConsoleToOps, shouldLeaveSwimmingPose, shouldReceiveFeedback, shouldRender, shouldRender, shouldSetPositionOnLoad, shouldSpawnSprintingParticles, shouldTrackOutput, slowMovement, spawnSprintingParticles, squaredDistanceTo, squaredDistanceTo, squaredDistanceTo, squaredHorizontalLength, startRiding, startRiding, streamPassengersRecursively, teleport, teleportRequested, tickNetherPortal, tickNetherPortalCooldown, toNbtList, toNbtList, toString, updateKilledAdvancementCriterion, updateMovementInFluid, updatePassengerForDismount, updatePassengerPosition, updatePosition, updatePositionAndAngles, updateSwimming, updateTrackedPosition, updateTrackedPosition, updateVelocity, updateWaterState, wouldPoseNotCollide, writeNbt
-
Field Details
-
SPRINTING_SPEED_BOOST_ID
-
SOUL_SPEED_BOOST_ID
-
SPRINTING_SPEED_BOOST
-
LIVING_FLAGS
-
HEALTH
-
POTION_SWIRLS_COLOR
-
POTION_SWIRLS_AMBIENT
-
STUCK_ARROW_COUNT
-
STINGER_COUNT
-
SLEEPING_POSITION
-
SLEEPING_DIMENSIONS
-
attributes
-
damageTracker
-
activeStatusEffects
-
equippedHand
-
equippedArmor
-
handSwinging
public boolean handSwinging -
preferredHand
-
handSwingTicks
public int handSwingTicks -
stuckArrowTimer
public int stuckArrowTimer -
stuckStingerTimer
public int stuckStingerTimer -
hurtTime
public int hurtTime -
maxHurtTime
public int maxHurtTime -
knockbackVelocity
public float knockbackVelocity -
deathTime
public int deathTime -
lastHandSwingProgress
public float lastHandSwingProgress -
handSwingProgress
public float handSwingProgress -
lastAttackedTicks
protected int lastAttackedTicks -
lastLimbDistance
public float lastLimbDistance -
limbDistance
public float limbDistance -
limbAngle
public float limbAngle -
defaultMaxHealth
public final int defaultMaxHealth- See Also:
- Constant Field Values
-
randomLargeSeed
public final float randomLargeSeed -
randomSmallSeed
public final float randomSmallSeed -
bodyYaw
public float bodyYaw -
prevBodyYaw
public float prevBodyYaw -
headYaw
public float headYaw -
prevHeadYaw
public float prevHeadYaw -
flyingSpeed
public float flyingSpeed -
attackingPlayer
-
playerHitTimer
protected int playerHitTimer -
dead
protected boolean dead -
despawnCounter
protected int despawnCounter -
prevStepBobbingAmount
protected float prevStepBobbingAmount -
stepBobbingAmount
protected float stepBobbingAmount -
lookDirection
protected float lookDirection -
prevLookDirection
protected float prevLookDirection -
field_6215
protected float field_6215 -
scoreAmount
protected int scoreAmount -
lastDamageTaken
protected float lastDamageTaken -
jumping
protected boolean jumping -
sidewaysSpeed
public float sidewaysSpeed -
upwardSpeed
public float upwardSpeed -
forwardSpeed
public float forwardSpeed -
bodyTrackingIncrements
protected int bodyTrackingIncrements -
serverX
protected double serverX -
serverY
protected double serverY -
serverZ
protected double serverZ -
serverYaw
protected double serverYaw -
serverPitch
protected double serverPitch -
serverHeadYaw
protected double serverHeadYaw -
headTrackingIncrements
protected int headTrackingIncrements -
effectsChanged
private boolean effectsChanged -
attacker
-
lastAttackedTime
private int lastAttackedTime -
attacking
-
lastAttackTime
private int lastAttackTime -
movementSpeed
private float movementSpeed -
jumpingCooldown
private int jumpingCooldown -
absorptionAmount
private float absorptionAmount -
activeItemStack
-
itemUseTimeLeft
protected int itemUseTimeLeft -
roll
protected int roll -
lastBlockPos
-
climbingPos
-
lastDamageSource
-
lastDamageTime
private long lastDamageTime -
riptideTicks
protected int riptideTicks -
leaningPitch
private float leaningPitch -
lastLeaningPitch
private float lastLeaningPitch -
brain
-
-
Constructor Details
-
LivingEntity
-
-
Method Details
-
getBrain
-
createBrainProfile
-
deserializeBrain
-
kill
public void kill() -
canTarget
-
initDataTracker
protected void initDataTracker()- Specified by:
initDataTrackerin classEntity
-
createLivingAttributes
-
fall
protected void fall(double heightDifference, boolean onGround, BlockState landedState, BlockPos landedPosition) -
canBreatheInWater
public boolean canBreatheInWater() -
getLeaningPitch
@Environment(CLIENT) public float getLeaningPitch(float tickDelta) -
baseTick
public void baseTick() -
shouldDisplaySoulSpeedEffects
public boolean shouldDisplaySoulSpeedEffects() -
displaySoulSpeedEffects
protected void displaySoulSpeedEffects() -
isOnSoulSpeedBlock
protected boolean isOnSoulSpeedBlock() -
getVelocityMultiplier
protected float getVelocityMultiplier()- Overrides:
getVelocityMultiplierin classEntity
-
method_29500
-
removeSoulSpeedBoost
protected void removeSoulSpeedBoost() -
addSoulSpeedBoostIfNeeded
protected void addSoulSpeedBoostIfNeeded() -
applyMovementEffects
-
isBaby
public boolean isBaby() -
getScaleFactor
public float getScaleFactor() -
method_29920
protected boolean method_29920() -
canBeRiddenInWater
public boolean canBeRiddenInWater()- Overrides:
canBeRiddenInWaterin classEntity
-
updatePostDeath
protected void updatePostDeath() -
shouldDropXp
protected boolean shouldDropXp()Returns if this entity should drop experience on death when the doMobLoot game rule is enabled and has been attacked by a player.If
shouldAlwaysDropXp()returnstrue, this check is disregarded.- See Also:
dropXp(),shouldAlwaysDropXp(),getXpToDrop(PlayerEntity)
-
shouldDropLoot
protected boolean shouldDropLoot() -
getNextAirUnderwater
protected int getNextAirUnderwater(int air) -
getNextAirOnLand
protected int getNextAirOnLand(int air) -
getXpToDrop
Called when this entity is killed and returns the amount of experience to drop.playermay benullif shouldAlwaysDropXp() returnstrue.- Parameters:
player- the attacking player- See Also:
dropXp(),shouldAlwaysDropXp(),shouldDropXp()
-
shouldAlwaysDropXp
protected boolean shouldAlwaysDropXp()Returns if this entity may always drop experience, skipping any other checks.- See Also:
dropXp(),getXpToDrop(PlayerEntity)
-
getRandom
-
getAttacker
-
getLastAttackedTime
public int getLastAttackedTime() -
setAttacking
-
setAttacker
-
getAttacking
-
getLastAttackTime
public int getLastAttackTime() -
onAttacking
-
getDespawnCounter
public int getDespawnCounter() -
setDespawnCounter
public void setDespawnCounter(int despawnCounter) -
onEquipStack
-
writeCustomDataToNbt
- Specified by:
writeCustomDataToNbtin classEntity
-
readCustomDataFromNbt
- Specified by:
readCustomDataFromNbtin classEntity
-
tickStatusEffects
protected void tickStatusEffects() -
updatePotionVisibility
protected void updatePotionVisibility() -
getAttackDistanceScalingFactor
-
canTarget
-
isTarget
-
containsOnlyAmbientEffects
-
clearPotionSwirls
protected void clearPotionSwirls() -
clearStatusEffects
public boolean clearStatusEffects() -
getStatusEffects
-
getActiveStatusEffects
-
hasStatusEffect
-
getStatusEffect
-
addStatusEffect
-
canHaveStatusEffect
-
applyStatusEffect
-
isUndead
public boolean isUndead() -
removeStatusEffectInternal
Removes a status effect from this entity without calling any listener.This method does not perform any cleanup or synchronization operation. Under most circumstances, calling
removeStatusEffect(net.minecraft.entity.effect.StatusEffect)is highly preferable. -
removeStatusEffect
Removes a status effect from this entity.Calling this method will call cleanup methods on the status effect and trigger synchronization of effect particles with watching clients. If this entity is a player, the change in the list of effects will also be synchronized with the corresponding client.
- Returns:
trueif aStatusEffectInstancewith the given type was in effect before the removal.
-
onStatusEffectApplied
-
onStatusEffectUpgraded
-
onStatusEffectRemoved
-
heal
public void heal(float amount)Heals this entity by the givenamountof half-hearts.A dead entity cannot be healed.
- See Also:
isDead()
-
getHealth
public float getHealth() -
setHealth
public void setHealth(float health) -
isDead
public boolean isDead() -
damage
-
takeShieldHit
-
knockback
-
tryUseTotem
-
getRecentDamageSource
-
playHurtSound
-
blockedByShield
-
playEquipmentBreakEffects
-
onDeath
-
onKilledBy
Performs secondary effects after this mob has been killed.The default behavior spawns a wither rose if
adversaryis aWitherEntity.- Parameters:
adversary- the main adversary responsible for this entity's death
-
drop
-
dropInventory
protected void dropInventory() -
dropXp
protected void dropXp()Drops experience when this entity is killed.To control the details of experience dropping, consider overriding
shouldAlwaysDropXp(),shouldDropXp(), andgetXpToDrop(PlayerEntity). -
dropEquipment
-
getLootTable
-
dropLoot
-
getLootContextBuilder
-
takeKnockback
public void takeKnockback(float float2, double double2, double double3) -
getHurtSound
-
getDeathSound
-
getFallSound
-
getDrinkSound
-
getEatSound
-
setOnGround
public void setOnGround(boolean onGround)- Overrides:
setOnGroundin classEntity
-
getClimbingPos
-
isClimbing
public boolean isClimbing() -
getBlockState
-
canEnterTrapdoor
-
isAlive
public boolean isAlive() -
handleFallDamage
public boolean handleFallDamage(float fallDistance, float damageMultiplier)- Overrides:
handleFallDamagein classEntity
-
computeFallDamage
protected int computeFallDamage(float fallDistance, float damageMultiplier) -
playBlockFallSound
protected void playBlockFallSound() -
animateDamage
@Environment(CLIENT) public void animateDamage()- Overrides:
animateDamagein classEntity
-
getArmor
public int getArmor() -
damageArmor
-
damageShield
protected void damageShield(float amount) -
applyArmorToDamage
-
applyEnchantmentsToDamage
-
applyDamage
-
getDamageTracker
-
getPrimeAdversary
-
getMaxHealth
public final float getMaxHealth() -
getStuckArrowCount
public final int getStuckArrowCount() -
setStuckArrowCount
public final void setStuckArrowCount(int stuckArrowCount) -
getStingerCount
public final int getStingerCount() -
setStingerCount
public final void setStingerCount(int stingerCount) -
getHandSwingDuration
private int getHandSwingDuration() -
swingHand
-
swingHand
-
handleStatus
@Environment(CLIENT) public void handleStatus(byte status)- Overrides:
handleStatusin classEntity
-
method_30127
@Environment(CLIENT) private void method_30127() -
tickInVoid
protected void tickInVoid()Called when the entity is 64 blocks below the world's minimum Y position which is0.Living entities use this to deal out of world damage.
- Overrides:
tickInVoidin classEntity
-
tickHandSwing
protected void tickHandSwing() -
getAttributeInstance
-
getAttributeValue
-
getAttributeBaseValue
-
getAttributes
-
getGroup
-
getMainHandStack
-
getOffHandStack
-
isHolding
Checks if this entity is holding a certain item.This checks both the entity's main and off hand.
-
isHolding
Checks if this entity is holding a certain item.This checks both the entity's main and off hand.
-
getStackInHand
-
setStackInHand
-
hasStackEquipped
-
getArmorItems
- Overrides:
getArmorItemsin classEntity
-
getEquippedStack
-
equipStack
- Overrides:
equipStackin classEntity
-
getArmorVisibility
public float getArmorVisibility() -
setSprinting
public void setSprinting(boolean sprinting)- Overrides:
setSprintingin classEntity
-
getSoundVolume
protected float getSoundVolume() -
getSoundPitch
protected float getSoundPitch() -
isImmobile
protected boolean isImmobile() -
pushAwayFrom
- Overrides:
pushAwayFromin classEntity
-
onDismounted
-
shouldRenderName
@Environment(CLIENT) public boolean shouldRenderName()- Overrides:
shouldRenderNamein classEntity
-
getJumpVelocity
protected float getJumpVelocity() -
jump
protected void jump() -
knockDownwards
@Environment(CLIENT) protected void knockDownwards() -
swimUpward
-
getBaseMovementSpeedMultiplier
protected float getBaseMovementSpeedMultiplier() -
canWalkOnFluid
-
travel
-
method_29242
-
method_26318
-
method_26317
-
applyClimbingSpeed
-
getMovementSpeed
private float getMovementSpeed(float slipperiness) -
getMovementSpeed
public float getMovementSpeed() -
setMovementSpeed
public void setMovementSpeed(float movementSpeed) -
tryAttack
-
tick
public void tick() -
method_30128
private void method_30128() -
method_30129
-
method_30121
-
method_30123
-
method_30125
-
method_30122
-
method_30126
-
method_30124
-
turnHead
protected float turnHead(float bodyRotation, float headRotation) -
tickMovement
public void tickMovement() -
hurtByWater
public boolean hurtByWater() -
tickFallFlying
private void tickFallFlying() -
tickNewAi
protected void tickNewAi() -
tickCramming
protected void tickCramming() -
tickRiptide
-
pushAway
-
attackLivingEntity
-
setRiptideTicks
public void setRiptideTicks(int riptideTicks) -
isUsingRiptide
public boolean isUsingRiptide() -
stopRiding
public void stopRiding()- Overrides:
stopRidingin classEntity
-
tickRiding
public void tickRiding()- Overrides:
tickRidingin classEntity
-
updateTrackedPositionAndAngles
@Environment(CLIENT) public void updateTrackedPositionAndAngles(double x, double y, double z, float yaw, float pitch, int interpolationSteps, boolean interpolate)- Overrides:
updateTrackedPositionAndAnglesin classEntity
-
updateTrackedHeadRotation
@Environment(CLIENT) public void updateTrackedHeadRotation(float yaw, int interpolationSteps)- Overrides:
updateTrackedHeadRotationin classEntity
-
setJumping
public void setJumping(boolean jumping) -
method_29499
-
sendPickup
-
canSee
-
getYaw
public float getYaw(float tickDelta) -
getHandSwingProgress
@Environment(CLIENT) public float getHandSwingProgress(float tickDelta) -
canMoveVoluntarily
public boolean canMoveVoluntarily() -
collides
public boolean collides() -
isPushable
public boolean isPushable()- Overrides:
isPushablein classEntity
-
scheduleVelocityUpdate
protected void scheduleVelocityUpdate()- Overrides:
scheduleVelocityUpdatein classEntity
-
getHeadYaw
public float getHeadYaw()- Overrides:
getHeadYawin classEntity
-
setHeadYaw
public void setHeadYaw(float headYaw)- Overrides:
setHeadYawin classEntity
-
setBodyYaw
public void setBodyYaw(float bodyYaw)- Overrides:
setBodyYawin classEntity
-
method_30633
- Overrides:
method_30633in classEntity
-
method_31079
-
getAbsorptionAmount
public float getAbsorptionAmount() -
setAbsorptionAmount
public void setAbsorptionAmount(float amount) -
enterCombat
public void enterCombat() -
endCombat
public void endCombat() -
markEffectsDirty
protected void markEffectsDirty() -
getMainArm
-
isUsingItem
public boolean isUsingItem() -
getActiveHand
-
tickActiveItemStack
private void tickActiveItemStack() -
shouldSpawnConsumptionEffects
private boolean shouldSpawnConsumptionEffects() -
updateLeaningPitch
private void updateLeaningPitch() -
setLivingFlag
protected void setLivingFlag(int mask, boolean value) -
setCurrentHand
-
onTrackedDataSet
- Overrides:
onTrackedDataSetin classEntity
-
lookAt
-
spawnConsumptionEffects
-
spawnItemParticles
-
consumeItem
protected void consumeItem() -
getActiveItem
-
getItemUseTimeLeft
public int getItemUseTimeLeft() -
getItemUseTime
public int getItemUseTime() -
stopUsingItem
public void stopUsingItem() -
clearActiveItem
public void clearActiveItem() -
isBlocking
public boolean isBlocking() -
isHoldingOntoLadder
public boolean isHoldingOntoLadder()- Returns:
trueif this entity should not lose height while in a climbing state- See Also:
LivingEntity
-
isFallFlying
public boolean isFallFlying() -
isInSwimmingPose
public boolean isInSwimmingPose()- Overrides:
isInSwimmingPosein classEntity
-
getRoll
@Environment(CLIENT) public int getRoll() -
teleport
public boolean teleport(double x, double y, double z, boolean particleEffects) -
isAffectedBySplashPotions
public boolean isAffectedBySplashPotions() -
isMobOrPlayer
public boolean isMobOrPlayer() -
setNearbySongPlaying
-
canEquip
-
createSpawnPacket
- Specified by:
createSpawnPacketin classEntity
-
getDimensions
- Overrides:
getDimensionsin classEntity
-
getPoses
-
getBoundingBox
-
getSleepingPosition
-
setSleepingPosition
-
clearSleepingPosition
public void clearSleepingPosition() -
isSleeping
public boolean isSleeping() -
sleep
-
setPositionInBed
-
isSleepingInBed
private boolean isSleepingInBed() -
wakeUp
public void wakeUp() -
getSleepingDirection
-
isInsideWall
public boolean isInsideWall()- Overrides:
isInsideWallin classEntity
-
getEyeHeight
- Overrides:
getEyeHeightin classEntity
-
getActiveEyeHeight
-
getArrowType
-
eatFood
-
applyFoodEffects
-
getEquipmentBreakStatus
-
sendEquipmentBreakStatus
-
sendToolBreakStatus
-
getVisibilityBoundingBox
- Overrides:
getVisibilityBoundingBoxin classEntity
-