Class LivingEntity
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.entity.Entity
net.minecraft.world.entity.LivingEntity
- All Implemented Interfaces:
DataComponentGetter, TypedInstance<EntityType<?>>, SyncedDataHolder, DebugValueSource, Attackable, ItemOwner, SlotProvider, EntityAccess, UniquelyIdentifyable, Nameable, ScoreHolder, Waypoint, WaypointTransmitter, IAttachmentHolder, IEntityExtension, ILivingEntityExtension
- Direct Known Subclasses:
ArmorStand, Avatar, Mob
public abstract class LivingEntity
extends Entity
implements Attackable, WaypointTransmitter, ILivingEntityExtension
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class Entity
Entity.Flags, Entity.MoveFunction, Entity.MovementEmission, Entity.RemovalReasonNested classes/interfaces inherited from class AttachmentHolder
AttachmentHolder.AsFieldNested classes/interfaces inherited from interface DebugValueSource
DebugValueSource.Registration, DebugValueSource.ValueGetter<T>Nested classes/interfaces inherited from interface ItemOwner
ItemOwner.OffsetFromOwnerNested classes/interfaces inherited from interface Waypoint
Waypoint.IconNested classes/interfaces inherited from interface WaypointTransmitter
WaypointTransmitter.BlockConnection, WaypointTransmitter.ChunkConnection, WaypointTransmitter.Connection, WaypointTransmitter.EntityAzimuthConnection, WaypointTransmitter.EntityBlockConnection, WaypointTransmitter.EntityChunkConnection -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate floatprivate final Map<Holder<MobEffect>, MobEffectInstance> private final EnumMap<EquipmentSlot, it.unimi.dsi.fastutil.objects.Reference2ObjectMap<Enchantment, Set<EnchantmentLocationBasedEffect>>> static final intfloatprotected intprivate final AttributeMapprotected floatprotected @Nullable ItemStackprotected intstatic final floatstatic final intprotected Brain<?> private final CombatTrackerprivate static final int@Nullable Entityprivate int@Nullable Vec3private static final intprotected @Nullable Stack<DamageContainer> This field stores information about damage dealt to this entity. a newDamageContaineris instantiated viaEntity.hurt(DamageSource, float)after invulnerability checks, and is removed from the stack before the method's return.private static final EntityDataAccessor<Integer> private static final EntityDataAccessor<Boolean> private static final EntityDataAccessor<List<ParticleOptions>> private static final EntityDataAccessor<Float> protected static final EntityDataAccessor<Byte> private static final EntityDataAccessor<Integer> protected booleanstatic final intintstatic final floatstatic final doubleprivate static final intprotected static final floatprivate booleanprivate booleanfinal ElytraAnimationStateprotected final EntityEquipmentstatic final intstatic final floatprotected intprivate static final intintintprotected static final floatprotected final InterpolationHandlerprotected static final intprotected intprotected booleanprivate @Nullable DamageSourceprivate longprivate final Map<EquipmentSlot, ItemStack> protected floatDamage taken in the last hit.private @Nullable EntityReference<LivingEntity> private intprotected @Nullable EntityReference<Player> protected intprivate @Nullable LivingEntityprivate intHolds the value of ticksExisted when setLastAttacker was last called.private longprivate BlockPosprotected intprotected doubleprotected static final intprotected static final intprotected static final intprivate Waypoint.Iconprivate static final org.slf4j.Loggerprivate static final doublestatic final doubleprotected intprivate intfloatprivate static final intstatic final intstatic final Predicate<LivingEntity> Deprecated.static final BiPredicate<LivingEntity, @Nullable LivingEntity> protected @Nullable it.unimi.dsi.fastutil.objects.Object2LongMap<Entity> intintstatic final intprivate booleanprotected static final EntityDimensionsprivate static final EntityDataAccessor<Optional<BlockPos>> private floatprivate static final Identifierprivate static final AttributeModifierprivate static final Identifierprivate floatprivate floatbooleanintprivate static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprivate static final intprotected ItemStackprotected intfinal WalkAnimationStateprivate static final floatfloatfloatfloatfloatfloatfloatfloatFields inherited from class Entity
BASE_SAFE_FALL_DISTANCE, BASE_TICKS_REQUIRED_TO_FREEZE, blocksBuilding, BOARDING_COOLDOWN, boardingCooldown, CONTENTS_SLOT_INDEX, DATA_POSE, DATA_SHARED_FLAGS_ID, DEFAULT_BB_HEIGHT, DEFAULT_BB_WIDTH, DELTA_AFFECTED_BY_BLOCKS_BELOW_0_2, DELTA_AFFECTED_BY_BLOCKS_BELOW_0_5, DELTA_AFFECTED_BY_BLOCKS_BELOW_1_0, ENTITY_COUNTER, entityData, fallDistance, firstTick, FLAG_FALL_FLYING, FLAG_GLOWING, FLAG_ONFIRE, fluidHeight, flyDist, forgeFluidTypeHeight, FREEZE_HURT_FREQUENCY, horizontalCollision, hurtMarked, invulnerableTime, isInPowderSnow, mainSupportingBlockPos, MAX_ENTITY_TAG_COUNT, MAX_MOVEMENTS_HANDELED_PER_TICK, minorHorizontalCollision, moveDist, needsSync, noPhysics, portalProcess, random, stringUUID, stuckSpeedMultiplier, TAG_AIR, TAG_CUSTOM_NAME, TAG_DATA, TAG_FALL_DISTANCE, TAG_FIRE, TAG_GLOWING, TAG_ID, TAG_INVULNERABLE, TAG_MOTION, TAG_NO_GRAVITY, TAG_ON_GROUND, TAG_PASSENGERS, TAG_PORTAL_COOLDOWN, TAG_POS, TAG_ROTATION, TAG_SILENT, TAG_UUID, tickCount, TOTAL_AIR_SUPPLY, uuid, verticalCollision, verticalCollisionBelow, wasEyeInWater, wasInPowderSnow, wasTouchingWater, xo, xOld, xRotO, yo, yOld, yRotO, zo, zOldFields inherited from class AttachmentHolder
ATTACHMENTS_NBT_KEYFields inherited from interface ScoreHolder
WILDCARD, WILDCARD_NAMEFields inherited from interface Waypoint
MAX_RANGE, WAYPOINT_TRANSMIT_RANGE_HIDE_MODIFIERFields inherited from interface WaypointTransmitter
REALLY_FAR_DISTANCE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLivingEntity(EntityType<? extends LivingEntity> type, Level level) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidactuallyHurt(ServerLevel level, DamageSource source, float dmg) protected voidaddAdditionalSaveData(ValueOutput output) final booleanaddEffect(MobEffectInstance newEffect) booleanaddEffect(MobEffectInstance newEffect, @Nullable Entity source) voidaiStep()voidanimateHurt(float yaw) protected voidfloatapplyItemBlocking(ServerLevel level, DamageSource source, float damage) voidapplyPostImpulseGraceTime(int ticks) static booleanareAllEffectsAmbient(Collection<MobEffectInstance> effects) Returnstrueif all the potion effects in the specified collection are ambient.@Nullable LivingEntitybooleanvoidbaseTick()protected voidblockedByItem(LivingEntity defender) protected voidblockUsingItem(ServerLevel level, LivingEntity attacker) private voidRenders broken item particles using the given ItemStackvoidcalculateEntityAnimation(boolean useY) protected intcalculateFallDamage(double fallDistance, float damageModifier) private doublecalculateFallPower(double fallDistance) booleancanAttack(LivingEntity target) booleancanBeAffected(MobEffectInstance newEffect) Deprecated.booleanbooleanbooleanDeprecated.protected booleanfinal booleancanEquipWithDispenser(ItemStack itemStack) booleanprotected booleancanGlide()static booleancanGlideUsing(ItemStack itemStack, EquipmentSlot slot) booleanbooleancanStandOnFluid(FluidState fluid) booleancanUsePortal(boolean ignorePassenger) booleancanUseSlot(EquipmentSlot slot) voidcauseExtraKnockback(Entity target, float knockback, Vec3 oldMovement) booleancauseFallDamage(double fallDistance, float damageModifier, DamageSource damageSource) protected voidcheckAutoSpinAttack(AABB old, AABB current) private booleanprotected voidcheckFallDamage(double ya, boolean onGround, BlockState onState, BlockPos pos) private booleancheckTotemDeathProtection(DamageSource killingDamage) voidprivate @Nullable Map<EquipmentSlot, ItemStack> protected voidprotected EntityEquipmentprivate static SlotAccesscreateEquipmentSlotAccess(LivingEntity entity, EquipmentSlot equipmentSlot) private @Nullable ItemEntitycreateItemStackToDrop(ItemStack itemStack, boolean randomly, boolean thrownFromHand) static AttributeSupplier.Builderprotected voidcreateWitherRose(@Nullable LivingEntity killer) protected intdecreaseAirSupply(int currentSupply) Decrements the entity's air supply when underwaterprotected voiddefineSynchedData(SynchedEntityData.Builder entityData) private voidvoiddie(DamageSource source) Called when the mob's health reaches 0.private voiddismountVehicle(Entity vehicle) protected voiddoAutoAttackOnTouch(LivingEntity entity) protected booleanprotected voiddoHurtEquipment(DamageSource damageSource, float damage, EquipmentSlot... slots) booleandoHurtTarget(ServerLevel level, Entity target) protected void@Nullable ItemEntityprotected voiddropAllDeathLoot(ServerLevel level, DamageSource source) protected voiddropCustomDeathLoot(ServerLevel level, DamageSource source, boolean killedByPlayer) protected voiddropEquipment(ServerLevel level) protected voiddropExperience(ServerLevel level, @Nullable Entity killer) booleandropFromEntityInteractLootTable(ServerLevel level, ResourceKey<LootTable> key, @Nullable Entity interactingEntity, ItemInstance tool, BiConsumer<ServerLevel, ItemStack> consumer) booleandropFromGiftLootTable(ServerLevel level, ResourceKey<LootTable> key, BiConsumer<ServerLevel, ItemStack> consumer) protected booleandropFromLootTable(ServerLevel level, ResourceKey<LootTable> key, Function<LootParams.Builder, LootParams> paramsBuilder, BiConsumer<ServerLevel, ItemStack> consumer) protected voiddropFromLootTable(ServerLevel level, DamageSource source, boolean playerKilled) voiddropFromLootTable(ServerLevel level, DamageSource source, boolean playerKilled, ResourceKey<LootTable> lootTable) voiddropFromLootTable(ServerLevel level, DamageSource source, boolean playerKilled, ResourceKey<LootTable> lootTable, Consumer<ItemStack> itemStackConsumer) protected voiddropFromShearingLootTable(ServerLevel level, ResourceKey<LootTable> key, ItemInstance tool, BiConsumer<ServerLevel, ItemStack> consumer) private static byteentityEventForEquipmentBreak(EquipmentSlot equipmentSlot) booleanequipmentHasChanged(ItemStack previous, ItemStack current) private voidvoidforceAddEffect(MobEffectInstance newEffect, @Nullable Entity source) floatfloatfloatintfinal intfloatgetAttackAnim(float a) Gets the progression of the swing animation, ranges from 0.0 to 1.0.getAttackRangeWith(ItemStack weaponItem) @Nullable AttributeInstancegetAttribute(Holder<Attribute> attribute) doublegetAttributeBaseValue(Holder<Attribute> attribute) doublegetAttributeValue(Holder<Attribute> attribute) protected int@Nullable Directionprotected floatBrain<? extends LivingEntity> getBrain()protected final intgetComfortableFallDistance(float allowedDamage) intprotected floatgetDamageAfterArmorAbsorb(DamageSource damageSource, float damage) Reduces damage, depending on armorprotected floatgetDamageAfterMagicAbsorb(DamageSource damageSource, float damage) Reduces damage, depending on potionsprotected @Nullable SoundEventprotected EntityDimensionsgetDefaultDimensions(Pose pose) protected doublefinal EntityDimensionsgetDimensions(Pose pose) @Nullable MobEffectInstancefloatgetEffectBlendFactor(Holder<MobEffect> effect, float partialTicks) protected doubleprivate static @Nullable EquipmentSlotgetEquipmentSlot(int slot) final EquipmentSlotgetEquipmentSlotForItem(ItemStack itemStack) protected Holder<SoundEvent> getEquipSound(EquipmentSlot slot, ItemStack stack, Equippable equippable) final intgetExperienceReward(ServerLevel level, @Nullable Entity killer) private SoundEventgetFallDamageSound(int dmg) intgetFluidFallingAdjustedMovement(double baseGravity, boolean isFalling, Vec3 movement) protected floatprivate floatgetFrictionInfluencedSpeed(float blockFriction) floatfloatprotected @Nullable SoundEventgetHurtSound(DamageSource source) @Nullable ItemStackgetItemBySlot(EquipmentSlot slot) getItemInHand(InteractionHand hand) floatprotected floatprotected floatgetJumpPower(float multiplier) @Nullable LivingEntityprotected floatgetKnockback(Entity target, DamageSource damageSource) @Nullable DamageSource@Nullable LivingEntityint@Nullable Playerint@Nullable LivingEntityintgetLocalBoundsForPose(Pose pose) longfloatgetLuck()abstract HumanoidArmfinal floatintprotected floatfinal floatintgetPassengerRidingPosition(Entity passenger) floatgetPreciseBodyRotation(float partial) getProjectile(ItemStack heldWeapon) getRelativePortalPosition(Direction.Axis axis, BlockUtil.FoundRectangle portalArea) protected Vec3getRiddenInput(Player controller, Vec3 selfInput) protected floatgetRiddenSpeed(Player controller) final floatgetScale()float@Nullable SlotAccessgetSlot(int slot) protected floatfloatgetSpeed()final intfloatgetSwimAmount(float a) floatgetTicksSinceLastKineticHitFeedback(float partial) intfloatgetTicksUsingItem(float partialTicks) intfloatgetViewYRot(float a) Gets the current yaw of the entitydoublegetVisibilityPercent(@Nullable Entity targetingEntity) floatfloatprotected floatfloatprotected voidDeprecated.voidhandleDamageEvent(DamageSource source) voidhandleEntityEvent(byte id) Handler forinvalid reference
World#setEntityStateprivate voidhandleEquipmentChanges(Map<EquipmentSlot, ItemStack> changedItems) voidhandleExtraItemsCreatedOnUse(ItemStack extraCreatedRemainder) private voidhandleFallFlyingCollisions(double moveHorLength, double newMoveHorLength) private voidhandleHandSwap(Map<EquipmentSlot, ItemStack> changedItems) private Vec3handleOnClimbable(Vec3 delta) private Vec3handleRelativeFrictionAndCalculateMovement(Vec3 input, float friction) booleanbooleanbooleanhasItemInSlot(EquipmentSlot slot) booleanbooleanhasLineOfSight(Entity target) booleanhasLineOfSight(Entity target, ClipContext.Block blockCollidingContext, ClipContext.Fluid fluidCollidingContext, double eyeHeight) voidheal(float heal) Heal living entity (param: amount of half-hearts)protected voidhurtArmor(DamageSource damageSource, float damage) protected voidhurtHelmet(DamageSource damageSource, float damage) booleanhurtServer(ServerLevel level, DamageSource source, float damage) voidigniteForTicks(int numberOfTicks) protected intincreaseAirSupply(int currentSupply) voidindicateDamage(double xd, double zd) protected voidinternalSetAbsorptionAmount(float absorptionAmount) booleanbooleanbooleanisAlive()protected booleanbooleanbooleanisBaby()booleanbooleanbooleanfinal booleanisEquippableInSlot(ItemStack itemStack, EquipmentSlot slot) booleanbooleanbooleanbooleanprotected booleanbooleanbooleanbooleanisInvulnerableTo(ServerLevel level, DamageSource source) booleanisInWall()booleanbooleanisLookingAtMe(LivingEntity target, double coneSize, boolean adjustForDistance, boolean seeThroughTransparentBlocks, double... gazeHeights) booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanvoidprotected voidjumpInLiquid(TagKey<Fluid> type) Deprecated.private voidjumpOutOfFluid(double oldY) voidkill(ServerLevel level) voidknockback(double power, double xd, double zd) protected voidlerpHeadRotationStep(int lerpHeadSteps, double targetYHeadRot) voidlerpHeadTo(float yRot, int steps) voidlookAt(EntityAnchorArgument.Anchor anchor, Vec3 pos) protected Brain<? extends LivingEntity> makeBrain(Brain.Packed packedBrain) private voidvoidvoidmakeSound(@Nullable SoundEvent sound) floatvoidonAttack()protected voidonAttributeUpdated(Holder<Attribute> attribute) protected voidprotected voidonChangedBlock(ServerLevel level, BlockPos pos) booleanprotected voidonEffectAdded(MobEffectInstance effect, @Nullable Entity source) protected voidonEffectsRemoved(Collection<MobEffectInstance> effects) protected voidonEffectUpdated(MobEffectInstance effect, boolean doRefreshAttributes, @Nullable Entity source) voidvoidonEquipItem(EquipmentSlot slot, ItemStack oldStack, ItemStack stack) voidonEquippedItemBroken(Item brokenItem, EquipmentSlot inSlot) voidonItemPickup(ItemEntity entity) private voidvoidvoidonRemoval(Entity.RemovalReason reason) voidonSyncedDataUpdated(EntityDataAccessor<?> accessor) protected voidprotected voidprotected voidplayHurtSound(DamageSource source) private voidplaySecondaryHurtSound(DamageSource source) voidvoidApplies a velocity to the entities, to push them away from each other.protected voidbooleanrandomTeleport(double xx, double yy, double zz, boolean showParticles) protected voidreadAdditionalSaveData(ValueInput input) voidprivate voidvoidvoidrememberStabbedEntity(Entity target) voidremove(Entity.RemovalReason reason) booleanbooleanremoveEffect(Holder<MobEffect> effect) final @Nullable MobEffectInstanceremoveEffectNoUpdate(Holder<MobEffect> effect) protected voidprotected voidvoidstatic Vec3protected voidprotected @Nullable PlayervoidrideTick()protected floatsanitizeScale(float scale) voidprotected voidfinal voidsetAbsorptionAmount(float absorptionAmount) final voidsetArrowCount(int count) Sets the amount of arrows stuck in the entity.voidsetDiscardFriction(boolean discardFriction) voidsetHealth(float health) voidsetIgnoreFallDamageFromCurrentImpulse(boolean ignoreFallDamage, Vec3 newImpulseImpactPos) voidsetItemInHand(InteractionHand hand, ItemStack itemStack) voidsetItemSlot(EquipmentSlot slot, ItemStack itemStack) voidsetItemSlot(EquipmentSlot slot, ItemStack itemStack, boolean insideTransaction) Neo: PassingtrueforinsideTransactionsets the item without side-effects (callingonEquipItem(EquipmentSlot, ItemStack, ItemStack)).voidsetJumping(boolean jump) voidsetLastHurtByMob(@Nullable LivingEntity hurtBy) Hint to AI tasks that we were attacked by the passed EntityLivingBase and should retaliate.voidsetLastHurtByPlayer(UUID player, int timeToRemember) private voidsetLastHurtByPlayer(EntityReference<Player> player, int timeToRemember) voidsetLastHurtByPlayer(Player player, int timeToRemember) voidsetLastHurtMob(Entity target) protected voidsetLivingEntityFlag(int flag, boolean value) voidsetNoActionTime(int noActionTime) private voidsetPosToBed(BlockPos bedPosition) Sets entity position to a supplied BlockPos plus a little offsetvoidsetRecordPlayingNearby(BlockPos jukebox, boolean isPlaying) Called when a record starts or stops playing.voidsetSleepingPos(BlockPos bedPosition) voidsetSpeed(float speed) Sets the movespeed used for the new AI system.voidsetSprinting(boolean isSprinting) Set sprinting switch for Entity.final voidsetStingerCount(int count) voidsetYBodyRot(float yBodyRot) Set the render yaw offsetvoidsetYHeadRot(float yHeadRot) Sets the head's yaw rotation of the entity.booleanbooleanprotected booleanshouldDropLoot(ServerLevel level) booleanprotected booleanprotected booleanshouldTravelInFluid(FluidState fluidState) voidvoidspawnItemParticles(ItemStack itemStack, int count) booleanstabAttack(EquipmentSlot weaponSlot, Entity target, float baseDamage, boolean dealsDamage, boolean dealsKnockback, boolean dismounts) intstabbedEntities(Predicate<Entity> filter) voidstartSleeping(BlockPos bedPosition) voidvoidprivate voidstopLocationBasedEffects(ItemStack previous, EquipmentSlot inSlot, AttributeMap attributes) voidvoidvoidprivate voidvoidswing(InteractionHand hand) voidswing(InteractionHand hand, boolean sendToSwingingEntity) voidCalled when the entity picks up an item.voidtick()protected voidprotected voidprotected voidtickHeadTurn(float yBodyRotT) protected voidtickRidden(Player controller, Vec3 riddenInput) private booleantrapdoorUsableAsLadder(BlockPos pos, BlockState state) voidprivate voidtravelFallFlying(Vec3 input) protected voidtravelFlying(Vec3 input, float speed) protected voidtravelFlying(Vec3 input, float waterSpeed, float lavaSpeed, float airSpeed) private voidtravelInAir(Vec3 input) private voidtravelInFluid(Vec3 input) Deprecated.Neo: usetravelInFluid(Vec3, FluidState)insteadprivate voidtravelInFluid(Vec3 input, FluidState fluidState) private voidtravelInLava(Vec3 input, double baseGravity, boolean isFalling, double oldY) protected voidtravelInWater(Vec3 input, double baseGravity, boolean isFalling, double oldY) private voidtravelRidden(Player controller, Vec3 selfInput) protected voidtriggerOnDeathMobEffects(ServerLevel level, Entity.RemovalReason reason) protected voidvoidvoidprivate voidprotected voidprotected voidprivate Vec3updateFallFlyingMovement(Vec3 movement) private voidprotected voidprivate voidprotected voidprivate voidprotected voidupdateUsingItem(ItemStack useItem) protected voidupdateWalkAnimation(float distance) private voidbooleanbooleanwasRecentlyStabbed(Entity target, int allowedTime) protected booleanMethods inherited from class Entity
absSnapRotationTo, absSnapTo, absSnapTo, addDeltaMovement, addPassenger, addTag, adjustSpawnLocation, applyComponentsFromItemStack, applyEffectsFromBlocks, applyEffectsFromBlocks, applyGravity, applyImplicitComponent, applyImplicitComponentIfPresent, applyImplicitComponents, awardKillScore, blockPosition, broadcastToPlayer, calculateUpVector, calculateViewVector, canAddPassenger, canBeCollidedWith, canBeHitByProjectile, canCollideWith, canControlVehicle, canInteractWithLevel, canRide, canSimulateMovement, canSpawnSprintParticle, canSprint, canTeleport, canTrample, captureDrops, captureDrops, castComponentValue, checkBelowWorld, checkDespawn, checkFallDistanceAccumulation, checkSupportingBlock, chunkPosition, clearFire, clearFreeze, clearMovementThisTick, closerThan, closerThan, collectAllColliders, collideBoundingBox, collidedWithFluid, collidedWithShapeMovingFrom, computeSpeed, considersEntityAsAlly, copyPosition, couldAcceptPassenger, countPlayerPassengers, createCommandSourceStackForNameResolution, createHoverEvent, damageSources, dampensVibrations, deflection, discard, dismountsUnderwater, dismountTo, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doCheckFallDamage, doWaterSplashEffect, dropAllLeashConnections, ejectPassengers, entityTags, equals, extinguishFire, fillCrashReportCategory, fireImmune, fixupDimensions, forceSetRotation, fudgePositionAfterSizeChange, gameEvent, gameEvent, get, getAddEntityPacket, getAirSupply, getAttachments, getAvailableSpaceBelow, getBbHeight, getBbWidth, getBlockExplosionResistance, getBlockJumpFactor, getBlockPosBelowThatAffectsMyMovement, getBlockStateOn, getBlockStateOnLegacy, getBlockX, getBlockY, getBlockZ, getBoundingBox, getCapability, getCapability, getCollisionHorizontalEscapeVector, getControlledVehicle, getControllingPassenger, getCustomName, getDefaultPassengerAttachmentPoint, getDeltaMovement, getDimensionChangingDelay, getDirection, getDismountLocationForPassenger, getDisplayName, getEncodeId, getEntityData, getEyeHeight, getEyeHeight, getEyeInFluidType, getEyePosition, getEyePosition, getEyeY, getFireImmuneTicks, getFirstPassenger, getFluidHeight, getFluidJumpThreshold, getFluidTypeHeight, getForward, getGravity, getHandHoldingItemAngle, getHeadLookAngle, getId, getInBlockState, getIndirectPassengers, getInputVector, getKnownMovement, getKnownSpeed, getLightLevelDependentMagicValue, getLightProbePosition, getLookAngle, getLootTable, getMaxAirSupply, getMaxHeightFluidType, getMotionDirection, getMovementEmission, getName, getNearestViewDirection, getOnPos, getOnPos, getOnPosLegacy, getPassengerAttachmentPoint, getPassengers, getPassengersAndSelf, getPercentFrozen, getPersistentData, getPickRadius, getPickResult, getPistonPushReaction, getPortalCooldown, getPose, getPosition, getPositionCodec, getPrimaryStepSoundBlockPos, getQuadLeashHolderOffsets, getRandom, getRandomX, getRandomY, getRandomZ, getRemainingFireTicks, getRemovalReason, getRequiresPrecisePosition, getRootVehicle, getRopeHoldPosition, getRotationVector, getScoreboardName, getSelfAndPassengers, getSharedFlag, getSoundSource, getStringUUID, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTeam, getTeamColor, getTicksFrozen, getTicksRequiredToFreeze, getType, getTypeName, getUpVector, getUUID, getVehicle, getVehicleAttachmentPoint, getViewScale, getViewVector, getViewXRot, getX, getX, getXRot, getXRot, getY, getY, getYRot, getYRot, getZ, getZ, handleOnAboveBubbleColumn, handleOnInsideBubbleColumn, handlePortal, hasControllingPassenger, hasCustomName, hasExactlyOnePlayerPassenger, hasGlowingTag, hashCode, hasIndirectPassenger, hasMovedHorizontallyRecently, hasPassenger, hasPassenger, hasPose, hurt, hurtClient, hurtOrSimulate, igniteForSeconds, ignoreExplosion, interact, is, isAddedToLevel, isAffectedByBlocks, isAlliedTo, isAlliedTo, isAlwaysTicking, isAttackable, isClientAuthoritative, isColliding, isCrouching, isCustomNameVisible, isDescending, isDiscrete, isEffectiveAi, isEyeInFluid, isFlapping, isFlyingVehicle, isFree, isFreezing, isFullyFrozen, isHorizontalCollisionMinor, isIgnoringBlockTriggers, isInClouds, isInFluidType, isInFluidType, isInLava, isInLiquid, isInRain, isInShallowWater, isInterpolating, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableToBase, isInWater, isInWaterOrRain, isLocalClientAuthoritative, isLocalInstanceAuthoritative, isNoGravity, isOnFire, isOnPortalCooldown, isOnRails, isPassenger, isPassengerOfSameVehicle, isPushedByFluid, isRemoved, isShiftKeyDown, isSilent, isSpectator, isSprinting, isSteppingCarefully, isSupportedBy, isSuppressingBounce, isSwimming, isUnderWater, isVehicle, isVisuallyCrawling, killedEntity, lavaHurt, lavaIgnite, lerpMotion, lerpPositionAndRotationStep, level, limitPistonMovement, load, makeBoundingBox, makeBoundingBox, makeStuckInBlock, markHurt, maybeBackOffFromEdge, mayInteract, mirror, move, moveOrInterpolateTo, moveOrInterpolateTo, moveOrInterpolateTo, moveOrInterpolateTo, moveRelative, moveTowardsClosestSpace, nextStep, notifyLeasheeRemoved, notifyLeashHolder, oldPosition, onAboveBubbleColumn, onAddedToLevel, onClientRemoval, onExplosionHit, onFlap, onGround, onInsideBlock, onInsideBubbleColumn, onPassengerTurned, onRemovedFromLevel, onSyncedDataUpdated, pick, placePortalTicket, playCombinationStepSounds, playEntityOnFireExtinguishedSound, playerTouch, playMuffledStepSound, playSound, playSound, playStepSound, playSwimSound, position, positionRider, positionRider, problemPath, processFlappingMovement, processPortalCooldown, propagateFallToPassengers, push, push, reapplyPosition, refreshDimensions, registerDebugValues, registryAccess, removeAfterChangingDimensions, removeLatestMovementRecording, removePassenger, removeTag, removeVehicle, repositionEntityAfterLoad, resetFallDistance, restoreFrom, revive, rotate, save, saveAsPassenger, saveWithoutId, sendBubbleColumnParticles, setAirSupply, setAsInsidePortal, setBoundingBox, setComponent, setCustomName, setCustomNameVisible, setData, setDeltaMovement, setDeltaMovement, setFluidTypeHeight, setGlowingTag, setId, setInvisible, setInvulnerable, setIsInPowderSnow, setLevel, setLevelCallback, setNoGravity, setOldPos, setOldPosAndRot, setOldPosAndRot, setOldRot, setOnGround, setOnGroundWithMovement, setOnGroundWithMovement, setPortalCooldown, setPortalCooldown, setPos, setPos, setPose, setPosRaw, setRemainingFireTicks, setRemoved, setRequiresPrecisePosition, setRot, setSharedFlag, setSharedFlagOnFire, setShiftKeyDown, setSilent, setSwimming, setTicksFrozen, setUUID, setViewScale, setXRot, setYRot, shearOffAllLeashConnections, shouldBeSaved, shouldBlockExplode, shouldPlayLavaHurtSound, shouldRender, shouldRenderAtSqrDistance, showVehicleHealth, skipAttackInteraction, snapTo, snapTo, snapTo, snapTo, snapTo, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnSprintParticle, startRiding, startRiding, startSeenByPlayer, stopSeenByPlayer, supportQuadLeashAsHolder, syncData, syncPacketPositionCodec, teleport, teleportRelative, teleportSetPosition, teleportSetPosition, teleportSpectators, teleportTo, teleportTo, thunderHit, toString, touchingUnloadedChunk, trackingPosition, turn, typeHolder, unRide, unsetRemoved, updateDynamicGameEventListener, updateFluidHeightAndDoCanPushEntityFluidPushing, updateFluidHeightAndDoFluidPushing, updateFluidHeightAndDoFluidPushing, updateInWaterStateAndDoFluidPushing, updateInWaterStateAndDoWaterCurrentPushing, updateInWaterStateAndDoWaterCurrentPushing, updateSwimming, waterSwimSoundMethods inherited from class AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, removeData, serializeAttachmentsMethods inherited from interface DataComponentGetter
get, getOrDefault, getOrDefault, getTyped, has, hasMethods inherited from interface IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData, syncDataMethods inherited from interface IEntityExtension
canBeRiddenUnderFluidType, canFluidExtinguish, canHydrateInFluidType, canRiderInteract, canStartSwimming, canTrample, captureDrops, captureDrops, copyAttachmentsFrom, getClassification, getEyeInFluidType, getFluidFallDistanceModifier, getFluidMotionScale, getFluidTypeHeight, getMaxHeightFluidType, getParts, getPersistentData, getSoundFromFluidType, hasCustomOutlineRendering, isAddedToLevel, isEyeInFluidType, isInFluidType, isInFluidType, isInFluidType, isInFluidType, isInFluidType, isMultipartEntity, isPushedByFluid, onAddedToLevel, onRemovedFromLevel, revive, sendPairingData, shouldRiderSitMethods inherited from interface ILivingEntityExtension
canDrownInFluidType, canSwimInFluidType, jumpInFluid, moveInFluid, onDamageTaken, self, sinkInFluidMethods inherited from interface Nameable
getPlainTextNameMethods inherited from interface ScoreHolder
getFeedbackDisplayNameMethods inherited from interface SlotProvider
getSlotsFromRange
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
TAG_ACTIVE_EFFECTS
- See Also:
-
TAG_ATTRIBUTES
- See Also:
-
TAG_SLEEPING_POS
- See Also:
-
TAG_EQUIPMENT
- See Also:
-
TAG_BRAIN
- See Also:
-
TAG_FALL_FLYING
- See Also:
-
TAG_HURT_TIME
- See Also:
-
TAG_DEATH_TIME
- See Also:
-
TAG_HURT_BY_TIMESTAMP
- See Also:
-
TAG_HEALTH
- See Also:
-
SPEED_MODIFIER_POWDER_SNOW_ID
-
SPRINTING_MODIFIER_ID
-
SPEED_MODIFIER_SPRINTING
-
EQUIPMENT_SLOT_OFFSET
public static final int EQUIPMENT_SLOT_OFFSET- See Also:
-
ARMOR_SLOT_OFFSET
public static final int ARMOR_SLOT_OFFSET- See Also:
-
BODY_ARMOR_OFFSET
public static final int BODY_ARMOR_OFFSET- See Also:
-
SADDLE_OFFSET
public static final int SADDLE_OFFSET- See Also:
-
PLAYER_HURT_EXPERIENCE_TIME
public static final int PLAYER_HURT_EXPERIENCE_TIME- See Also:
-
DAMAGE_SOURCE_TIMEOUT
private static final int DAMAGE_SOURCE_TIMEOUT- See Also:
-
MIN_MOVEMENT_DISTANCE
public static final double MIN_MOVEMENT_DISTANCE- See Also:
-
DEFAULT_BASE_GRAVITY
public static final double DEFAULT_BASE_GRAVITY- See Also:
-
DEATH_DURATION
public static final int DEATH_DURATION- See Also:
-
INPUT_FRICTION
protected static final float INPUT_FRICTION- See Also:
-
TICKS_PER_ELYTRA_FREE_FALL_EVENT
private static final int TICKS_PER_ELYTRA_FREE_FALL_EVENT- See Also:
-
FREE_FALL_EVENTS_PER_ELYTRA_BREAK
private static final int FREE_FALL_EVENTS_PER_ELYTRA_BREAK- See Also:
-
BASE_JUMP_POWER
public static final float BASE_JUMP_POWER- See Also:
-
DEFAULT_KNOCKBACK
protected static final float DEFAULT_KNOCKBACK- See Also:
-
INVULNERABLE_DURATION
protected static final int INVULNERABLE_DURATION- See Also:
-
MAX_LINE_OF_SIGHT_TEST_RANGE
private static final double MAX_LINE_OF_SIGHT_TEST_RANGE- See Also:
-
LIVING_ENTITY_FLAG_IS_USING
protected static final int LIVING_ENTITY_FLAG_IS_USING- See Also:
-
LIVING_ENTITY_FLAG_OFF_HAND
protected static final int LIVING_ENTITY_FLAG_OFF_HAND- See Also:
-
LIVING_ENTITY_FLAG_SPIN_ATTACK
protected static final int LIVING_ENTITY_FLAG_SPIN_ATTACK- See Also:
-
DATA_LIVING_ENTITY_FLAGS
-
DATA_HEALTH_ID
-
DATA_EFFECT_PARTICLES
-
DATA_EFFECT_AMBIENCE_ID
-
DATA_ARROW_COUNT_ID
-
DATA_STINGER_COUNT_ID
-
SLEEPING_POS_ID
-
PARTICLE_FREQUENCY_WHEN_INVISIBLE
private static final int PARTICLE_FREQUENCY_WHEN_INVISIBLE- See Also:
-
SLEEPING_DIMENSIONS
-
EXTRA_RENDER_CULLING_SIZE_WITH_BIG_HAT
public static final float EXTRA_RENDER_CULLING_SIZE_WITH_BIG_HAT- See Also:
-
DEFAULT_BABY_SCALE
public static final float DEFAULT_BABY_SCALE- See Also:
-
WATER_FLOAT_IMPULSE
private static final float WATER_FLOAT_IMPULSE- See Also:
-
CURRENT_IMPULSE_CONTEXT_RESET_GRACE_TIME_TICKS
private static final int CURRENT_IMPULSE_CONTEXT_RESET_GRACE_TIME_TICKS- See Also:
-
DEFAULT_CURRENT_IMPULSE_CONTEXT_RESET_GRACE_TIME
private static final int DEFAULT_CURRENT_IMPULSE_CONTEXT_RESET_GRACE_TIME- See Also:
-
currentImpulseContextResetGraceTime
private int currentImpulseContextResetGraceTime -
PLAYER_NOT_WEARING_DISGUISE_ITEM_FOR_TARGET
public static final BiPredicate<LivingEntity, @Nullable LivingEntity> PLAYER_NOT_WEARING_DISGUISE_ITEM_FOR_TARGET -
PLAYER_NOT_WEARING_DISGUISE_ITEM
Deprecated.Neo: usePLAYER_NOT_WEARING_DISGUISE_ITEM_FOR_TARGETwith target info instead -
attributes
-
combatTracker
-
activeEffects
-
lastEquipmentItems
-
swinging
public boolean swinging -
discardFriction
private boolean discardFriction -
swingingArm
-
swingTime
public int swingTime -
removeArrowTime
public int removeArrowTime -
removeStingerTime
public int removeStingerTime -
hurtTime
public int hurtTime -
hurtDuration
public int hurtDuration -
deathTime
public int deathTime -
oAttackAnim
public float oAttackAnim -
attackAnim
public float attackAnim -
attackStrengthTicker
protected int attackStrengthTicker -
itemSwapTicker
protected int itemSwapTicker -
walkAnimation
-
yBodyRot
public float yBodyRot -
yBodyRotO
public float yBodyRotO -
yHeadRot
public float yHeadRot -
yHeadRotO
public float yHeadRotO -
elytraAnimationState
-
lastHurtByPlayer
-
lastHurtByPlayerMemoryTime
protected int lastHurtByPlayerMemoryTime -
dead
protected boolean dead -
noActionTime
protected int noActionTime -
lastHurt
protected float lastHurtDamage taken in the last hit. Mobs are resistant to damage less than this for a short time after taking damage. -
jumping
protected boolean jumping -
xxa
public float xxa -
yya
public float yya -
zza
public float zza -
interpolation
-
lerpYHeadRot
protected double lerpYHeadRot -
lerpHeadSteps
protected int lerpHeadSteps -
effectsDirty
private boolean effectsDirty -
lastHurtByMob
-
lastHurtByMobTimestamp
private int lastHurtByMobTimestamp -
lastHurtMob
-
lastHurtMobTimestamp
private int lastHurtMobTimestampHolds the value of ticksExisted when setLastAttacker was last called. -
speed
private float speed -
noJumpDelay
private int noJumpDelay -
absorptionAmount
private float absorptionAmount -
useItem
-
useItemRemaining
protected int useItemRemaining -
fallFlyTicks
protected int fallFlyTicks -
lastKineticHitFeedbackTime
private long lastKineticHitFeedbackTime -
lastPos
-
lastClimbablePos
-
lastDamageSource
-
lastDamageStamp
private long lastDamageStamp -
autoSpinAttackTicks
protected int autoSpinAttackTicks -
autoSpinAttackDmg
protected float autoSpinAttackDmg -
autoSpinAttackItemStack
-
recentKineticEnemies
-
swimAmount
private float swimAmount -
swimAmountO
private float swimAmountO -
brain
-
skipDropExperience
private boolean skipDropExperience -
activeLocationDependentEnchantments
private final EnumMap<EquipmentSlot, it.unimi.dsi.fastutil.objects.Reference2ObjectMap<Enchantment, Set<EnchantmentLocationBasedEffect>>> activeLocationDependentEnchantments -
equipment
-
locatorBarIcon
-
currentImpulseImpactPos
-
currentExplosionCause
-
damageContainers
This field stores information about damage dealt to this entity. a newDamageContaineris instantiated viaEntity.hurt(DamageSource, float)after invulnerability checks, and is removed from the stack before the method's return.
-
-
Constructor Details
-
LivingEntity
-
-
Method Details
-
asLivingEntity
- Specified by:
asLivingEntityin interfaceItemOwner
-
createEquipment
-
getBrain
-
makeBrain
-
kill
-
defineSynchedData
- Specified by:
defineSynchedDatain classEntity
-
createLivingAttributes
-
checkFallDamage
- Overrides:
checkFallDamagein classEntity
-
canBreatheUnderwater
Deprecated. -
getSwimAmount
public float getSwimAmount(float a) -
hasLandedInLiquid
public boolean hasLandedInLiquid() -
baseTick
-
shouldTakeDrowningDamage
protected boolean shouldTakeDrowningDamage() -
getBlockSpeedFactor
protected float getBlockSpeedFactor()- Overrides:
getBlockSpeedFactorin classEntity
-
getLuck
public float getLuck() -
removeFrost
protected void removeFrost() -
tryAddFrost
protected void tryAddFrost() -
onChangedBlock
-
isBaby
public boolean isBaby() -
getAgeScale
public float getAgeScale() -
getScale
public final float getScale() -
sanitizeScale
protected float sanitizeScale(float scale) -
isAffectedByFluids
public boolean isAffectedByFluids() -
tickDeath
protected void tickDeath() -
shouldDropExperience
public boolean shouldDropExperience() -
shouldDropLoot
-
decreaseAirSupply
protected int decreaseAirSupply(int currentSupply) Decrements the entity's air supply when underwater -
increaseAirSupply
protected int increaseAirSupply(int currentSupply) -
getExperienceReward
-
getBaseExperienceReward
-
isAlwaysExperienceDropper
protected boolean isAlwaysExperienceDropper() -
getLastHurtByMob
-
getLastHurtByPlayer
-
getLastAttacker
- Specified by:
getLastAttackerin interfaceAttackable
-
getLastHurtByMobTimestamp
public int getLastHurtByMobTimestamp() -
setLastHurtByPlayer
-
setLastHurtByPlayer
-
setLastHurtByPlayer
-
setLastHurtByMob
Hint to AI tasks that we were attacked by the passed EntityLivingBase and should retaliate. Is not guaranteed to change our actual active target (for example if we are currently busy attacking someone else) -
getLastHurtMob
-
getLastHurtMobTimestamp
public int getLastHurtMobTimestamp() -
setLastHurtMob
-
getNoActionTime
public int getNoActionTime() -
setNoActionTime
public void setNoActionTime(int noActionTime) -
shouldDiscardFriction
public boolean shouldDiscardFriction() -
setDiscardFriction
public void setDiscardFriction(boolean discardFriction) -
doesEmitEquipEvent
-
onEquipItem
-
getEquipSound
protected Holder<SoundEvent> getEquipSound(EquipmentSlot slot, ItemStack stack, Equippable equippable) -
remove
-
onRemoval
-
triggerOnDeathMobEffects
-
addAdditionalSaveData
- Specified by:
addAdditionalSaveDatain classEntity
-
drop
-
readAdditionalSaveData
- Specified by:
readAdditionalSaveDatain classEntity
-
updateDataBeforeSync
public void updateDataBeforeSync()- Overrides:
updateDataBeforeSyncin classEntity
-
tickEffects
protected void tickEffects() -
updateDirtyEffects
private void updateDirtyEffects() -
updateInvisibilityStatus
protected void updateInvisibilityStatus() -
updateSynchronizedMobEffectParticles
private void updateSynchronizedMobEffectParticles() -
updateGlowingStatus
private void updateGlowingStatus() -
getVisibilityPercent
-
canAttack
-
canBeSeenAsEnemy
public boolean canBeSeenAsEnemy() -
canBeSeenByAnyone
public boolean canBeSeenByAnyone() -
areAllEffectsAmbient
Returnstrueif all the potion effects in the specified collection are ambient. -
removeEffectParticles
protected void removeEffectParticles() -
removeAllEffects
public boolean removeAllEffects() -
getActiveEffects
-
getActiveEffectsMap
-
hasEffect
-
getEffect
-
getEffectBlendFactor
-
addEffect
-
addEffect
-
canBeAffected
Deprecated.Neo: Override-Only. Call viaCommonHooks.canMobEffectBeApplied(LivingEntity, MobEffectInstance, Entity)- Parameters:
newEffect- A mob effect instance- Returns:
- If the mob effect instance can be applied to this entity
-
forceAddEffect
-
isInvertedHealAndHarm
public boolean isInvertedHealAndHarm() -
removeEffectNoUpdate
-
removeEffect
-
onEffectAdded
-
sendEffectToPassengers
-
onEffectUpdated
protected void onEffectUpdated(MobEffectInstance effect, boolean doRefreshAttributes, @Nullable Entity source) -
onEffectsRemoved
-
refreshDirtyAttributes
private void refreshDirtyAttributes() -
onAttributeUpdated
-
heal
public void heal(float heal) Heal living entity (param: amount of half-hearts) -
getHealth
public float getHealth() -
setHealth
public void setHealth(float health) -
isDeadOrDying
public boolean isDeadOrDying() -
hurtServer
- Specified by:
hurtServerin classEntity
-
applyItemBlocking
-
playSecondaryHurtSound
-
resolveMobResponsibleForDamage
-
resolvePlayerResponsibleForDamage
-
blockUsingItem
-
blockedByItem
-
checkTotemDeathProtection
-
getLastDamageSource
-
playHurtSound
-
makeSound
-
breakItem
Renders broken item particles using the given ItemStack -
die
Called when the mob's health reaches 0. -
createWitherRose
-
dropAllDeathLoot
-
dropEquipment
-
dropExperience
-
dropCustomDeathLoot
-
getLootTableSeed
public long getLootTableSeed() -
getKnockback
-
dropFromLootTable
-
dropFromLootTable
public void dropFromLootTable(ServerLevel level, DamageSource source, boolean playerKilled, ResourceKey<LootTable> lootTable) -
dropFromLootTable
public void dropFromLootTable(ServerLevel level, DamageSource source, boolean playerKilled, ResourceKey<LootTable> lootTable, Consumer<ItemStack> itemStackConsumer) -
dropFromEntityInteractLootTable
public boolean dropFromEntityInteractLootTable(ServerLevel level, ResourceKey<LootTable> key, @Nullable Entity interactingEntity, ItemInstance tool, BiConsumer<ServerLevel, ItemStack> consumer) -
dropFromGiftLootTable
public boolean dropFromGiftLootTable(ServerLevel level, ResourceKey<LootTable> key, BiConsumer<ServerLevel, ItemStack> consumer) -
dropFromShearingLootTable
protected void dropFromShearingLootTable(ServerLevel level, ResourceKey<LootTable> key, ItemInstance tool, BiConsumer<ServerLevel, ItemStack> consumer) -
dropFromLootTable
protected boolean dropFromLootTable(ServerLevel level, ResourceKey<LootTable> key, Function<LootParams.Builder, LootParams> paramsBuilder, BiConsumer<ServerLevel, ItemStack> consumer) -
knockback
public void knockback(double power, double xd, double zd) -
indicateDamage
public void indicateDamage(double xd, double zd) -
getHurtSound
-
getDeathSound
-
getFallDamageSound
-
skipDropExperience
public void skipDropExperience() -
wasExperienceConsumed
public boolean wasExperienceConsumed() -
getHurtDir
public float getHurtDir() -
getHitbox
-
activeLocationDependentEnchantments
public Map<Enchantment, Set<EnchantmentLocationBasedEffect>> activeLocationDependentEnchantments(EquipmentSlot slot) -
postPiercingAttack
public void postPiercingAttack() -
getFallSounds
-
getLastClimbablePos
-
onClimbable
public boolean onClimbable() -
trapdoorUsableAsLadder
-
isAlive
-
isLookingAtMe
public boolean isLookingAtMe(LivingEntity target, double coneSize, boolean adjustForDistance, boolean seeThroughTransparentBlocks, double... gazeHeights) -
getMaxFallDistance
public int getMaxFallDistance()- Overrides:
getMaxFallDistancein classEntity
-
getComfortableFallDistance
protected final int getComfortableFallDistance(float allowedDamage) -
causeFallDamage
public boolean causeFallDamage(double fallDistance, float damageModifier, DamageSource damageSource) - Overrides:
causeFallDamagein classEntity
-
setIgnoreFallDamageFromCurrentImpulse
public void setIgnoreFallDamageFromCurrentImpulse(boolean ignoreFallDamage, Vec3 newImpulseImpactPos) -
applyPostImpulseGraceTime
public void applyPostImpulseGraceTime(int ticks) -
isIgnoringFallDamageFromCurrentImpulse
public boolean isIgnoringFallDamageFromCurrentImpulse() -
tryResetCurrentImpulseContext
public void tryResetCurrentImpulseContext() -
isInPostImpulseGraceTime
public boolean isInPostImpulseGraceTime() -
resetCurrentImpulseContext
public void resetCurrentImpulseContext() -
calculateFallDamage
protected int calculateFallDamage(double fallDistance, float damageModifier) -
calculateFallPower
private double calculateFallPower(double fallDistance) -
playBlockFallSound
protected void playBlockFallSound() -
animateHurt
public void animateHurt(float yaw) - Overrides:
animateHurtin classEntity
-
getArmorValue
public int getArmorValue() -
hurtArmor
-
hurtHelmet
-
doHurtEquipment
-
getDamageAfterArmorAbsorb
Reduces damage, depending on armor -
getDamageAfterMagicAbsorb
Reduces damage, depending on potions -
actuallyHurt
-
getCombatTracker
-
getKillCredit
-
getMaxHealth
public final float getMaxHealth() -
getMaxAbsorption
public final float getMaxAbsorption() -
getArrowCount
public final int getArrowCount() -
setArrowCount
public final void setArrowCount(int count) Sets the amount of arrows stuck in the entity. Used for rendering those. -
getStingerCount
public final int getStingerCount() -
setStingerCount
public final void setStingerCount(int count) -
getCurrentSwingDuration
public int getCurrentSwingDuration() -
swing
-
swing
-
handleDamageEvent
- Overrides:
handleDamageEventin classEntity
-
handleEntityEvent
public void handleEntityEvent(byte id) Handler forinvalid reference
World#setEntityState- Overrides:
handleEntityEventin classEntity
-
getTicksSinceLastKineticHitFeedback
public float getTicksSinceLastKineticHitFeedback(float partial) -
makePoofParticles
public void makePoofParticles() -
makeDrownParticles
private void makeDrownParticles() -
onKineticHit
private void onKineticHit() -
swapHandItems
private void swapHandItems() -
onBelowWorld
protected void onBelowWorld()- Overrides:
onBelowWorldin classEntity
-
updateSwingTime
protected void updateSwingTime() -
getAttribute
-
getAttributeValue
-
getAttributeBaseValue
-
getAttributes
-
getMainHandItem
-
getOffhandItem
-
getItemHeldByArm
-
getWeaponItem
- Overrides:
getWeaponItemin classEntity
-
getAttackRangeWith
-
getActiveItem
-
isHolding
-
isHolding
-
getItemInHand
-
setItemInHand
-
hasItemInSlot
-
canUseSlot
-
getItemBySlot
-
setItemSlot
-
setItemSlot
Neo: PassingtrueforinsideTransactionsets the item without side-effects (callingonEquipItem(EquipmentSlot, ItemStack, ItemStack)). Callers are responsible for performing the deferred side-effects, when the active transaction commits. -
getArmorCoverPercentage
public float getArmorCoverPercentage() -
setSprinting
public void setSprinting(boolean isSprinting) Set sprinting switch for Entity.- Overrides:
setSprintingin classEntity
-
getSoundVolume
protected float getSoundVolume() -
getVoicePitch
public float getVoicePitch() -
isImmobile
protected boolean isImmobile() -
push
-
dismountVehicle
-
shouldShowName
public boolean shouldShowName()- Overrides:
shouldShowNamein classEntity
-
getJumpPower
protected float getJumpPower() -
getJumpPower
protected float getJumpPower(float multiplier) -
getJumpBoostPower
public float getJumpBoostPower() -
jumpFromGround
public void jumpFromGround() -
goDownInWater
Deprecated. -
jumpInLiquid
Deprecated. -
getWaterSlowDown
protected float getWaterSlowDown() -
canStandOnFluid
-
getDefaultGravity
protected double getDefaultGravity()- Overrides:
getDefaultGravityin classEntity
-
getEffectiveGravity
protected double getEffectiveGravity() -
travel
-
getLiquidCollisionShape
-
shouldTravelInFluid
-
travelFlying
-
travelFlying
-
travelInAir
-
travelInFluid
Deprecated.Neo: usetravelInFluid(Vec3, FluidState)instead -
travelInFluid
-
travelInWater
-
travelInLava
-
jumpOutOfFluid
private void jumpOutOfFluid(double oldY) -
floatInWaterWhileRidden
private void floatInWaterWhileRidden() -
travelFallFlying
-
stopFallFlying
public void stopFallFlying() -
updateFallFlyingMovement
-
handleFallFlyingCollisions
private void handleFallFlyingCollisions(double moveHorLength, double newMoveHorLength) -
travelRidden
-
tickRidden
-
getRiddenInput
-
getRiddenSpeed
-
calculateEntityAnimation
public void calculateEntityAnimation(boolean useY) -
updateWalkAnimation
protected void updateWalkAnimation(float distance) -
handleRelativeFrictionAndCalculateMovement
-
getFluidFallingAdjustedMovement
-
handleOnClimbable
-
getFrictionInfluencedSpeed
private float getFrictionInfluencedSpeed(float blockFriction) -
getFlyingSpeed
protected float getFlyingSpeed() -
getSpeed
public float getSpeed() -
setSpeed
public void setSpeed(float speed) Sets the movespeed used for the new AI system. -
doHurtTarget
-
causeExtraKnockback
-
playAttackSound
protected void playAttackSound() -
tick
-
wasRecentlyStabbed
-
rememberStabbedEntity
-
stabbedEntities
-
stabAttack
public boolean stabAttack(EquipmentSlot weaponSlot, Entity target, float baseDamage, boolean dealsDamage, boolean dealsKnockback, boolean dismounts) -
onAttack
public void onAttack() -
detectEquipmentUpdates
private void detectEquipmentUpdates() -
collectEquipmentChanges
-
equipmentHasChanged
-
handleHandSwap
-
handleEquipmentChanges
-
tickHeadTurn
protected void tickHeadTurn(float yBodyRotT) -
getMaxHeadRotationRelativeToBody
protected float getMaxHeadRotationRelativeToBody() -
aiStep
public void aiStep() -
applyInput
protected void applyInput() -
isSensitiveToWater
public boolean isSensitiveToWater() -
isJumping
public boolean isJumping() -
updateFallFlying
protected void updateFallFlying() -
canGlide
protected boolean canGlide() -
serverAiStep
protected void serverAiStep() -
pushEntities
protected void pushEntities() -
checkAutoSpinAttack
-
doPush
-
doAutoAttackOnTouch
-
isAutoSpinAttack
public boolean isAutoSpinAttack() -
stopRiding
public void stopRiding()- Overrides:
stopRidingin classEntity
-
rideTick
-
getInterpolation
- Overrides:
getInterpolationin classEntity
-
lerpHeadTo
public void lerpHeadTo(float yRot, int steps) - Overrides:
lerpHeadToin classEntity
-
setJumping
public void setJumping(boolean jump) -
onItemPickup
-
take
Called when the entity picks up an item. -
hasLineOfSight
-
hasLineOfSight
public boolean hasLineOfSight(Entity target, ClipContext.Block blockCollidingContext, ClipContext.Fluid fluidCollidingContext, double eyeHeight) -
getViewYRot
public float getViewYRot(float a) Gets the current yaw of the entity- Overrides:
getViewYRotin classEntity
-
getAttackAnim
public float getAttackAnim(float a) Gets the progression of the swing animation, ranges from 0.0 to 1.0. -
isPickable
public boolean isPickable()- Overrides:
isPickablein classEntity
-
isPushable
public boolean isPushable()- Overrides:
isPushablein classEntity
-
getYHeadRot
public float getYHeadRot()- Overrides:
getYHeadRotin classEntity
-
setYHeadRot
public void setYHeadRot(float yHeadRot) Sets the head's yaw rotation of the entity.- Overrides:
setYHeadRotin classEntity
-
setYBodyRot
public void setYBodyRot(float yBodyRot) Set the render yaw offset- Overrides:
setYBodyRotin classEntity
-
getRelativePortalPosition
- Overrides:
getRelativePortalPositionin classEntity
-
resetForwardDirectionOfRelativePortalPosition
-
getAbsorptionAmount
public float getAbsorptionAmount() -
setAbsorptionAmount
public final void setAbsorptionAmount(float absorptionAmount) -
internalSetAbsorptionAmount
protected void internalSetAbsorptionAmount(float absorptionAmount) -
onEnterCombat
public void onEnterCombat() -
onLeaveCombat
public void onLeaveCombat() -
updateEffectVisibility
protected void updateEffectVisibility() -
getMainArm
-
isUsingItem
public boolean isUsingItem() -
getUsedItemHand
-
updatingUsingItem
private void updatingUsingItem() -
createItemStackToDrop
private @Nullable ItemEntity createItemStackToDrop(ItemStack itemStack, boolean randomly, boolean thrownFromHand) -
updateUsingItem
-
updateSwimAmount
private void updateSwimAmount() -
setLivingEntityFlag
protected void setLivingEntityFlag(int flag, boolean value) -
startUsingItem
-
onSyncedDataUpdated
- Specified by:
onSyncedDataUpdatedin interfaceSyncedDataHolder- Overrides:
onSyncedDataUpdatedin classEntity
-
lookAt
-
getPreciseBodyRotation
public float getPreciseBodyRotation(float partial) - Overrides:
getPreciseBodyRotationin classEntity
-
spawnItemParticles
-
completeUsingItem
protected void completeUsingItem() -
handleExtraItemsCreatedOnUse
-
getUseItem
-
getUseItemRemainingTicks
public int getUseItemRemainingTicks() -
getTicksUsingItem
public int getTicksUsingItem() -
getTicksUsingItem
public float getTicksUsingItem(float partialTicks) -
releaseUsingItem
public void releaseUsingItem() -
stopUsingItem
public void stopUsingItem() -
isBlocking
public boolean isBlocking() -
getItemBlockingWith
-
isSuppressingSlidingDownLadder
public boolean isSuppressingSlidingDownLadder() -
isFallFlying
public boolean isFallFlying() -
isVisuallySwimming
public boolean isVisuallySwimming()- Overrides:
isVisuallySwimmingin classEntity
-
getFallFlyingTicks
public int getFallFlyingTicks() -
randomTeleport
public boolean randomTeleport(double xx, double yy, double zz, boolean showParticles) -
isAffectedByPotions
public boolean isAffectedByPotions() -
attackable
public boolean attackable() -
setRecordPlayingNearby
Called when a record starts or stops playing. Used to make parrots start or stop partying. -
canPickUpLoot
public boolean canPickUpLoot() -
getDimensions
- Overrides:
getDimensionsin classEntity
-
getDefaultDimensions
-
getDismountPoses
-
getLocalBoundsForPose
-
wouldNotSuffocateAtTargetPose
-
canUsePortal
public boolean canUsePortal(boolean ignorePassenger) - Overrides:
canUsePortalin classEntity
-
getSleepingPos
-
setSleepingPos
-
clearSleepingPos
public void clearSleepingPos() -
isSleeping
public boolean isSleeping() -
startSleeping
-
setPosToBed
Sets entity position to a supplied BlockPos plus a little offset -
checkBedExists
private boolean checkBedExists() -
stopSleeping
public void stopSleeping() -
getBedOrientation
-
isInWall
-
getProjectile
-
entityEventForEquipmentBreak
-
onEquippedItemBroken
-
stopLocationBasedEffects
private void stopLocationBasedEffects(ItemStack previous, EquipmentSlot inSlot, AttributeMap attributes) -
canEquipWithDispenser
-
canDispenserEquipIntoSlot
-
getEquipmentSlotForItem
-
isEquippableInSlot
-
createEquipmentSlotAccess
private static SlotAccess createEquipmentSlotAccess(LivingEntity entity, EquipmentSlot equipmentSlot) -
getEquipmentSlot
-
getSlot
- Specified by:
getSlotin interfaceSlotProvider- Overrides:
getSlotin classEntity
-
canFreeze
-
isCurrentlyGlowing
public boolean isCurrentlyGlowing()- Overrides:
isCurrentlyGlowingin classEntity
-
getVisualRotationYInDegrees
public float getVisualRotationYInDegrees()- Specified by:
getVisualRotationYInDegreesin interfaceItemOwner- Overrides:
getVisualRotationYInDegreesin classEntity
-
recreateFromPacket
- Overrides:
recreateFromPacketin classEntity
-
getSecondsToDisableBlocking
public float getSecondsToDisableBlocking() -
maxUpStep
-
getPassengerRidingPosition
- Overrides:
getPassengerRidingPositionin classEntity
-
lerpHeadRotationStep
protected void lerpHeadRotationStep(int lerpHeadSteps, double targetYHeadRot) -
igniteForTicks
public void igniteForTicks(int numberOfTicks) - Overrides:
igniteForTicksin classEntity
-
hasInfiniteMaterials
public boolean hasInfiniteMaterials() -
isInvulnerableTo
-
canGlideUsing
-
getLastHurtByPlayerMemoryTime
public int getLastHurtByPlayerMemoryTime() -
isTransmittingWaypoint
public boolean isTransmittingWaypoint()- Specified by:
isTransmittingWaypointin interfaceWaypointTransmitter
-
makeWaypointConnectionWith
- Specified by:
makeWaypointConnectionWithin interfaceWaypointTransmitter
-
waypointIcon
- Specified by:
waypointIconin interfaceWaypointTransmitter
-
PLAYER_NOT_WEARING_DISGUISE_ITEM_FOR_TARGETwith target info instead