Package net.minecraft.world.entity
Class LivingEntity
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.entity.Entity
net.minecraft.world.entity.LivingEntity
- All Implemented Interfaces:
CommandSource,SyncedDataHolder,Attackable,EntityAccess,Nameable,ScoreHolder,IAttachmentHolder,IEntityExtension,ILivingEntityExtension,INBTSerializable<CompoundTag>
- Direct Known Subclasses:
ArmorStand,EntityRendererEventsTest.MyEntity,Mob,Player
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class net.minecraft.world.entity.Entity
Entity.MoveFunction, Entity.MovementEmission, Entity.RemovalReasonNested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
AttachmentHolder.AsField -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate floatprivate final Map<Holder<MobEffect>, MobEffectInstance> protected floatprotected floatprotected floatstatic final intstatic final intfloatprotected intprivate final AttributeMapprotected intstatic final floatstatic final intprotected Brain<?> private final CombatTrackerprivate static final intprivate 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 intprotected intintstatic final floatstatic final doubleprivate booleanprivate booleanstatic final intstatic final floatprotected intprivate static final intstatic final intintintfinal intprivate static final floatprotected booleanprivate final NonNullList<ItemStack> private ItemStackprivate DamageSourceprivate longprivate final NonNullList<ItemStack> protected floatprivate LivingEntityprivate intprotected Playerprotected intprivate LivingEntityprivate intprivate BlockPosprotected intprotected intprotected doubleprotected doubleprotected doubleprotected doubleprotected doubleprotected doubleprotected static final intprotected static final intprotected static final intprivate static final org.slf4j.Loggerprivate static final doublestatic final doubleprotected intprivate intfloatprotected floatprivate static final intstatic final intintintfinal floatprotected floatprotected floatprivate booleanprotected static final EntityDimensionsprivate static final EntityDataAccessor<Optional<BlockPos>> private floatprivate static final UUIDprivate static final UUIDprivate static final AttributeModifierprivate floatprivate floatstatic final intbooleanintprivate static final Stringprivate static final intfinal floatstatic final intprotected ItemStackprotected intfinal WalkAnimationStatefloatfloatfloatfloatfloatfloatfloatFields inherited from class net.minecraft.world.entity.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, hasImpulse, horizontalCollision, hurtMarked, ID_TAG, invulnerableTime, isInPowderSnow, isInsidePortal, mainSupportingBlockPos, MAX_ENTITY_TAG_COUNT, minorHorizontalCollision, moveDist, noCulling, noPhysics, PASSENGERS_TAG, portalEntrancePos, portalTime, random, stringUUID, stuckSpeedMultiplier, tickCount, TOTAL_AIR_SUPPLY, uuid, UUID_TAG, verticalCollision, verticalCollisionBelow, walkDist, walkDistO, wasEyeInWater, wasInPowderSnow, wasOnFire, wasTouchingWater, xo, xOld, xRotO, yo, yOld, yRotO, zo, zOldFields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEYFields inherited from interface net.minecraft.commands.CommandSource
NULLFields inherited from interface net.minecraft.world.scores.ScoreHolder
WILDCARD, WILDCARD_NAME -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLivingEntity(EntityType<? extends LivingEntity> p_20966_, Level p_20967_) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidactuallyHurt(DamageSource p_21240_, float p_21241_) voidaddAdditionalSaveData(CompoundTag p_21145_) private voidaddEatEffect(FoodProperties p_335472_) final booleanaddEffect(MobEffectInstance p_21165_) booleanaddEffect(MobEffectInstance p_147208_, Entity p_147209_) voidaiStep()voidanimateHurt(float p_265265_) static booleanareAllEffectsAmbient(Collection<MobEffectInstance> p_21180_) booleanvoidbaseTick()protected voidblockedByShield(LivingEntity p_21246_) protected voidblockUsingShield(LivingEntity p_21200_) protected Brain.Provider<?> private voidvoidbroadcastBreakEvent(EquipmentSlot p_21167_) voidcalculateEntityAnimation(boolean p_268129_) protected intcalculateFallDamage(float p_21237_, float p_21238_) booleancanAttack(LivingEntity p_21171_) booleancanAttack(LivingEntity p_21041_, TargetingConditions p_21042_) booleancanAttackType(EntityType<?> p_21032_) booleancanBeAffected(MobEffectInstance p_21197_) Deprecated.booleanbooleanfinal booleanDeprecated.booleanbooleanbooleanbooleanbooleancanStandOnFluid(FluidState p_204042_) booleancanTakeItem(ItemStack p_21249_) booleancanUseSlot(EquipmentSlot p_326058_) booleancauseFallDamage(float p_147187_, float p_147188_, DamageSource p_147189_) protected voidcheckAutoSpinAttack(AABB p_21072_, AABB p_21073_) private booleanprotected voidcheckFallDamage(double p_20990_, boolean p_20991_, BlockState p_20992_, BlockPos p_20993_) private booleancheckTotemDeathProtection(DamageSource p_21263_) voidprivate Map<EquipmentSlot, ItemStack> protected voidprivate static SlotAccesscreateEquipmentSlotAccess(LivingEntity p_147196_, EquipmentSlot p_147197_) static AttributeSupplier.Builderprotected voidcreateWitherRose(LivingEntity p_21269_) protected intdecreaseAirSupply(int p_21303_) protected voiddefineSynchedData(SynchedEntityData.Builder p_326178_) private voidvoiddie(DamageSource p_21014_) private voiddismountVehicle(Entity p_21029_) protected voiddoAutoAttackOnTouch(LivingEntity p_21277_) protected booleandoesEmitEquipEvent(EquipmentSlot p_217035_) protected voiddoHurtEquipment(DamageSource p_330843_, float p_330394_, EquipmentSlot... p_331314_) booleandoHurtTarget(Entity p_20970_) protected voidprotected voiddropAllDeathLoot(DamageSource p_21192_) protected voiddropCustomDeathLoot(DamageSource p_21018_, int p_21019_, boolean p_21020_) protected voidprotected voidprotected voiddropFromLootTable(DamageSource p_21021_, boolean p_21022_) private static byteentityEventForEquipmentBreak(EquipmentSlot p_21267_) booleanequipmentHasChanged(ItemStack p_252265_, ItemStack p_251043_) voidforceAddEffect(MobEffectInstance p_147216_, Entity p_147217_) floatfloatfloatintfinal intfloatgetAttackAnim(float p_21325_) getAttribute(Holder<Attribute> p_316333_) doublegetAttributeBaseValue(Holder<Attribute> p_248605_) doublegetAttributeValue(Holder<Attribute> p_251296_) protected floatBrain<?> getBrain()protected final intgetComfortableFallDistance(float p_326294_) private intprotected floatgetDamageAfterArmorAbsorb(DamageSource p_21162_, float p_21163_) protected floatgetDamageAfterMagicAbsorb(DamageSource p_21193_, float p_21194_) protected SoundEventprotected EntityDimensionsgetDefaultDimensions(Pose p_316700_) protected doublefinal EntityDimensionsgetDimensions(Pose p_21047_) com.google.common.collect.ImmutableList<Pose> protected SoundEventgetDrinkingSound(ItemStack p_21174_) getEatingSound(ItemStack p_21202_) private static EquipmentSlotgetEquipmentSlot(int p_147212_) static EquipmentSlotgetEquipmentSlotForItem(ItemStack p_147234_) intprivate SoundEventgetFallDamageSound(int p_21313_) intgetFluidFallingAdjustedMovement(double p_20995_, boolean p_20996_, Vec3 p_20997_) protected floatprivate floatgetFrictionInfluencedSpeed(float p_21331_) floatprotected AABBfloatprotected SoundEventgetHurtSound(DamageSource p_21239_) abstract ItemStackgetItemBySlot(EquipmentSlot p_21127_) getItemInHand(InteractionHand p_21121_) floatprotected floatprotected floatgetJumpPower(float p_326107_) private ItemStackgetLastArmorItem(EquipmentSlot p_21199_) private ItemStackgetLastHandItem(EquipmentSlot p_21245_) intintgetLocalBoundsForPose(Pose p_21271_) longabstract HumanoidArmfinal floatintprotected floatfinal floatintgetPassengerRidingPosition(Entity p_295664_) getProjectile(ItemStack p_21272_) protected Vec3getRelativePortalPosition(Direction.Axis p_21085_, BlockUtil.FoundRectangle p_21086_) protected Vec3getRiddenInput(Player p_278326_, Vec3 p_275300_) protected floatgetRiddenSpeed(Player p_278286_) floatgetScale()getSlot(int p_147238_) static EquipmentSlotgetSlotForHand(InteractionHand p_320526_) protected floatfloatgetSpeed()final intfloatgetSwimAmount(float p_20999_) intintfloatgetViewYRot(float p_21286_) doublegetVisibilityPercent(Entity p_20969_) floatfloatprotected floatfloatprotected voidDeprecated.voidhandleDamageEvent(DamageSource p_270229_) voidhandleEntityEvent(byte p_20975_) private voidhandleEquipmentChanges(Map<EquipmentSlot, ItemStack> p_21143_) private voidhandleHandSwap(Map<EquipmentSlot, ItemStack> p_21092_) private Vec3handleOnClimbable(Vec3 p_21298_) handleRelativeFrictionAndCalculateMovement(Vec3 p_21075_, float p_21076_) booleanbooleanbooleanhasItemInSlot(EquipmentSlot p_21034_) booleanhasLineOfSight(Entity p_147185_) voidheal(float p_21116_) booleanhurt(DamageSource p_21016_, float p_21017_) protected voidhurtArmor(DamageSource p_21122_, float p_21123_) protected voidhurtCurrentlyUsedShield(float p_21316_) protected voidhurtHelmet(DamageSource p_147213_, float p_147214_) voidigniteForTicks(int p_319861_) protected intincreaseAirSupply(int p_21307_) voidindicateDamage(double p_270514_, double p_270826_) protected voidinternalSetAbsorptionAmount(float p_295258_) protected booleanbooleanbooleanisAlive()protected booleanbooleanbooleanisBaby()booleanbooleanbooleanisDamageSourceBlocked(DamageSource p_21276_) booleanbooleanbooleanbooleanprotected booleanbooleanbooleanisInWall()booleanbooleanbooleanbooleanbooleanbooleanbooleanprotected voidprotected voidjumpInLiquid(TagKey<Fluid> p_204043_) Deprecated.voidkill()voidknockback(double p_147241_, double p_147242_, double p_147243_) protected voidlerpHeadRotationStep(int p_296134_, double p_296397_) voidlerpHeadTo(float p_21005_, int p_21006_) doublefloatdoublefloatdoublevoidlerpTo(double p_20977_, double p_20978_, double p_20979_, float p_20980_, float p_20981_, int p_20982_) voidlookAt(EntityAnchorArgument.Anchor p_21078_, Vec3 p_21079_) protected Brain<?> makeBrain(com.mojang.serialization.Dynamic<?> p_21069_) private voidvoidmakeSound(SoundEvent p_320810_) floatprivate voidonAttributeUpdated(Holder<Attribute> p_316778_) protected voidprotected voidonChangedBlock(BlockPos p_21175_) booleanprotected voidonEffectAdded(MobEffectInstance p_147190_, Entity p_147191_) protected voidonEffectRemoved(MobEffectInstance p_21126_) protected voidonEffectUpdated(MobEffectInstance p_147192_, boolean p_147193_, Entity p_147194_) voidvoidonEquipItem(EquipmentSlot p_238393_, ItemStack p_238394_, ItemStack p_238395_) voidonItemPickup(ItemEntity p_21054_) voidprotected booleanvoidonSyncedDataUpdated(EntityDataAccessor<?> p_21104_) protected voidprotected voidplayHurtSound(DamageSource p_21160_) voidprotected voidbooleanrandomTeleport(double p_20985_, double p_20986_, double p_20987_, boolean p_20988_) voidreadAdditionalSaveData(CompoundTag p_21096_) voidrecreateFromPacket(ClientboundAddEntityPacket p_217037_) private voidvoidvoidremove(Entity.RemovalReason p_276115_) booleanbooleanremoveEffect(Holder<MobEffect> p_316570_) removeEffectNoUpdate(Holder<MobEffect> p_316233_) protected voidbooleanRemoves all potion effects that have the givenEffectCurein their set of curesprotected voidprotected voidstatic Vec3voidrideTick()protected floatsanitizeScale(float p_320290_) voidsendEffectToPassengers(MobEffectInstance p_289695_) protected voidfinal voidsetAbsorptionAmount(float p_21328_) final voidsetArrowCount(int p_21318_) voidsetDiscardFriction(boolean p_147245_) voidsetHealth(float p_21154_) voidsetItemInHand(InteractionHand p_21009_, ItemStack p_21010_) abstract voidsetItemSlot(EquipmentSlot p_21036_, ItemStack p_21037_) voidsetJumping(boolean p_21314_) private voidsetLastArmorItem(EquipmentSlot p_21129_, ItemStack p_21130_) private voidsetLastHandItem(EquipmentSlot p_21169_, ItemStack p_21170_) voidsetLastHurtByMob(LivingEntity p_21039_) voidsetLastHurtByPlayer(Player p_21248_) voidsetLastHurtMob(Entity p_21336_) protected voidsetLivingEntityFlag(int p_21156_, boolean p_21157_) voidsetNoActionTime(int p_21311_) private voidsetPosToBed(BlockPos p_21081_) voidsetRecordPlayingNearby(BlockPos p_21082_, boolean p_21083_) voidsetSleepingPos(BlockPos p_21251_) voidsetSpeed(float p_21320_) voidsetSprinting(boolean p_21284_) final voidsetStingerCount(int p_21322_) voidsetYBodyRot(float p_21309_) voidsetYHeadRot(float p_21306_) booleanbooleanprotected booleanprotected booleanshouldRemoveSoulSpeed(BlockState p_21140_) booleanshouldRiderFaceForward(Player player) Returns true if the entity's rider (EntityPlayer) should face forward when mounted.booleanprivate booleanvoidprivate voidspawnItemParticles(ItemStack p_21061_, int p_21062_) protected voidvoidstartSleeping(BlockPos p_21141_) voidstartUsingItem(InteractionHand p_21159_) voidvoidvoidprivate voidvoidswing(InteractionHand p_21007_) voidswing(InteractionHand p_21012_, boolean p_21013_) voidvoidtick()protected voidprotected voidprotected floattickHeadTurn(float p_21260_, float p_21261_) protected voidtickRidden(Player p_278262_, Vec3 p_275242_) private booleantrapdoorUsableAsLadder(BlockPos p_21177_, BlockState p_21178_) voidprivate voidtravelRidden(Player p_278244_, Vec3 p_278231_) protected voidtriggerItemUseEffects(ItemStack p_21138_, int p_21139_) protected voidprotected voidprotected voidprivate voidprivate voidprotected voidprivate voidprotected voidprivate voidprotected voidupdateUsingItem(ItemStack p_147201_) protected voidupdateWalkAnimation(float p_268283_) private voidprotected voidverifyEquippedItem(ItemStack p_181123_) booleanprotected booleanwouldNotSuffocateAtTargetPose(Pose p_294977_) Methods inherited from class net.minecraft.world.entity.Entity
absMoveTo, absMoveTo, acceptsFailure, acceptsSuccess, addDeltaMovement, addPassenger, addTag, applyGravity, awardKillScore, blockPosition, broadcastToPlayer, calculateUpVector, calculateViewVector, canAddPassenger, canBeCollidedWith, canBeHitByProjectile, canCollideWith, canControlVehicle, canRide, canSpawnSprintParticle, canSprint, canTrample, captureDrops, captureDrops, changeDimension, changeDimension, checkBelowWorld, checkDespawn, checkInsideBlocks, checkSlowFallDistance, checkSupportingBlock, chunkPosition, clearFire, closerThan, closerThan, collideBoundingBox, copyPosition, couldAcceptPassenger, countPlayerPassengers, createCommandSourceStack, createHoverEvent, damageSources, dampensVibrations, deflection, discard, dismountsUnderwater, dismountTo, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doEnchantDamageEffects, doWaterSplashEffect, ejectPassengers, equals, extinguishFire, fillCrashReportCategory, findDimensionEntryPoint, fireImmune, fixupDimensions, gameEvent, gameEvent, getAddEntityPacket, getAirSupply, getAttachments, getBbHeight, getBbWidth, getBlockExplosionResistance, getBlockJumpFactor, getBlockPosBelowThatAffectsMyMovement, getBlockStateOn, getBlockStateOnLegacy, getBlockX, getBlockY, getBlockZ, getBoundingBox, getCapability, getCapability, getCollisionHorizontalEscapeVector, getCommandSenderWorld, getControlledVehicle, getControllingPassenger, getCustomName, getDefaultPassengerAttachmentPoint, getDeltaMovement, getDimensionChangingDelay, getDirection, getDismountLocationForPassenger, getDisplayName, getEncodeId, getEntityData, getExitPortal, getEyeHeight, getEyeHeight, getEyeHeightAccess, getEyeInFluidType, getEyePosition, getEyePosition, getEyeY, getFireImmuneTicks, getFirstPassenger, getFluidHeight, getFluidJumpThreshold, getFluidTypeHeight, getForward, getGravity, getHandHoldingItemAngle, getId, getInBlockState, getIndirectPassengers, getLeashOffset, getLeashOffset, getLightLevelDependentMagicValue, getLightProbePosition, getLookAngle, getMaxAirSupply, getMaxHeightFluidType, getMotionDirection, getMovementEmission, getName, getNearestViewDirection, getOnPos, getOnPos, getOnPosLegacy, getPassengerAttachmentPoint, getPassengerClosestTo, getPassengers, getPassengersAndSelf, getPercentFrozen, getPermissionLevel, getPersistentData, getPickRadius, getPickResult, getPistonPushReaction, getPortalCooldown, getPortalWaitTime, getPose, getPosition, getPositionCodec, getPrimaryStepSoundBlockPos, getRandomX, getRandomY, getRandomZ, getRemainingFireTicks, getRemovalReason, getRootVehicle, getRopeHoldPosition, getRotationVector, getScoreboardName, getSelfAndPassengers, getServer, getSharedFlag, getSoundSource, getStringUUID, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTags, getTeam, getTeamColor, getTicksFrozen, getTicksRequiredToFreeze, getType, getTypeName, getUpVector, getUUID, getVehicle, getVehicleAttachmentPoint, getViewScale, getViewVector, getViewXRot, getX, getX, getXRot, getY, getY, getYRot, getZ, getZ, handleInsidePortal, handleNetherPortal, hasControllingPassenger, hasCustomName, hasExactlyOnePlayerPassenger, hasGlowingTag, hashCode, hasIndirectPassenger, hasPassenger, hasPassenger, hasPermissions, hasPose, igniteForSeconds, ignoreExplosion, interact, interactAt, is, isAddedToWorld, isAlliedTo, isAlliedTo, isAlwaysTicking, isAttackable, isColliding, isControlledByLocalInstance, isCrouching, isCustomNameVisible, isDescending, isDiscrete, isEffectiveAi, isEyeInFluid, isFlapping, isFree, isFreezing, isFullyFrozen, isHorizontalCollisionMinor, isIgnoringBlockTriggers, isInFluidType, isInFluidType, isInLava, isInLiquid, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableTo, isInWater, isInWaterOrBubble, isInWaterOrRain, isInWaterRainOrBubble, isNoGravity, isOnFire, isOnPortalCooldown, isOnRails, isPassenger, isPassengerOfSameVehicle, isPushedByFluid, isRemoved, isShiftKeyDown, isSilent, isSpectator, isSprinting, isSteppingCarefully, isSupportedBy, isSuppressingBounce, isSwimming, isUnderWater, isVehicle, isVisuallyCrawling, killedEntity, lavaHurt, lerpMotion, lerpPositionAndRotationStep, level, limitPistonMovement, load, makeBoundingBox, makeStuckInBlock, markHurt, maybeBackOffFromEdge, mayInteract, mirror, move, moveRelative, moveTo, moveTo, moveTo, moveTo, moveTowardsClosestSpace, newDoubleList, newFloatList, nextStep, onAboveBubbleCol, onAddedToWorld, onClientRemoval, onExplosionHit, onFlap, onGround, onInsideBlock, onInsideBubbleColumn, onlyOpCanSetNbt, onPassengerTurned, onRemovedFromWorld, onSyncedDataUpdated, pick, playCombinationStepSounds, playEntityOnFireExtinguishedSound, playerTouch, playMuffledStepSound, playSound, playSound, playStepSound, playSwimSound, position, positionRider, positionRider, processFlappingMovement, processPortalCooldown, push, reapplyPosition, refreshDimensions, registryAccess, removeAfterChangingDimensions, removePassenger, removeTag, removeVehicle, repositionEntityAfterLoad, resetFallDistance, restoreFrom, revive, rotate, save, saveAsPassenger, saveWithoutId, sendSystemMessage, setAirSupply, setBoundingBox, setCustomName, setCustomNameVisible, setData, setDeltaMovement, setDeltaMovement, setFluidTypeHeight, setGlowingTag, setId, setInvisible, setInvulnerable, setIsInPowderSnow, setLevel, setLevelCallback, setNoGravity, setOldPosAndRot, setOnGround, setOnGroundWithKnownMovement, setPortalCooldown, setPortalCooldown, setPos, setPos, setPose, setPosRaw, setRemainingFireTicks, setRemoved, setRot, setSharedFlag, setSharedFlagOnFire, setShiftKeyDown, setSilent, setSwimming, setTicksFrozen, setUUID, setViewScale, setXRot, setYRot, shouldBeSaved, shouldBlockExplode, shouldInformAdmins, shouldRender, shouldRenderAtSqrDistance, showVehicleHealth, skipAttackInteraction, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnSprintParticle, startRiding, startRiding, startSeenByPlayer, stopSeenByPlayer, syncPacketPositionCodec, teleportRelative, teleportTo, teleportTo, teleportToWithTicket, thunderHit, toString, touchingUnloadedChunk, trackingPosition, tryCheckInsideBlocks, turn, unRide, unsetRemoved, updateDynamicGameEventListener, updateFluidHeightAndDoFluidPushing, updateFluidHeightAndDoFluidPushing, updateInWaterStateAndDoFluidPushing, updateInWaterStateAndDoWaterCurrentPushing, updateSwimming, waterSwimSoundMethods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingData, hasAttachments, hasData, removeData, serializeAttachmentsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.commands.CommandSource
alwaysAcceptsMethods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, hasData, removeData, setDataMethods inherited from interface net.neoforged.neoforge.common.extensions.IEntityExtension
canBeRiddenUnderFluidType, canFluidExtinguish, canHydrateInFluidType, canRiderInteract, canStartSwimming, canTrample, captureDrops, captureDrops, copyAttachmentsFrom, deserializeNBT, getClassification, getEyeInFluidType, getFluidFallDistanceModifier, getFluidMotionScale, getFluidTypeHeight, getMaxHeightFluidType, getParts, getPersistentData, getPickedResult, getSoundFromFluidType, hasCustomOutlineRendering, isAddedToWorld, isEyeInFluidType, isInFluidType, isInFluidType, isInFluidType, isInFluidType, isInFluidType, isMultipartEntity, isPushedByFluid, onAddedToWorld, onRemovedFromWorld, revive, sendPairingData, serializeNBT, shouldRiderSitMethods inherited from interface net.neoforged.neoforge.common.extensions.ILivingEntityExtension
canDrownInFluidType, canSwimInFluidType, jumpInFluid, moveInFluid, self, sinkInFluidMethods inherited from interface net.minecraft.world.scores.ScoreHolder
getFeedbackDisplayName
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
TAG_ACTIVE_EFFECTS
- See Also:
-
SPEED_MODIFIER_SOUL_SPEED_UUID
-
SPEED_MODIFIER_POWDER_SNOW_UUID
-
SPEED_MODIFIER_SPRINTING
-
HAND_SLOTS
public static final int HAND_SLOTS- See Also:
-
ARMOR_SLOTS
public static final int ARMOR_SLOTS- See Also:
-
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:
-
SWING_DURATION
public static final int SWING_DURATION- 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:
-
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:
-
USE_ITEM_INTERVAL
public static final int USE_ITEM_INTERVAL- See Also:
-
BASE_JUMP_POWER
public static final float BASE_JUMP_POWER- 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:
-
ITEM_USE_EFFECT_START_FRACTION
private static final float ITEM_USE_EFFECT_START_FRACTION- See Also:
-
attributes
-
combatTracker
-
activeEffects
-
lastHandItemStacks
-
lastArmorItemStacks
-
lastBodyItemStack
-
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 -
walkAnimation
-
invulnerableDuration
public final int invulnerableDuration- See Also:
-
timeOffs
public final float timeOffs -
rotA
public final float rotA -
yBodyRot
public float yBodyRot -
yBodyRotO
public float yBodyRotO -
yHeadRot
public float yHeadRot -
yHeadRotO
public float yHeadRotO -
lastHurtByPlayer
-
lastHurtByPlayerTime
protected int lastHurtByPlayerTime -
dead
protected boolean dead -
noActionTime
protected int noActionTime -
oRun
protected float oRun -
run
protected float run -
animStep
protected float animStep -
animStepO
protected float animStepO -
rotOffs
protected float rotOffs -
deathScore
protected int deathScore -
lastHurt
protected float lastHurt -
jumping
protected boolean jumping -
xxa
public float xxa -
yya
public float yya -
zza
public float zza -
lerpSteps
protected int lerpSteps -
lerpX
protected double lerpX -
lerpY
protected double lerpY -
lerpZ
protected double lerpZ -
lerpYRot
protected double lerpYRot -
lerpXRot
protected double lerpXRot -
lerpYHeadRot
protected double lerpYHeadRot -
lerpHeadSteps
protected int lerpHeadSteps -
effectsDirty
private boolean effectsDirty -
lastHurtByMob
-
lastHurtByMobTimestamp
private int lastHurtByMobTimestamp -
lastHurtMob
-
lastHurtMobTimestamp
private int lastHurtMobTimestamp -
speed
private float speed -
noJumpDelay
private int noJumpDelay -
absorptionAmount
private float absorptionAmount -
useItem
-
useItemRemaining
protected int useItemRemaining -
fallFlyTicks
protected int fallFlyTicks -
lastPos
-
lastClimbablePos
-
lastDamageSource
-
lastDamageStamp
private long lastDamageStamp -
autoSpinAttackTicks
protected int autoSpinAttackTicks -
swimAmount
private float swimAmount -
swimAmountO
private float swimAmountO -
brain
-
skipDropExperience
private boolean skipDropExperience -
appliedScale
protected float appliedScale
-
-
Constructor Details
-
LivingEntity
-
-
Method Details
-
getBrain
-
brainProvider
-
makeBrain
-
kill
public void kill() -
canAttackType
-
defineSynchedData
- Specified by:
defineSynchedDatain classEntity
-
createLivingAttributes
-
checkFallDamage
protected void checkFallDamage(double p_20990_, boolean p_20991_, BlockState p_20992_, BlockPos p_20993_) - Overrides:
checkFallDamagein classEntity
-
canBreatheUnderwater
Deprecated. -
getSwimAmount
public float getSwimAmount(float p_20999_) -
baseTick
public void baseTick() -
canSpawnSoulSpeedParticle
public boolean canSpawnSoulSpeedParticle() -
spawnSoulSpeedParticle
protected void spawnSoulSpeedParticle() -
onSoulSpeedBlock
protected boolean onSoulSpeedBlock() -
getBlockSpeedFactor
protected float getBlockSpeedFactor()- Overrides:
getBlockSpeedFactorin classEntity
-
shouldRemoveSoulSpeed
-
removeSoulSpeed
protected void removeSoulSpeed() -
tryAddSoulSpeed
protected void tryAddSoulSpeed() -
removeFrost
protected void removeFrost() -
tryAddFrost
protected void tryAddFrost() -
onChangedBlock
-
isBaby
public boolean isBaby() -
getAgeScale
public float getAgeScale() -
getScale
public float getScale() -
sanitizeScale
protected float sanitizeScale(float p_320290_) -
isAffectedByFluids
protected boolean isAffectedByFluids() -
tickDeath
protected void tickDeath() -
shouldDropExperience
public boolean shouldDropExperience() -
shouldDropLoot
protected boolean shouldDropLoot() -
decreaseAirSupply
protected int decreaseAirSupply(int p_21303_) -
increaseAirSupply
protected int increaseAirSupply(int p_21307_) -
getExperienceReward
public int getExperienceReward() -
isAlwaysExperienceDropper
protected boolean isAlwaysExperienceDropper() -
getRandom
-
getLastHurtByMob
-
getLastAttacker
- Specified by:
getLastAttackerin interfaceAttackable
-
getLastHurtByMobTimestamp
public int getLastHurtByMobTimestamp() -
setLastHurtByPlayer
-
setLastHurtByMob
-
getLastHurtMob
-
getLastHurtMobTimestamp
public int getLastHurtMobTimestamp() -
setLastHurtMob
-
getNoActionTime
public int getNoActionTime() -
setNoActionTime
public void setNoActionTime(int p_21311_) -
shouldDiscardFriction
public boolean shouldDiscardFriction() -
setDiscardFriction
public void setDiscardFriction(boolean p_147245_) -
doesEmitEquipEvent
-
onEquipItem
-
remove
-
addAdditionalSaveData
- Specified by:
addAdditionalSaveDatain classEntity
-
readAdditionalSaveData
- Specified by:
readAdditionalSaveDatain classEntity
-
tickEffects
protected void tickEffects() -
updateInvisibilityStatus
protected void updateInvisibilityStatus() -
updateSynchronizedMobEffectParticles
private void updateSynchronizedMobEffectParticles() -
updateGlowingStatus
private void updateGlowingStatus() -
getVisibilityPercent
-
canAttack
-
canAttack
-
canBeSeenAsEnemy
public boolean canBeSeenAsEnemy() -
canBeSeenByAnyone
public boolean canBeSeenByAnyone() -
areAllEffectsAmbient
-
removeEffectParticles
protected void removeEffectParticles() -
removeAllEffects
public boolean removeAllEffects() -
getActiveEffects
-
getActiveEffectsMap
-
hasEffect
-
getEffect
-
addEffect
-
addEffect
-
canBeAffected
Deprecated.Neo: Override-Only. Call viaCommonHooks.canMobEffectBeApplied(LivingEntity, MobEffectInstance)- Parameters:
p_21197_- 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 p_147192_, boolean p_147193_, @Nullable Entity p_147194_) -
onEffectRemoved
-
refreshDirtyAttributes
private void refreshDirtyAttributes() -
onAttributeUpdated
-
heal
public void heal(float p_21116_) -
getHealth
public float getHealth() -
setHealth
public void setHealth(float p_21154_) -
isDeadOrDying
public boolean isDeadOrDying() -
hurt
-
blockUsingShield
-
blockedByShield
-
checkTotemDeathProtection
-
getLastDamageSource
-
playHurtSound
-
makeSound
-
isDamageSourceBlocked
-
breakItem
-
die
-
createWitherRose
-
dropAllDeathLoot
-
dropEquipment
protected void dropEquipment() -
dropExperience
protected void dropExperience() -
dropCustomDeathLoot
-
getLootTable
-
getLootTableSeed
public long getLootTableSeed() -
dropFromLootTable
-
knockback
public void knockback(double p_147241_, double p_147242_, double p_147243_) -
indicateDamage
public void indicateDamage(double p_270514_, double p_270826_) -
getHurtSound
-
getDeathSound
-
getFallDamageSound
-
skipDropExperience
public void skipDropExperience() -
wasExperienceConsumed
public boolean wasExperienceConsumed() -
getHurtDir
public float getHurtDir() -
getHitbox
-
getFallSounds
-
getDrinkingSound
-
getEatingSound
-
getLastClimbablePos
-
onClimbable
public boolean onClimbable() -
trapdoorUsableAsLadder
-
isAlive
public boolean isAlive() -
getMaxFallDistance
public int getMaxFallDistance()- Overrides:
getMaxFallDistancein classEntity
-
getComfortableFallDistance
protected final int getComfortableFallDistance(float p_326294_) -
causeFallDamage
- Overrides:
causeFallDamagein classEntity
-
calculateFallDamage
protected int calculateFallDamage(float p_21237_, float p_21238_) -
playBlockFallSound
protected void playBlockFallSound() -
animateHurt
public void animateHurt(float p_265265_) - Overrides:
animateHurtin classEntity
-
getArmorValue
public int getArmorValue() -
hurtArmor
-
hurtHelmet
-
hurtCurrentlyUsedShield
protected void hurtCurrentlyUsedShield(float p_21316_) -
doHurtEquipment
-
getDamageAfterArmorAbsorb
-
getDamageAfterMagicAbsorb
-
actuallyHurt
-
getCombatTracker
-
getKillCredit
-
getMaxHealth
public final float getMaxHealth() -
getMaxAbsorption
public final float getMaxAbsorption() -
getArrowCount
public final int getArrowCount() -
setArrowCount
public final void setArrowCount(int p_21318_) -
getStingerCount
public final int getStingerCount() -
setStingerCount
public final void setStingerCount(int p_21322_) -
getCurrentSwingDuration
private int getCurrentSwingDuration() -
swing
-
swing
-
handleDamageEvent
- Overrides:
handleDamageEventin classEntity
-
handleEntityEvent
public void handleEntityEvent(byte p_20975_) - Overrides:
handleEntityEventin classEntity
-
makePoofParticles
private void makePoofParticles() -
swapHandItems
private void swapHandItems() -
onBelowWorld
protected void onBelowWorld()- Overrides:
onBelowWorldin classEntity
-
updateSwingTime
protected void updateSwingTime() -
getAttribute
-
getAttributeValue
-
getAttributeBaseValue
-
getAttributes
-
getMainHandItem
-
getOffhandItem
-
isHolding
-
isHolding
-
getItemInHand
-
setItemInHand
-
hasItemInSlot
-
canUseSlot
-
getArmorSlots
-
getItemBySlot
-
setItemSlot
-
getHandSlots
-
getArmorAndBodyArmorSlots
-
getAllSlots
-
verifyEquippedItem
-
getArmorCoverPercentage
public float getArmorCoverPercentage() -
setSprinting
public void setSprinting(boolean p_21284_) - 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 p_326107_) -
getJumpBoostPower
public float getJumpBoostPower() -
jumpFromGround
protected void jumpFromGround() -
goDownInWater
Deprecated. -
jumpInLiquid
Deprecated. -
getWaterSlowDown
protected float getWaterSlowDown() -
canStandOnFluid
-
getDefaultGravity
protected double getDefaultGravity()- Overrides:
getDefaultGravityin classEntity
-
travel
-
travelRidden
-
tickRidden
-
getRiddenInput
-
getRiddenSpeed
-
calculateEntityAnimation
public void calculateEntityAnimation(boolean p_268129_) -
updateWalkAnimation
protected void updateWalkAnimation(float p_268283_) -
handleRelativeFrictionAndCalculateMovement
-
getFluidFallingAdjustedMovement
-
handleOnClimbable
-
getFrictionInfluencedSpeed
private float getFrictionInfluencedSpeed(float p_21331_) -
getFlyingSpeed
protected float getFlyingSpeed() -
getSpeed
public float getSpeed() -
setSpeed
public void setSpeed(float p_21320_) -
doHurtTarget
-
tick
public void tick() -
detectEquipmentUpdates
private void detectEquipmentUpdates() -
collectEquipmentChanges
-
equipmentHasChanged
-
handleHandSwap
-
handleEquipmentChanges
-
getLastArmorItem
-
setLastArmorItem
-
getLastHandItem
-
setLastHandItem
-
tickHeadTurn
protected float tickHeadTurn(float p_21260_, float p_21261_) -
getMaxHeadRotationRelativeToBody
protected float getMaxHeadRotationRelativeToBody() -
aiStep
public void aiStep() -
isSensitiveToWater
public boolean isSensitiveToWater() -
updateFallFlying
private void updateFallFlying() -
serverAiStep
protected void serverAiStep() -
pushEntities
protected void pushEntities() -
checkAutoSpinAttack
-
doPush
-
doAutoAttackOnTouch
-
isAutoSpinAttack
public boolean isAutoSpinAttack() -
stopRiding
public void stopRiding()- Overrides:
stopRidingin classEntity
-
rideTick
public void rideTick() -
lerpTo
public void lerpTo(double p_20977_, double p_20978_, double p_20979_, float p_20980_, float p_20981_, int p_20982_) -
lerpTargetX
public double lerpTargetX()- Overrides:
lerpTargetXin classEntity
-
lerpTargetY
public double lerpTargetY()- Overrides:
lerpTargetYin classEntity
-
lerpTargetZ
public double lerpTargetZ()- Overrides:
lerpTargetZin classEntity
-
lerpTargetXRot
public float lerpTargetXRot()- Overrides:
lerpTargetXRotin classEntity
-
lerpTargetYRot
public float lerpTargetYRot()- Overrides:
lerpTargetYRotin classEntity
-
lerpHeadTo
public void lerpHeadTo(float p_21005_, int p_21006_) - Overrides:
lerpHeadToin classEntity
-
setJumping
public void setJumping(boolean p_21314_) -
onItemPickup
-
take
-
hasLineOfSight
-
getViewYRot
public float getViewYRot(float p_21286_) - Overrides:
getViewYRotin classEntity
-
getAttackAnim
public float getAttackAnim(float p_21325_) -
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 p_21306_) - Overrides:
setYHeadRotin classEntity
-
setYBodyRot
public void setYBodyRot(float p_21309_) - Overrides:
setYBodyRotin classEntity
-
getRelativePortalPosition
protected Vec3 getRelativePortalPosition(Direction.Axis p_21085_, BlockUtil.FoundRectangle p_21086_) - Overrides:
getRelativePortalPositionin classEntity
-
resetForwardDirectionOfRelativePortalPosition
-
getAbsorptionAmount
public float getAbsorptionAmount() -
setAbsorptionAmount
public final void setAbsorptionAmount(float p_21328_) -
internalSetAbsorptionAmount
protected void internalSetAbsorptionAmount(float p_295258_) -
onEnterCombat
public void onEnterCombat() -
onLeaveCombat
public void onLeaveCombat() -
updateEffectVisibility
protected void updateEffectVisibility() -
getMainArm
-
isUsingItem
public boolean isUsingItem() -
getUsedItemHand
-
updatingUsingItem
private void updatingUsingItem() -
updateUsingItem
-
shouldTriggerItemUseEffects
private boolean shouldTriggerItemUseEffects() -
updateSwimAmount
private void updateSwimAmount() -
setLivingEntityFlag
protected void setLivingEntityFlag(int p_21156_, boolean p_21157_) -
startUsingItem
-
onSyncedDataUpdated
- Specified by:
onSyncedDataUpdatedin interfaceSyncedDataHolder- Overrides:
onSyncedDataUpdatedin classEntity
-
lookAt
-
triggerItemUseEffects
-
spawnItemParticles
-
completeUsingItem
protected void completeUsingItem() -
getUseItem
-
getUseItemRemainingTicks
public int getUseItemRemainingTicks() -
getTicksUsingItem
public int getTicksUsingItem() -
releaseUsingItem
public void releaseUsingItem() -
stopUsingItem
public void stopUsingItem() -
isBlocking
public boolean isBlocking() -
isSuppressingSlidingDownLadder
public boolean isSuppressingSlidingDownLadder() -
isFallFlying
public boolean isFallFlying() -
isVisuallySwimming
public boolean isVisuallySwimming()- Overrides:
isVisuallySwimmingin classEntity
-
getFallFlyingTicks
public int getFallFlyingTicks() -
randomTeleport
public boolean randomTeleport(double p_20985_, double p_20986_, double p_20987_, boolean p_20988_) -
isAffectedByPotions
public boolean isAffectedByPotions() -
attackable
public boolean attackable() -
setRecordPlayingNearby
-
canTakeItem
-
getDimensions
- Overrides:
getDimensionsin classEntity
-
getDefaultDimensions
-
getDismountPoses
-
getLocalBoundsForPose
-
wouldNotSuffocateAtTargetPose
-
canChangeDimensions
public boolean canChangeDimensions()- Overrides:
canChangeDimensionsin classEntity
-
getSleepingPos
-
setSleepingPos
-
clearSleepingPos
public void clearSleepingPos() -
isSleeping
public boolean isSleeping() -
startSleeping
-
setPosToBed
-
checkBedExists
private boolean checkBedExists() -
stopSleeping
public void stopSleeping() -
getBedOrientation
-
isInWall
public boolean isInWall() -
getProjectile
-
eat
-
addEatEffect
-
entityEventForEquipmentBreak
-
broadcastBreakEvent
-
getSlotForHand
-
removeEffectsCuredBy
Removes all potion effects that have the givenEffectCurein their set of cures- Parameters:
cure- the EffectCure being used
-
shouldRiderFaceForward
Returns true if the entity's rider (EntityPlayer) should face forward when mounted. currently only used in vanilla code by pigs.- Parameters:
player- The player who is riding the entity.- Returns:
- If the player should orient the same direction as this entity.
-
getBoundingBoxForCulling
- Overrides:
getBoundingBoxForCullingin classEntity
-
getEquipmentSlotForItem
-
createEquipmentSlotAccess
private static SlotAccess createEquipmentSlotAccess(LivingEntity p_147196_, EquipmentSlot p_147197_) -
getEquipmentSlot
-
getSlot
-
canFreeze
public boolean canFreeze() -
isCurrentlyGlowing
public boolean isCurrentlyGlowing()- Overrides:
isCurrentlyGlowingin classEntity
-
getVisualRotationYInDegrees
public float getVisualRotationYInDegrees()- Overrides:
getVisualRotationYInDegreesin classEntity
-
recreateFromPacket
- Overrides:
recreateFromPacketin classEntity
-
canDisableShield
public boolean canDisableShield() -
maxUpStep
public float maxUpStep() -
getPassengerRidingPosition
- Overrides:
getPassengerRidingPositionin classEntity
-
lerpHeadRotationStep
protected void lerpHeadRotationStep(int p_296134_, double p_296397_) -
igniteForTicks
public void igniteForTicks(int p_319861_) - Overrides:
igniteForTicksin classEntity
-
hasInfiniteMaterials
public boolean hasInfiniteMaterials()
-