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:
DataComponentGetter
,SyncedDataHolder
,Attackable
,EntityAccess
,UniquelyIdentifyable
,Nameable
,ScoreHolder
,Waypoint
,WaypointTransmitter
,IAttachmentHolder
,IEntityExtension
,ILivingEntityExtension
- Direct Known Subclasses:
ArmorStand
,Mob
,Player
public abstract class LivingEntity
extends Entity
implements Attackable, WaypointTransmitter, ILivingEntityExtension
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class net.minecraft.world.entity.Entity
Entity.EntityPathElement, Entity.MoveFunction, Entity.Movement, Entity.MovementEmission, Entity.RemovalReason
Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
AttachmentHolder.AsField
Nested classes/interfaces inherited from interface net.minecraft.world.waypoints.Waypoint
Waypoint.Icon
Nested classes/interfaces inherited from interface net.minecraft.world.waypoints.WaypointTransmitter
WaypointTransmitter.BlockConnection, WaypointTransmitter.ChunkConnection, WaypointTransmitter.Connection, WaypointTransmitter.EntityAzimuthConnection, WaypointTransmitter.EntityBlockConnection, WaypointTransmitter.EntityChunkConnection
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate float
private final Map
<Holder<MobEffect>, MobEffectInstance> private final EnumMap
<EquipmentSlot, it.unimi.dsi.fastutil.objects.Reference2ObjectMap<Enchantment, Set<EnchantmentLocationBasedEffect>>> static final int
float
protected int
private final AttributeMap
protected float
protected ItemStack
protected int
static final float
static final int
protected Brain
<?> private final CombatTracker
private static final int
protected Stack
<DamageContainer> This field stores information about damage dealt to this entity.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 boolean
static final int
int
static final float
static final double
private boolean
private boolean
final ElytraAnimationState
private static final com.mojang.serialization.Dynamic
<?> protected final EntityEquipment
static final int
static final float
protected int
private static final int
int
int
protected static final float
protected InterpolationHandler
final int
protected boolean
private DamageSource
private long
private final Map
<EquipmentSlot, ItemStack> protected float
Damage taken in the last hit.private EntityReference
<LivingEntity> private int
protected EntityReference
<Player> protected int
private LivingEntity
private int
Holds the value of ticksExisted when setLastAttacker was last called.private BlockPos
protected int
protected double
protected static final int
protected static final int
protected static final int
private Waypoint.Icon
private static final org.slf4j.Logger
private static final double
static final double
protected int
private int
float
private static final int
static final int
static final Predicate
<LivingEntity> Deprecated.static final BiPredicate
<LivingEntity, @Nullable LivingEntity> int
int
static final int
private boolean
protected static final EntityDimensions
private static final EntityDataAccessor
<Optional<BlockPos>> private float
private static final ResourceLocation
private static final AttributeModifier
private static final ResourceLocation
private float
private float
static final int
boolean
int
private static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
private static final int
protected ItemStack
protected int
final WalkAnimationState
float
float
float
float
float
float
float
Fields 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, invulnerableTime, isInPowderSnow, mainSupportingBlockPos, MAX_ENTITY_TAG_COUNT, MAX_MOVEMENTS_HANDELED_PER_TICK, minorHorizontalCollision, moveDist, noPhysics, portalProcess, random, stringUUID, stuckSpeedMultiplier, TAG_AIR, 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, zOld
Fields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEY
Fields inherited from interface net.minecraft.world.scores.ScoreHolder
WILDCARD, WILDCARD_NAME
Fields inherited from interface net.minecraft.world.waypoints.Waypoint
MAX_RANGE, WAYPOINT_TRANSMIT_RANGE_HIDE_MODIFIER
Fields inherited from interface net.minecraft.world.waypoints.WaypointTransmitter
REALLY_FAR_DISTANCE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
LivingEntity
(EntityType<? extends LivingEntity> pEntityType, Level pLevel) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
actuallyHurt
(ServerLevel pLevel, DamageSource pDamageSource, float pAmount) protected void
addAdditionalSaveData
(ValueOutput pOutput) final boolean
addEffect
(MobEffectInstance pEffectInstance) boolean
addEffect
(MobEffectInstance pEffectInstance, Entity pEntity) void
aiStep()
void
animateHurt
(float pYaw) protected void
float
applyItemBlocking
(ServerLevel pLevel, DamageSource pDamageSource, float pDamageAmount) static boolean
areAllEffectsAmbient
(Collection<MobEffectInstance> pPotionEffects) Returnstrue
if all the potion effects in the specified collection are ambient.boolean
void
baseTick()
protected void
blockedByItem
(LivingEntity pEntity) protected void
blockUsingItem
(ServerLevel pLevel, LivingEntity pEntity) protected Brain.Provider
<?> private void
Renders broken item particles using the given ItemStackvoid
calculateEntityAnimation
(boolean pIncludeHeight) protected int
calculateFallDamage
(double pFallDistance, float pDamageMultiplier) private double
calculateFallPower
(double pFallDistance) boolean
canAttack
(LivingEntity pTarget) boolean
canAttackType
(EntityType<?> pEntityType) boolean
canBeAffected
(MobEffectInstance pEffectInstance) Deprecated.boolean
boolean
boolean
Deprecated.protected boolean
final boolean
canEquipWithDispenser
(ItemStack pStack) boolean
protected boolean
canGlide()
static boolean
canGlideUsing
(ItemStack pStack, EquipmentSlot pSlot) boolean
boolean
canStandOnFluid
(FluidState pFluidState) boolean
canUsePortal
(boolean pAllowPassengers) boolean
canUseSlot
(EquipmentSlot pSlot) boolean
causeFallDamage
(double pFallDistance, float pDamageMultiplier, DamageSource pDamageSource) protected void
checkAutoSpinAttack
(AABB pBoundingBoxBeforeSpin, AABB pBoundingBoxAfterSpin) private boolean
protected void
checkFallDamage
(double pY, boolean pOnGround, BlockState pState, BlockPos pPos) private boolean
checkTotemDeathProtection
(DamageSource pDamageSource) void
private Map
<EquipmentSlot, ItemStack> protected void
protected EntityEquipment
private static SlotAccess
createEquipmentSlotAccess
(LivingEntity pEntity, EquipmentSlot pSlot) private ItemEntity
createItemStackToDrop
(ItemStack pStack, boolean pRandomizeMotion, boolean pIncludeThrower) static AttributeSupplier.Builder
protected void
createWitherRose
(LivingEntity pEntitySource) protected int
decreaseAirSupply
(int pCurrentAir) Decrements the entity's air supply when underwaterprotected void
defineSynchedData
(SynchedEntityData.Builder pBuilder) private void
void
die
(DamageSource pDamageSource) Called when the mob's health reaches 0.private void
dismountVehicle
(Entity pVehicle) protected void
doAutoAttackOnTouch
(LivingEntity pTarget) protected boolean
doesEmitEquipEvent
(EquipmentSlot pSlot) protected void
doHurtEquipment
(DamageSource pDamageSource, float pDamageAmount, EquipmentSlot... pSlots) boolean
doHurtTarget
(ServerLevel pLevel, Entity pSource) protected void
protected void
dropAllDeathLoot
(ServerLevel pLevel, DamageSource pDamageSource) protected void
dropCustomDeathLoot
(ServerLevel pLevel, DamageSource pDamageSource, boolean pRecentlyHit) protected void
dropEquipment
(ServerLevel pLevel) protected void
dropExperience
(ServerLevel pLevel, Entity pEntity) boolean
dropFromGiftLootTable
(ServerLevel pLevel, ResourceKey<LootTable> pLootTable, BiConsumer<ServerLevel, ItemStack> pDropConsumer) protected boolean
dropFromLootTable
(ServerLevel pLevel, ResourceKey<LootTable> pLootTable, Function<LootParams.Builder, LootParams> pParamsBuilder, BiConsumer<ServerLevel, ItemStack> pDropConsumer) protected void
dropFromLootTable
(ServerLevel pLevel, DamageSource pDamageSource, boolean pPlayerKill) protected void
dropFromShearingLootTable
(ServerLevel pLevel, ResourceKey<LootTable> pLootTable, ItemStack pShears, BiConsumer<ServerLevel, ItemStack> pDropConsumer) private static byte
boolean
equipmentHasChanged
(ItemStack pOldItem, ItemStack pNewItem) void
forceAddEffect
(MobEffectInstance pInstance, Entity pEntity) float
float
float
int
final int
float
getAttackAnim
(float pPartialTick) Gets the progression of the swing animation, ranges from 0.0 to 1.0.getAttribute
(Holder<Attribute> pAttribute) double
getAttributeBaseValue
(Holder<Attribute> pAttribute) double
getAttributeValue
(Holder<Attribute> pAttribute) protected int
getBaseExperienceReward
(ServerLevel pLevel) protected float
Brain
<?> getBrain()
protected final int
getComfortableFallDistance
(float pHealth) int
protected float
getDamageAfterArmorAbsorb
(DamageSource pDamageSource, float pDamageAmount) Reduces damage, depending on armorprotected float
getDamageAfterMagicAbsorb
(DamageSource pDamageSource, float pDamageAmount) Reduces damage, depending on potionsprotected SoundEvent
protected EntityDimensions
getDefaultDimensions
(Pose pPose) protected double
final EntityDimensions
getDimensions
(Pose pPose) com.google.common.collect.ImmutableList
<Pose> float
getEffectBlendFactor
(Holder<MobEffect> pEffect, float pPartialTick) protected double
private static EquipmentSlot
getEquipmentSlot
(int pIndex) final EquipmentSlot
getEquipmentSlotForItem
(ItemStack pStack) protected Holder
<SoundEvent> getEquipSound
(EquipmentSlot pSlot, ItemStack pStack, Equippable pEquippable) final int
getExperienceReward
(ServerLevel pLevel, Entity pKiller) private SoundEvent
getFallDamageSound
(int pHeight) int
getFluidFallingAdjustedMovement
(double pGravity, boolean pIsFalling, Vec3 pDeltaMovement) protected float
private float
getFrictionInfluencedSpeed
(float pFriction) float
float
protected SoundEvent
getHurtSound
(DamageSource pDamageSource) getItemBySlot
(EquipmentSlot pSlot) getItemHeldByArm
(HumanoidArm pArm) getItemInHand
(InteractionHand pHand) float
protected float
protected float
getJumpPower
(float pMultiplier) protected float
getKnockback
(Entity pAttacker, DamageSource pDamageSource) int
int
int
getLocalBoundsForPose
(Pose pPose) long
float
getLuck()
abstract HumanoidArm
final float
int
protected float
final float
int
getPassengerRidingPosition
(Entity pEntity) float
getPreciseBodyRotation
(float pPartialTick) getProjectile
(ItemStack pWeaponStack) getRelativePortalPosition
(Direction.Axis pAxis, BlockUtil.FoundRectangle pPortal) protected Vec3
getRiddenInput
(Player pPlayer, Vec3 pTravelVector) protected float
getRiddenSpeed
(Player pPlayer) final float
getScale()
float
getSlot
(int pSlot) static EquipmentSlot
getSlotForHand
(InteractionHand pHand) protected float
float
getSpeed()
final int
float
getSwimAmount
(float pPartialTicks) int
int
float
getViewYRot
(float pPartialTicks) Gets the current yaw of the entitydouble
getVisibilityPercent
(Entity pLookingEntity) float
float
protected float
float
protected void
Deprecated.void
handleDamageEvent
(DamageSource pDamageSource) void
handleEntityEvent
(byte pId) Handler forinvalid reference
World#setEntityState
private void
handleEquipmentChanges
(Map<EquipmentSlot, ItemStack> pEquipments) void
private void
handleFallFlyingCollisions
(double pOldSpeed, double pNewSpeed) private void
handleHandSwap
(Map<EquipmentSlot, ItemStack> pHands) private Vec3
handleOnClimbable
(Vec3 pDeltaMovement) private Vec3
handleRelativeFrictionAndCalculateMovement
(Vec3 pDeltaMovement, float pFriction) boolean
boolean
boolean
hasItemInSlot
(EquipmentSlot pSlot) boolean
boolean
hasLineOfSight
(Entity pEntity) boolean
hasLineOfSight
(Entity pEntity, ClipContext.Block pBlock, ClipContext.Fluid pFluid, double pY) void
heal
(float pHealAmount) Heal living entity (param: amount of half-hearts)protected void
hurtArmor
(DamageSource pDamageSource, float pDamageAmount) protected void
hurtHelmet
(DamageSource pDamageSource, float pDamageAmount) boolean
hurtServer
(ServerLevel pLevel, DamageSource pDamageSource, float pAmount) void
igniteForTicks
(int pTicks) protected int
increaseAirSupply
(int pCurrentAir) void
indicateDamage
(double pXDistance, double pZDistance) protected void
internalSetAbsorptionAmount
(float pAbsorptionAmount) boolean
boolean
boolean
isAlive()
protected boolean
boolean
boolean
isBaby()
boolean
boolean
boolean
final boolean
isEquippableInSlot
(ItemStack pStack, EquipmentSlot pSlot) boolean
boolean
boolean
protected boolean
boolean
boolean
isInvulnerableTo
(ServerLevel pLevel, DamageSource pDamageSource) boolean
isInWall()
boolean
boolean
isLookingAtMe
(LivingEntity pEntity, double pTolerance, boolean pScaleByDistance, boolean pVisual, double... pYValues) boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
void
protected void
jumpInLiquid
(TagKey<Fluid> pFluidTag) Deprecated.void
kill
(ServerLevel pLevel) void
knockback
(double pStrength, double pX, double pZ) protected void
lerpHeadRotationStep
(int pLerpHeadSteps, double pLerpYHeadRot) void
lerpHeadTo
(float pYaw, int pPitch) void
lookAt
(EntityAnchorArgument.Anchor pAnchor, Vec3 pTarget) protected Brain
<?> makeBrain
(com.mojang.serialization.Dynamic<?> p_21069_) private void
void
void
makeSound
(SoundEvent pSound) makeWaypointConnectionWith
(ServerPlayer pPlayer) float
protected void
onAttributeUpdated
(Holder<Attribute> pAttribute) protected void
protected void
onChangedBlock
(ServerLevel pLevel, BlockPos pPos) boolean
protected void
onEffectAdded
(MobEffectInstance pEffectInstance, Entity pEntity) protected void
onEffectsRemoved
(Collection<MobEffectInstance> pEffects) protected void
onEffectUpdated
(MobEffectInstance pEffectInstance, boolean pForced, Entity pEntity) void
void
onEquipItem
(EquipmentSlot pSlot, ItemStack pOldItem, ItemStack pNewItem) void
onEquippedItemBroken
(Item pItem, EquipmentSlot pSlot) void
onItemPickup
(ItemEntity pItemEntity) void
void
onRemoval
(Entity.RemovalReason pReason) void
onSyncedDataUpdated
(EntityDataAccessor<?> pKey) protected void
protected void
playHurtSound
(DamageSource pSource) private void
playSecondaryHurtSound
(DamageSource pDamageSource) void
Applies a velocity to the entities, to push them away from each other.protected void
boolean
randomTeleport
(double pX, double pY, double pZ, boolean pBroadcastTeleport) protected void
readAdditionalSaveData
(ValueInput pInput) void
private void
void
void
remove
(Entity.RemovalReason pReason) boolean
boolean
removeEffect
(Holder<MobEffect> pEffect) final MobEffectInstance
removeEffectNoUpdate
(Holder<MobEffect> pEffect) protected void
protected void
static Vec3
resetForwardDirectionOfRelativePortalPosition
(Vec3 pRelativePortalPosition) protected void
resolveMobResponsibleForDamage
(DamageSource pDamageSource) protected Player
resolvePlayerResponsibleForDamage
(DamageSource pDamageSource) void
rideTick()
protected float
sanitizeScale
(float pScale) void
sendEffectToPassengers
(MobEffectInstance pEffectInstance) protected void
final void
setAbsorptionAmount
(float pAbsorptionAmount) final void
setArrowCount
(int pCount) Sets the amount of arrows stuck in the entity.void
setDiscardFriction
(boolean pDiscardFriction) void
setHealth
(float pHealth) void
setItemInHand
(InteractionHand pHand, ItemStack pStack) void
setItemSlot
(EquipmentSlot pSlot, ItemStack pStack) void
setJumping
(boolean pJumping) void
setLastHurtByMob
(LivingEntity pLivingEntity) Hint to AI tasks that we were attacked by the passed EntityLivingBase and should retaliate.void
setLastHurtByPlayer
(UUID pUuid, int pMemoryTime) private void
setLastHurtByPlayer
(EntityReference<Player> pPlayer, int pMemoryTime) void
setLastHurtByPlayer
(Player pPlayer, int pMemoryTime) void
setLastHurtMob
(Entity pEntity) protected void
setLivingEntityFlag
(int pKey, boolean pValue) void
setNoActionTime
(int pIdleTime) private void
setPosToBed
(BlockPos p_21081_) Sets entity position to a supplied BlockPos plus a little offsetvoid
setRecordPlayingNearby
(BlockPos pJukebox, boolean pPartyParrot) Called when a record starts or stops playing.void
setSleepingPos
(BlockPos pPos) void
setSpeed
(float pSpeed) Sets the movespeed used for the new AI system.void
setSprinting
(boolean pSprinting) Set sprinting switch for Entity.final void
setStingerCount
(int pStingerCount) void
setYBodyRot
(float pOffset) Set the render yaw offsetvoid
setYHeadRot
(float pRotation) Sets the head's yaw rotation of the entity.boolean
boolean
protected boolean
boolean
void
void
spawnItemParticles
(ItemStack pStack, int pAmount) void
startSleeping
(BlockPos pPos) void
startUsingItem
(InteractionHand pHand) void
private void
stopLocationBasedEffects
(ItemStack pStack, EquipmentSlot pSlot, AttributeMap pAttributeMap) void
void
void
private void
void
swing
(InteractionHand pHand) void
swing
(InteractionHand pHand, boolean pUpdateSelf) void
Called when the entity picks up an item.void
tick()
protected void
protected void
protected void
tickHeadTurn
(float pYBodyRot) protected void
tickRidden
(Player pPlayer, Vec3 pTravelVector) private boolean
trapdoorUsableAsLadder
(BlockPos pPos, BlockState pState) void
private void
travelFallFlying
(Vec3 pTravelVector) protected void
travelFlying
(Vec3 pRelative, float pAmount) protected void
travelFlying
(Vec3 pRelative, float pInWaterAmount, float pInLavaAmount, float pAmount) private void
travelInAir
(Vec3 pTravelVector) private void
travelInFluid
(Vec3 pTravelVector) Deprecated.Neo: usetravelInFluid(Vec3, FluidState)
insteadprivate void
travelInFluid
(Vec3 pTravelVector, FluidState fluidState) private void
travelRidden
(Player pPlayer, Vec3 pTravelVector) protected void
triggerOnDeathMobEffects
(ServerLevel pLevel, Entity.RemovalReason pRemovalReason) protected void
protected void
protected void
private Vec3
updateFallFlyingMovement
(Vec3 pDeltaMovement) private void
protected void
private void
protected void
private void
protected void
updateUsingItem
(ItemStack pUsingItem) protected void
updateWalkAnimation
(float pPartialTick) private void
boolean
protected boolean
Methods inherited from class net.minecraft.world.entity.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, canRide, canSimulateMovement, canSpawnSprintParticle, canSprint, canTeleport, canTrample, captureDrops, captureDrops, castComponentValue, checkBelowWorld, checkDespawn, checkFallDistanceAccumulation, checkSupportingBlock, chunkPosition, clearFire, clearFreeze, clearMovementThisTick, closerThan, closerThan, collideBoundingBox, collidedWithFluid, collidedWithShapeMovingFrom, considersEntityAsAlly, copyPosition, couldAcceptPassenger, countPlayerPassengers, createCommandSourceStackForNameResolution, createHoverEvent, damageSources, dampensVibrations, deflection, discard, dismountsUnderwater, dismountTo, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doCheckFallDamage, doWaterSplashEffect, dropAllLeashConnections, ejectPassengers, equals, extinguishFire, fillCrashReportCategory, fireImmune, fixupDimensions, forceSetRotation, fudgePositionAfterSizeChange, gameEvent, gameEvent, get, getAddEntityPacket, getAirSupply, getAttachments, 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, getId, getInBlockState, getIndirectPassengers, getInputVector, getKnownMovement, 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, getServer, getSharedFlag, getSoundSource, getStringUUID, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTags, 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, hasPassenger, hasPassenger, hasPose, hurt, hurtClient, hurtOrSimulate, igniteForSeconds, ignoreExplosion, interact, interactAt, 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, 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, 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, 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, spawnAtLocation, spawnSprintParticle, startRiding, startRiding, startSeenByPlayer, stopSeenByPlayer, supportQuadLeashAsHolder, syncPacketPositionCodec, teleport, teleportRelative, teleportSetPosition, teleportSpectators, teleportTo, teleportTo, thunderHit, toString, touchingUnloadedChunk, trackingPosition, turn, unRide, unsetRemoved, updateDynamicGameEventListener, updateFluidHeightAndDoFluidPushing, updateFluidHeightAndDoFluidPushing, updateInWaterStateAndDoFluidPushing, updateInWaterStateAndDoWaterCurrentPushing, updateSwimming, waterSwimSound
Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, removeData, serializeAttachments
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.core.component.DataComponentGetter
get, getOrDefault, getOrDefault, getTyped, has, has
Methods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData
Methods inherited from interface net.neoforged.neoforge.common.extensions.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, shouldRiderSit
Methods inherited from interface net.neoforged.neoforge.common.extensions.ILivingEntityExtension
canDrownInFluidType, canSwimInFluidType, jumpInFluid, moveInFluid, onDamageTaken, self, sinkInFluid
Methods inherited from interface net.minecraft.world.scores.ScoreHolder
getFeedbackDisplayName
-
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:
-
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:
-
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:
-
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:
-
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_TARGET
with target info instead -
EMPTY_BRAIN
private static final com.mojang.serialization.Dynamic<?> EMPTY_BRAIN -
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 -
walkAnimation
-
invulnerableDuration
public final int invulnerableDuration- See Also:
-
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 -
lastPos
-
lastClimbablePos
-
lastDamageSource
-
lastDamageStamp
private long lastDamageStamp -
autoSpinAttackTicks
protected int autoSpinAttackTicks -
autoSpinAttackDmg
protected float autoSpinAttackDmg -
autoSpinAttackItemStack
-
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, activeLocationDependentEnchantmentsSet<EnchantmentLocationBasedEffect>>> -
equipment
-
locatorBarIcon
-
damageContainers
This field stores information about damage dealt to this entity. a newDamageContainer
is instantiated viaEntity.hurt(DamageSource, float)
after invulnerability checks, and is removed from the stack before the method's return.
-
-
Constructor Details
-
LivingEntity
-
-
Method Details
-
createEquipment
-
getBrain
-
brainProvider
-
makeBrain
-
kill
-
canAttackType
-
defineSynchedData
- Specified by:
defineSynchedData
in classEntity
-
createLivingAttributes
-
checkFallDamage
- Overrides:
checkFallDamage
in classEntity
-
canBreatheUnderwater
Deprecated. -
getSwimAmount
public float getSwimAmount(float pPartialTicks) -
hasLandedInLiquid
public boolean hasLandedInLiquid() -
baseTick
public void baseTick() -
getBlockSpeedFactor
protected float getBlockSpeedFactor()- Overrides:
getBlockSpeedFactor
in 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 pScale) -
isAffectedByFluids
public boolean isAffectedByFluids() -
tickDeath
protected void tickDeath() -
shouldDropExperience
public boolean shouldDropExperience() -
shouldDropLoot
protected boolean shouldDropLoot() -
decreaseAirSupply
protected int decreaseAirSupply(int pCurrentAir) Decrements the entity's air supply when underwater -
increaseAirSupply
protected int increaseAirSupply(int pCurrentAir) -
getExperienceReward
-
getBaseExperienceReward
-
isAlwaysExperienceDropper
protected boolean isAlwaysExperienceDropper() -
getLastHurtByMob
-
getLastHurtByPlayer
-
getLastAttacker
- Specified by:
getLastAttacker
in 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 pIdleTime) -
shouldDiscardFriction
public boolean shouldDiscardFriction() -
setDiscardFriction
public void setDiscardFriction(boolean pDiscardFriction) -
doesEmitEquipEvent
-
onEquipItem
-
getEquipSound
protected Holder<SoundEvent> getEquipSound(EquipmentSlot pSlot, ItemStack pStack, Equippable pEquippable) -
remove
-
onRemoval
-
triggerOnDeathMobEffects
-
addAdditionalSaveData
- Specified by:
addAdditionalSaveData
in classEntity
-
drop
@Nullable public ItemEntity drop(ItemStack pStack, boolean pRandomizeMotion, boolean pIncludeThrower) -
readAdditionalSaveData
- Specified by:
readAdditionalSaveData
in classEntity
-
tickEffects
protected void tickEffects() -
updateInvisibilityStatus
protected void updateInvisibilityStatus() -
updateSynchronizedMobEffectParticles
private void updateSynchronizedMobEffectParticles() -
updateGlowingStatus
private void updateGlowingStatus() -
getVisibilityPercent
-
canAttack
-
canBeSeenAsEnemy
public boolean canBeSeenAsEnemy() -
canBeSeenByAnyone
public boolean canBeSeenByAnyone() -
areAllEffectsAmbient
Returnstrue
if 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:
pEffectInstance
- 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 pEffectInstance, boolean pForced, @Nullable Entity pEntity) -
onEffectsRemoved
-
refreshDirtyAttributes
private void refreshDirtyAttributes() -
onAttributeUpdated
-
heal
public void heal(float pHealAmount) Heal living entity (param: amount of half-hearts) -
getHealth
public float getHealth() -
setHealth
public void setHealth(float pHealth) -
isDeadOrDying
public boolean isDeadOrDying() -
hurtServer
- Specified by:
hurtServer
in 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
protected void dropCustomDeathLoot(ServerLevel pLevel, DamageSource pDamageSource, boolean pRecentlyHit) -
getLootTableSeed
public long getLootTableSeed() -
getKnockback
-
dropFromLootTable
protected void dropFromLootTable(ServerLevel pLevel, DamageSource pDamageSource, boolean pPlayerKill) -
dropFromGiftLootTable
public boolean dropFromGiftLootTable(ServerLevel pLevel, ResourceKey<LootTable> pLootTable, BiConsumer<ServerLevel, ItemStack> pDropConsumer) -
dropFromShearingLootTable
protected void dropFromShearingLootTable(ServerLevel pLevel, ResourceKey<LootTable> pLootTable, ItemStack pShears, BiConsumer<ServerLevel, ItemStack> pDropConsumer) -
dropFromLootTable
protected boolean dropFromLootTable(ServerLevel pLevel, ResourceKey<LootTable> pLootTable, Function<LootParams.Builder, LootParams> pParamsBuilder, BiConsumer<ServerLevel, ItemStack> pDropConsumer) -
knockback
public void knockback(double pStrength, double pX, double pZ) -
indicateDamage
public void indicateDamage(double pXDistance, double pZDistance) -
getHurtSound
-
getDeathSound
-
getFallDamageSound
-
skipDropExperience
public void skipDropExperience() -
wasExperienceConsumed
public boolean wasExperienceConsumed() -
getHurtDir
public float getHurtDir() -
getHitbox
-
activeLocationDependentEnchantments
public Map<Enchantment,Set<EnchantmentLocationBasedEffect>> activeLocationDependentEnchantments(EquipmentSlot pSlot) -
getFallSounds
-
getLastClimbablePos
-
onClimbable
public boolean onClimbable() -
trapdoorUsableAsLadder
-
isAlive
public boolean isAlive() -
isLookingAtMe
public boolean isLookingAtMe(LivingEntity pEntity, double pTolerance, boolean pScaleByDistance, boolean pVisual, double... pYValues) -
getMaxFallDistance
public int getMaxFallDistance()- Overrides:
getMaxFallDistance
in classEntity
-
getComfortableFallDistance
protected final int getComfortableFallDistance(float pHealth) -
causeFallDamage
public boolean causeFallDamage(double pFallDistance, float pDamageMultiplier, DamageSource pDamageSource) - Overrides:
causeFallDamage
in classEntity
-
calculateFallDamage
protected int calculateFallDamage(double pFallDistance, float pDamageMultiplier) -
calculateFallPower
private double calculateFallPower(double pFallDistance) -
playBlockFallSound
protected void playBlockFallSound() -
animateHurt
public void animateHurt(float pYaw) - Overrides:
animateHurt
in classEntity
-
getArmorValue
public int getArmorValue() -
hurtArmor
-
hurtHelmet
-
doHurtEquipment
protected void doHurtEquipment(DamageSource pDamageSource, float pDamageAmount, EquipmentSlot... pSlots) -
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 pCount) Sets the amount of arrows stuck in the entity. Used for rendering those. -
getStingerCount
public final int getStingerCount() -
setStingerCount
public final void setStingerCount(int pStingerCount) -
getCurrentSwingDuration
public int getCurrentSwingDuration() -
swing
-
swing
-
handleDamageEvent
- Overrides:
handleDamageEvent
in classEntity
-
handleEntityEvent
public void handleEntityEvent(byte pId) Handler forinvalid reference
World#setEntityState
- Overrides:
handleEntityEvent
in classEntity
-
makePoofParticles
public void makePoofParticles() -
makeDrownParticles
private void makeDrownParticles() -
swapHandItems
private void swapHandItems() -
onBelowWorld
protected void onBelowWorld()- Overrides:
onBelowWorld
in classEntity
-
updateSwingTime
protected void updateSwingTime() -
getAttribute
-
getAttributeValue
-
getAttributeBaseValue
-
getAttributes
-
getMainHandItem
-
getOffhandItem
-
getItemHeldByArm
-
getWeaponItem
- Overrides:
getWeaponItem
in classEntity
-
isHolding
-
isHolding
-
getItemInHand
-
setItemInHand
-
hasItemInSlot
-
canUseSlot
-
getItemBySlot
-
setItemSlot
-
getArmorCoverPercentage
public float getArmorCoverPercentage() -
setSprinting
public void setSprinting(boolean pSprinting) Set sprinting switch for Entity.- Overrides:
setSprinting
in classEntity
-
getSoundVolume
protected float getSoundVolume() -
getVoicePitch
public float getVoicePitch() -
isImmobile
protected boolean isImmobile() -
push
Applies a velocity to the entities, to push them away from each other. -
dismountVehicle
-
shouldShowName
public boolean shouldShowName()- Overrides:
shouldShowName
in classEntity
-
getJumpPower
protected float getJumpPower() -
getJumpPower
protected float getJumpPower(float pMultiplier) -
getJumpBoostPower
public float getJumpBoostPower() -
jumpFromGround
public void jumpFromGround() -
goDownInWater
Deprecated. -
jumpInLiquid
Deprecated. -
getWaterSlowDown
protected float getWaterSlowDown() -
canStandOnFluid
-
getDefaultGravity
protected double getDefaultGravity()- Overrides:
getDefaultGravity
in classEntity
-
getEffectiveGravity
protected double getEffectiveGravity() -
travel
-
travelFlying
-
travelFlying
protected void travelFlying(Vec3 pRelative, float pInWaterAmount, float pInLavaAmount, float pAmount) -
travelInAir
-
travelInFluid
Deprecated.Neo: usetravelInFluid(Vec3, FluidState)
instead -
travelInFluid
-
travelFallFlying
-
stopFallFlying
public void stopFallFlying() -
updateFallFlyingMovement
-
handleFallFlyingCollisions
private void handleFallFlyingCollisions(double pOldSpeed, double pNewSpeed) -
travelRidden
-
tickRidden
-
getRiddenInput
-
getRiddenSpeed
-
calculateEntityAnimation
public void calculateEntityAnimation(boolean pIncludeHeight) -
updateWalkAnimation
protected void updateWalkAnimation(float pPartialTick) -
handleRelativeFrictionAndCalculateMovement
-
getFluidFallingAdjustedMovement
-
handleOnClimbable
-
getFrictionInfluencedSpeed
private float getFrictionInfluencedSpeed(float pFriction) -
getFlyingSpeed
protected float getFlyingSpeed() -
getSpeed
public float getSpeed() -
setSpeed
public void setSpeed(float pSpeed) Sets the movespeed used for the new AI system. -
doHurtTarget
-
tick
public void tick() -
detectEquipmentUpdates
private void detectEquipmentUpdates() -
collectEquipmentChanges
-
equipmentHasChanged
-
handleHandSwap
-
handleEquipmentChanges
-
tickHeadTurn
protected void tickHeadTurn(float pYBodyRot) -
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:
stopRiding
in classEntity
-
rideTick
public void rideTick() -
getInterpolation
- Overrides:
getInterpolation
in classEntity
-
lerpHeadTo
public void lerpHeadTo(float pYaw, int pPitch) - Overrides:
lerpHeadTo
in classEntity
-
setJumping
public void setJumping(boolean pJumping) -
onItemPickup
-
take
Called when the entity picks up an item. -
hasLineOfSight
-
hasLineOfSight
public boolean hasLineOfSight(Entity pEntity, ClipContext.Block pBlock, ClipContext.Fluid pFluid, double pY) -
getViewYRot
public float getViewYRot(float pPartialTicks) Gets the current yaw of the entity- Overrides:
getViewYRot
in classEntity
-
getAttackAnim
public float getAttackAnim(float pPartialTick) Gets the progression of the swing animation, ranges from 0.0 to 1.0. -
isPickable
public boolean isPickable()- Overrides:
isPickable
in classEntity
-
isPushable
public boolean isPushable()- Overrides:
isPushable
in classEntity
-
getYHeadRot
public float getYHeadRot()- Overrides:
getYHeadRot
in classEntity
-
setYHeadRot
public void setYHeadRot(float pRotation) Sets the head's yaw rotation of the entity.- Overrides:
setYHeadRot
in classEntity
-
setYBodyRot
public void setYBodyRot(float pOffset) Set the render yaw offset- Overrides:
setYBodyRot
in classEntity
-
getRelativePortalPosition
- Overrides:
getRelativePortalPosition
in classEntity
-
resetForwardDirectionOfRelativePortalPosition
-
getAbsorptionAmount
public float getAbsorptionAmount() -
setAbsorptionAmount
public final void setAbsorptionAmount(float pAbsorptionAmount) -
internalSetAbsorptionAmount
protected void internalSetAbsorptionAmount(float pAbsorptionAmount) -
onEnterCombat
public void onEnterCombat() -
onLeaveCombat
public void onLeaveCombat() -
updateEffectVisibility
protected void updateEffectVisibility() -
getMainArm
-
isUsingItem
public boolean isUsingItem() -
getUsedItemHand
-
updatingUsingItem
private void updatingUsingItem() -
createItemStackToDrop
@Nullable private ItemEntity createItemStackToDrop(ItemStack pStack, boolean pRandomizeMotion, boolean pIncludeThrower) -
updateUsingItem
-
updateSwimAmount
private void updateSwimAmount() -
setLivingEntityFlag
protected void setLivingEntityFlag(int pKey, boolean pValue) -
startUsingItem
-
onSyncedDataUpdated
- Specified by:
onSyncedDataUpdated
in interfaceSyncedDataHolder
- Overrides:
onSyncedDataUpdated
in classEntity
-
lookAt
-
getPreciseBodyRotation
public float getPreciseBodyRotation(float pPartialTick) - Overrides:
getPreciseBodyRotation
in classEntity
-
spawnItemParticles
-
completeUsingItem
protected void completeUsingItem() -
handleExtraItemsCreatedOnUse
-
getUseItem
-
getUseItemRemainingTicks
public int getUseItemRemainingTicks() -
getTicksUsingItem
public int getTicksUsingItem() -
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:
isVisuallySwimming
in classEntity
-
getFallFlyingTicks
public int getFallFlyingTicks() -
randomTeleport
public boolean randomTeleport(double pX, double pY, double pZ, boolean pBroadcastTeleport) -
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:
getDimensions
in classEntity
-
getDefaultDimensions
-
getDismountPoses
-
getLocalBoundsForPose
-
wouldNotSuffocateAtTargetPose
-
canUsePortal
public boolean canUsePortal(boolean pAllowPassengers) - Overrides:
canUsePortal
in 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
public boolean isInWall() -
getProjectile
-
entityEventForEquipmentBreak
-
onEquippedItemBroken
-
stopLocationBasedEffects
private void stopLocationBasedEffects(ItemStack pStack, EquipmentSlot pSlot, AttributeMap pAttributeMap) -
getSlotForHand
-
canEquipWithDispenser
-
canDispenserEquipIntoSlot
-
getEquipmentSlotForItem
-
isEquippableInSlot
-
createEquipmentSlotAccess
-
getEquipmentSlot
-
getSlot
-
canFreeze
public boolean canFreeze() -
isCurrentlyGlowing
public boolean isCurrentlyGlowing()- Overrides:
isCurrentlyGlowing
in classEntity
-
getVisualRotationYInDegrees
public float getVisualRotationYInDegrees()- Overrides:
getVisualRotationYInDegrees
in classEntity
-
recreateFromPacket
- Overrides:
recreateFromPacket
in classEntity
-
getSecondsToDisableBlocking
public float getSecondsToDisableBlocking() -
maxUpStep
public float maxUpStep() -
getPassengerRidingPosition
- Overrides:
getPassengerRidingPosition
in classEntity
-
lerpHeadRotationStep
protected void lerpHeadRotationStep(int pLerpHeadSteps, double pLerpYHeadRot) -
igniteForTicks
public void igniteForTicks(int pTicks) - Overrides:
igniteForTicks
in classEntity
-
hasInfiniteMaterials
public boolean hasInfiniteMaterials() -
isInvulnerableTo
-
canGlideUsing
-
getLastHurtByPlayerMemoryTime
public int getLastHurtByPlayerMemoryTime() -
isTransmittingWaypoint
public boolean isTransmittingWaypoint()- Specified by:
isTransmittingWaypoint
in interfaceWaypointTransmitter
-
makeWaypointConnectionWith
- Specified by:
makeWaypointConnectionWith
in interfaceWaypointTransmitter
-
waypointIcon
- Specified by:
waypointIcon
in interfaceWaypointTransmitter
-
PLAYER_NOT_WEARING_DISGUISE_ITEM_FOR_TARGET
with target info instead