Package net.minecraft.entity
Class Entity
java.lang.Object
net.minecraft.entity.Entity
- All Implemented Interfaces:
class_5568,CommandOutput,Nameable
- Direct Known Subclasses:
AbstractDecorationEntity,AbstractMinecartEntity,AreaEffectCloudEntity,BoatEntity,EndCrystalEntity,EnderDragonPart,EvokerFangsEntity,ExperienceOrbEntity,EyeOfEnderEntity,FallingBlockEntity,ItemEntity,LightningEntity,LivingEntity,ProjectileEntity,TntEntity
public abstract class Entity extends Object implements Nameable, class_5568, CommandOutput
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceEntity.PositionUpdaterstatic classEntity.RemovalReason -
Field Summary
Fields inherited from interface net.minecraft.server.command.CommandOutput
DUMMY -
Constructor Summary
Constructors Constructor Description Entity(EntityType<?> type, World world) -
Method Summary
Modifier and Type Method Description protected voidaddPassenger(Entity passenger)booleanaddScoreboardTag(String tag)voidaddVelocity(double deltaX, double deltaY, double deltaZ)static Vec3dadjustMovementForCollisions(Entity entity, Vec3d movement, Box entityBoundingBox, World world, ShapeContext context, ReusableStream<VoxelShape> collisions)private Vec3dadjustMovementForCollisions(Vec3d movement)static Vec3dadjustMovementForCollisions(Vec3d movement, Box entityBoundingBox, ReusableStream<VoxelShape> collisions)protected Vec3dadjustMovementForPiston(Vec3d movement)protected Vec3dadjustMovementForSneaking(Vec3d movement, MovementType type)static Vec3dadjustSingleAxisMovementForCollisions(Vec3d movement, Box entityBoundingBox, WorldView world, ShapeContext context, ReusableStream<VoxelShape> collisions)protected voidafterSpawn()voidanimateDamage()floatapplyMirror(BlockMirror mirror)floatapplyRotation(BlockRotation rotation)voidbaseTick()booleanbypassesLandingEffects()booleanbypassesSteppingEffects()protected BoxcalculateBoundsForPose(EntityPose pos)voidcalculateDimensions()protected floatcalculateNextStepSoundDistance()private doublecalculatePistonMovementFactor(Direction.Axis axis, double offsetFactor)protected booleancanAddPassenger(Entity passenger)booleancanAvoidTraps()booleancanBeRiddenInWater()booleancanBeSpectated(ServerPlayerEntity spectator)protected booleancanClimb()booleancanExplosionDestroyBlock(Explosion explosion, BlockView world, BlockPos pos, BlockState state, float explosionPower)booleancanFly()booleancanFreeze()protected booleancanStartRiding(Entity entity)booleancanUsePortals()voidchangeLookDirection(double cursorDeltaX, double cursorDeltaY)protected voidcheckBlockCollision()voidcheckDespawn()(package private) voidcheckWaterState()booleancollides()booleancollidesWith(Entity other)voidcopyFrom(Entity original)voidcopyPositionAndRotation(Entity entity)abstract Packet<?>createSpawnPacket()booleandamage(DamageSource source, float amount)voiddealDamage(LivingEntity attacker, Entity target)protected voiddestroy()voiddetach()Removes all the passengers and removes this entity from any vehicles it is riding.voiddiscard()voiddismountVehicle()Dismounts the vehicle if present.floatdistanceTo(Entity entity)booleandoesNotCollide(double offsetX, double offsetY, double offsetZ)private booleandoesNotCollide(Box box)booleandoesRenderOnFire()ItemEntitydropItem(ItemConvertible item)ItemEntitydropItem(ItemConvertible item, int yOffset)ItemEntitydropStack(ItemStack stack)ItemEntitydropStack(ItemStack stack, float yOffset)protected voidemitGameEvent(GameEvent gameEvent)booleanentityDataRequiresOperator()booleanequals(Object o)voidequipStack(EquipmentSlot slot, ItemStack stack)voidextinguish()protected voidfall(double heightDifference, boolean onGround, BlockState landedState, BlockPos landedPosition)voidfromTag(CompoundTag tag)intgetAir()Iterable<ItemStack>getArmorItems()BlockPosgetBlockPos()intgetBlockX()intgetBlockY()intgetBlockZ()doublegetBodyY(double heightScale)BoxgetBoundingBox()floatgetBrightnessAtEyes()protected intgetBurningDuration()Vec3dgetCameraPosVec(float tickDelta)ChunkPosgetChunkPos()ServerCommandSourcegetCommandSource()TextgetCustomName()DataTrackergetDataTracker()protected TextgetDefaultName()intgetDefaultNetherPortalCooldown()EntityDimensionsgetDimensions(EntityPose pose)TextgetDisplayName()floatgetEffectiveExplosionResistance(Explosion explosion, BlockView world, BlockPos pos, BlockState blockState, FluidState fluidState, float max)intgetEntityId()StringgetEntityName()WorldgetEntityWorld()floatgetEyeHeight(EntityPose pose)protected floatgetEyeHeight(EntityPose pose, EntityDimensions dimensions)doublegetEyeY()intgetFireTicks()EntitygetFirstPassenger()protected booleangetFlag(int index)doublegetFluidHeight(Tag<Fluid> fluid)floatgetFreezingScale()intgetFrozenTicks()floatgetHeadYaw()floatgetHeight()doublegetHeightOffset()protected SoundEventgetHighSpeedSplashSound()DirectiongetHorizontalFacing()protected HoverEventgetHoverEvent()Iterable<ItemStack>getItemsEquipped()Iterable<ItemStack>getItemsHand()protected floatgetJumpVelocityMultiplier()protected BlockStategetLandingBlockState()protected BlockPosgetLandingPos()intgetMaxAir()intgetMaxNetherPortalTime()intgetMinFreezeDamageTicks()doublegetMountedHeightOffset()DirectiongetMovementDirection()TextgetName()Vec3dgetOppositeRotationVector(float tickDelta)protected Vec3dgetOppositeRotationVector(float pitch, float yaw)doublegetParticleX(double widthScale)doublegetParticleZ(double widthScale)protected static Vec3dgetPassengerDismountOffset(double vehicleWidth, double passengerWidth, float passengerYaw)List<Entity>getPassengerList()Iterable<Entity>getPassengersDeep()protected intgetPermissionLevel()ItemStackgetPickBlockStack()PistonBehaviorgetPistonBehavior()floatgetPitch(float tickDelta)Vec3dgetPos()EntityPosegetPose()EntitygetPrimaryPassenger()doublegetRandomBodyY()static doublegetRenderDistanceMultiplier()EntitygetRootVehicle()Gets the lowest entity this entity is riding.Vec2fgetRotationClient()Vec3dgetRotationVec(float tickDelta)Vec3dgetRotationVecClient()Vec3dgetRotationVector()protected Vec3dgetRotationVector(float pitch, float yaw)intgetSafeFallDistance()protected StringgetSavedEntityId()Set<String>getScoreboardTags()AbstractTeamgetScoreboardTeam()MinecraftServergetServer()SoundCategorygetSoundCategory()protected SoundEventgetSplashSound()floatgetStandingEyeHeight()protected SoundEventgetSwimSound()floatgetTargetingMargin()intgetTeamColorValue()protected TeleportTargetgetTeleportTarget(ServerWorld destination)Vec3dgetTrackedPosition()EntityType<?>getType()UUIDgetUuid()StringgetUuidAsString()EntitygetVehicle()Vec3dgetVelocity()protected BlockPosgetVelocityAffectingPos()protected floatgetVelocityMultiplier()BoxgetVisibilityBoundingBox()floatgetWidth()doublegetX()doublegetY()floatgetYaw(float tickDelta)doublegetZ()booleanhandleAttack(Entity attacker)booleanhandleFallDamage(float fallDistance, float damageMultiplier)voidhandleStatus(byte status)booleanhasCustomName()inthashCode()booleanhasNetherPortalCooldown()booleanhasNoGravity()booleanhasPassenger(Entity passenger)booleanhasPassengerDeep(Entity passenger)booleanhasPassengers()booleanhasPassengerType(Predicate<Entity> predicate)booleanhasPermissionLevel(int permissionLevel)booleanhasPlayerRider()booleanhasVehicle()protected booleanhasWings()protected abstract voidinitDataTracker()ActionResultinteract(PlayerEntity player, Hand hand)Called when a player interacts with this entity.ActionResultinteractAt(PlayerEntity player, Vec3d hitPos, Hand hand)booleanisAlive()booleanisAttackable()private booleanisBeingRainedOn()booleanisCollidable()booleanisConnectedThroughVehicle(Entity entity)Checks if this entity and another entity share the same root vehicle.booleanisCustomNameVisible()booleanisDescending()booleanisFireImmune()booleanisFreezing()booleanisGlowing()booleanisImmuneToExplosion()booleanisInLava()booleanisInRange(Entity other, double radius)private booleanisInsideBubbleColumn()booleanisInsideWall()booleanisInsideWaterOrBubbleColumn()booleanisInSneakingPose()Returns whether the entity is in a crouching pose.booleanisInSwimmingPose()booleanisInvisible()booleanisInvisibleTo(PlayerEntity player)booleanisInvulnerable()booleanisInvulnerableTo(DamageSource damageSource)booleanisLiving()booleanisLogicalSideForUpdatingMovement()booleanisOnFire()booleanisOnGround()booleanisPartOf(Entity entity)booleanisPlayer()booleanisPushable()booleanisRemoved()booleanisSilent()booleanisSneaking()booleanisSneaky()booleanisSpectator()booleanisSprinting()booleanisSubmergedIn(Tag<Fluid> tag)booleanisSubmergedInWater()Returns whether this entity's hitbox is fully submerged in water.booleanisSwimming()booleanisTeammate(Entity other)booleanisTeamPlayer(AbstractTeam team)booleanisTouchingWater()Returns whether this entity's hitbox is touching water fluid.booleanisTouchingWaterOrRain()booleanisWet()Returns whether this entity is touching water, or is being rained on, or is inside a bubble column...voidkill()voidlookAt(EntityAnchorArgumentType.EntityAnchor anchorPoint, Vec3d target)doublemethod_29241()Vec3dmethod_29919()protected voidmethod_30076()protected Optional<class_5459.class_5460>method_30330(ServerWorld serverWorld, BlockPos blockPos, boolean bool)booleanmethod_30632(BlockPos blockPos, BlockState blockState)protected Vec3dmethod_30633(Direction.Axis axis, class_5459.class_5460 class_5460)voidmethod_30634(double x, double y, double z)Vec3dmethod_30950(float float2)Vec3dmethod_30951(float float2)Vec3dmethod_31166(float tickDelta)voidmethod_31473()private Stream<Entity>method_31484()voidmethod_31744(class_5569 class_5569)booleanmethod_31746()Stream<Entity>method_31748()class_5630method_32318(int int2)protected voidmethod_32875(Entity entity, GameEvent gameEvent)class_5715method_32877()booleanmethod_33189()voidmove(MovementType type, Vec3d movement)private static Vec3dmovementInputToVelocity(Vec3d movementInput, float speed, float yaw)voidmoveToBoundingBoxCenter()EntitymoveToWorld(ServerWorld destination)Moves this entity to another world.doubleoffsetX(double widthScale)doubleoffsetZ(double widthScale)protected voidonBlockCollision(BlockState state)voidonBubbleColumnCollision(boolean drag)voidonBubbleColumnSurfaceCollision(boolean drag)voidonKilledOther(ServerWorld serverWorld, LivingEntity livingEntity)voidonPassengerLookAround(Entity passenger)voidonPlayerCollision(PlayerEntity player)voidonSpawnPacket(EntitySpawnS2CPacket packet)voidonStartedTrackingBy(ServerPlayerEntity player)voidonStoppedTrackingBy(ServerPlayerEntity player)voidonStruckByLightning(ServerWorld world, LightningEntity lightning)protected voidonSwimmingStart()voidonTrackedDataSet(TrackedData<?> data)protected floatplayFlySound(float distance)voidplaySound(SoundEvent sound, float volume, float pitch)protected voidplayStepSound(BlockPos pos, BlockState state)protected voidplaySwimSound(float volume)voidpopulateCrashReport(CrashReportSection section)voidpushAwayFrom(Entity entity)protected voidpushOutOfBlocks(double x, double y, double z)HitResultraycast(double maxDistance, float tickDelta, boolean includeFluids)protected abstract voidreadCustomDataFromTag(CompoundTag tag)protected voidrefreshPosition()voidrefreshPositionAfterTeleport(double x, double y, double z)voidrefreshPositionAfterTeleport(Vec3d vec3d)voidrefreshPositionAndAngles(double x, double y, double z, float yaw, float pitch)voidrefreshPositionAndAngles(BlockPos pos, float yaw, float pitch)voidremove(Entity.RemovalReason reason)voidremoveAllPassengers()private static TextremoveClickEvents(Text textComponent)protected voidremovePassenger(Entity passenger)booleanremoveScoreboardTag(String tag)voidrequestTeleport(double destX, double destY, double destZ)voidresetNetherPortalCooldown()voidresetPosition(double x, double y, double z)booleansaveSelfToTag(CompoundTag tag)booleansaveToTag(CompoundTag tag)protected voidscheduleVelocityUpdate()voidsendSystemMessage(Text message, UUID senderUuid)voidsetAir(int air)voidsetBoundingBox(Box boundingBox)voidsetCustomName(Text name)voidsetCustomNameVisible(boolean visible)voidsetEntityId(int id)voidsetFireTicks(int ticks)protected voidsetFlag(int index, boolean value)voidsetFrozenTicks(int frozenTicks)voidsetGlowing(boolean glowing)voidsetHeadYaw(float headYaw)voidsetInNetherPortal(BlockPos pos)voidsetInPowderSnow(boolean inPowderSnow)voidsetInvisible(boolean invisible)voidsetInvulnerable(boolean invulnerable)voidsetNoGravity(boolean noGravity)voidsetOnFireFor(int seconds)voidsetOnFireFromLava()voidsetOnGround(boolean onGround)voidsetPos(double x, double y, double z)voidsetPose(EntityPose pose)voidsetRemoved(Entity.RemovalReason reason)static voidsetRenderDistanceMultiplier(double value)protected voidsetRotation(float yaw, float pitch)voidsetSilent(boolean silent)voidsetSneaking(boolean sneaking)voidsetSprinting(boolean sprinting)voidsetSwimming(boolean swimming)voidsetUuid(UUID uuid)voidsetVelocity(double x, double y, double z)voidsetVelocity(Vec3d velocity)voidsetVelocityClient(double x, double y, double z)voidsetYaw(float yaw)booleanshouldBroadcastConsoleToOps()booleanshouldLeaveSwimmingPose()booleanshouldReceiveFeedback()booleanshouldRender(double distance)booleanshouldRender(double cameraX, double cameraY, double cameraZ)booleanshouldRenderName()protected booleanshouldSetPositionOnLoad()booleanshouldSpawnSprintingParticles()booleanshouldTrackOutput()voidslowMovement(BlockState state, Vec3d multiplier)protected voidspawnSprintingParticles()doublesquaredDistanceTo(double x, double y, double z)doublesquaredDistanceTo(Entity entity)doublesquaredDistanceTo(Vec3d vector)static doublesquaredHorizontalLength(Vec3d vector)booleanstartRiding(Entity entity)booleanstartRiding(Entity entity, boolean force)voidstopRiding()Stream<Entity>streamPassengersRecursively()voidteleport(double destX, double destY, double destZ)voidtick()protected voidtickNetherPortal()protected voidtickNetherPortalCooldown()voidtickRiding()protected ListTagtoListTag(double[] values)protected ListTagtoListTag(float[] values)StringtoString()CompoundTagtoTag(CompoundTag tag)protected voidunsetRemoved()voidupdateKilledAdvancementCriterion(Entity killer, int score, DamageSource damageSource)booleanupdateMovementInFluid(Tag<Fluid> tag, double double2)Vec3dupdatePassengerForDismount(LivingEntity passenger)voidupdatePassengerPosition(Entity passenger)private voidupdatePassengerPosition(Entity passenger, Entity.PositionUpdater positionUpdater)voidupdatePosition(double x, double y, double z)voidupdatePositionAndAngles(double x, double y, double z, float yaw, float pitch)private voidupdateSubmergedInWaterState()voidupdateSwimming()voidupdateTrackedHeadRotation(float yaw, int interpolationSteps)voidupdateTrackedPosition(double x, double y, double z)voidupdateTrackedPosition(Vec3d pos)voidupdateTrackedPositionAndAngles(double x, double y, double z, float yaw, float pitch, int interpolationSteps, boolean interpolate)voidupdateVelocity(float speed, Vec3d movementInput)protected booleanupdateWaterState()protected booleanwouldPoseNotCollide(EntityPose pose)protected abstract voidwriteCustomDataToTag(CompoundTag tag)
-
Field Details
-
LOGGER
-
ENTITY_ID_COUNTER
-
EMPTY_STACK_LIST
-
NULL_BOX
-
renderDistanceMultiplier
private static double renderDistanceMultiplier -
FLAGS
-
AIR
-
CUSTOM_NAME
-
NAME_VISIBLE
-
SILENT
-
NO_GRAVITY
-
POSE
-
FROZEN_TICKS
-
type
-
entityId
private int entityId -
inanimate
public boolean inanimate -
passengerList
-
ridingCooldown
protected int ridingCooldown -
vehicle
-
world
-
prevX
public double prevX -
prevY
public double prevY -
prevZ
public double prevZ -
pos
-
blockPos
-
velocity
-
yaw
public float yaw -
pitch
public float pitch -
prevYaw
public float prevYaw -
prevPitch
public float prevPitch -
entityBounds
-
onGround
protected boolean onGround -
horizontalCollision
public boolean horizontalCollision -
verticalCollision
public boolean verticalCollision -
velocityModified
public boolean velocityModified -
movementMultiplier
-
removalReason
-
prevHorizontalSpeed
public float prevHorizontalSpeed -
horizontalSpeed
public float horizontalSpeed -
distanceTraveled
public float distanceTraveled -
fallDistance
public float fallDistance -
nextStepSoundDistance
private float nextStepSoundDistance -
nextFlySoundDistance
private float nextFlySoundDistance -
lastRenderX
public double lastRenderX -
lastRenderY
public double lastRenderY -
lastRenderZ
public double lastRenderZ -
stepHeight
public float stepHeight -
noClip
public boolean noClip -
pushSpeedReduction
public float pushSpeedReduction -
random
-
age
public int age -
fireTicks
private int fireTicks -
touchingWater
protected boolean touchingWater -
fluidHeight
-
submergedInWater
protected boolean submergedInWater -
field_25599
-
timeUntilRegen
public int timeUntilRegen -
firstUpdate
protected boolean firstUpdate -
dataTracker
-
field_26996
-
trackedPosition
-
ignoreCameraFrustum
public boolean ignoreCameraFrustum -
velocityDirty
public boolean velocityDirty -
netherPortalCooldown
private int netherPortalCooldown -
inNetherPortal
protected boolean inNetherPortal -
netherPortalTime
protected int netherPortalTime -
lastNetherPortalPosition
-
invulnerable
private boolean invulnerable -
uuid
-
uuidString
-
glowing
protected boolean glowing -
scoreboardTags
-
pistonMovementDelta
private final double[] pistonMovementDelta -
pistonMovementTick
private long pistonMovementTick -
dimensions
-
standingEyeHeight
private float standingEyeHeight -
inPowderSnow
protected boolean inPowderSnow -
field_26997
private float field_26997 -
field_26994
private int field_26994
-
-
Constructor Details
-
Entity
-
-
Method Details
-
method_30632
-
getTeamColorValue
@Environment(CLIENT) public int getTeamColorValue() -
isSpectator
public boolean isSpectator() -
detach
public final void detach()Removes all the passengers and removes this entity from any vehicles it is riding. -
updateTrackedPosition
public void updateTrackedPosition(double x, double y, double z) -
updateTrackedPosition
-
getTrackedPosition
-
getType
-
getEntityId
public int getEntityId()- Specified by:
getEntityIdin interfaceclass_5568
-
setEntityId
public void setEntityId(int id) -
getScoreboardTags
-
addScoreboardTag
-
removeScoreboardTag
-
kill
public void kill() -
discard
public final void discard() -
initDataTracker
protected abstract void initDataTracker() -
getDataTracker
-
equals
-
hashCode
public int hashCode() -
afterSpawn
@Environment(CLIENT) protected void afterSpawn() -
remove
-
setPose
-
getPose
-
isInRange
-
setRotation
protected void setRotation(float yaw, float pitch) -
updatePosition
public void updatePosition(double x, double y, double z) -
refreshPosition
protected void refreshPosition() -
changeLookDirection
@Environment(CLIENT) public void changeLookDirection(double cursorDeltaX, double cursorDeltaY) -
tick
public void tick() -
baseTick
public void baseTick() -
method_31473
public void method_31473() -
resetNetherPortalCooldown
public void resetNetherPortalCooldown() -
hasNetherPortalCooldown
public boolean hasNetherPortalCooldown() -
tickNetherPortalCooldown
protected void tickNetherPortalCooldown() -
getMaxNetherPortalTime
public int getMaxNetherPortalTime() -
setOnFireFromLava
public void setOnFireFromLava() -
setOnFireFor
public void setOnFireFor(int seconds) -
setFireTicks
public void setFireTicks(int ticks) -
getFireTicks
public int getFireTicks() -
extinguish
public void extinguish() -
destroy
protected void destroy() -
doesNotCollide
public boolean doesNotCollide(double offsetX, double offsetY, double offsetZ) -
doesNotCollide
-
setOnGround
public void setOnGround(boolean onGround) -
isOnGround
public boolean isOnGround() -
move
-
getLandingPos
-
getJumpVelocityMultiplier
protected float getJumpVelocityMultiplier() -
getVelocityMultiplier
protected float getVelocityMultiplier() -
getVelocityAffectingPos
-
adjustMovementForSneaking
-
adjustMovementForPiston
-
calculatePistonMovementFactor
-
adjustMovementForCollisions
-
squaredHorizontalLength
-
adjustMovementForCollisions
public static Vec3d adjustMovementForCollisions(@Nullable Entity entity, Vec3d movement, Box entityBoundingBox, World world, ShapeContext context, ReusableStream<VoxelShape> collisions) -
adjustMovementForCollisions
public static Vec3d adjustMovementForCollisions(Vec3d movement, Box entityBoundingBox, ReusableStream<VoxelShape> collisions) -
adjustSingleAxisMovementForCollisions
public static Vec3d adjustSingleAxisMovementForCollisions(Vec3d movement, Box entityBoundingBox, WorldView world, ShapeContext context, ReusableStream<VoxelShape> collisions) -
calculateNextStepSoundDistance
protected float calculateNextStepSoundDistance() -
moveToBoundingBoxCenter
public void moveToBoundingBoxCenter() -
getSwimSound
-
getSplashSound
-
getHighSpeedSplashSound
-
checkBlockCollision
protected void checkBlockCollision() -
onBlockCollision
-
method_32875
-
emitGameEvent
-
playStepSound
-
playSwimSound
protected void playSwimSound(float volume) -
playFlySound
protected float playFlySound(float distance) -
hasWings
protected boolean hasWings() -
playSound
-
isSilent
public boolean isSilent() -
setSilent
public void setSilent(boolean silent) -
hasNoGravity
public boolean hasNoGravity() -
setNoGravity
public void setNoGravity(boolean noGravity) -
canClimb
protected boolean canClimb() -
method_33189
public boolean method_33189() -
fall
protected void fall(double heightDifference, boolean onGround, BlockState landedState, BlockPos landedPosition) -
isFireImmune
public boolean isFireImmune() -
handleFallDamage
public boolean handleFallDamage(float fallDistance, float damageMultiplier) -
isTouchingWater
public boolean isTouchingWater()Returns whether this entity's hitbox is touching water fluid. -
isBeingRainedOn
private boolean isBeingRainedOn() -
isInsideBubbleColumn
private boolean isInsideBubbleColumn() -
isTouchingWaterOrRain
public boolean isTouchingWaterOrRain() -
isWet
public boolean isWet()Returns whether this entity is touching water, or is being rained on, or is inside a bubble column...- See Also:
isTouchingWater(),isBeingRainedOn(),isInsideBubbleColumn()
-
isInsideWaterOrBubbleColumn
public boolean isInsideWaterOrBubbleColumn() -
isSubmergedInWater
public boolean isSubmergedInWater()Returns whether this entity's hitbox is fully submerged in water. -
updateSwimming
public void updateSwimming() -
updateWaterState
protected boolean updateWaterState() -
checkWaterState
void checkWaterState() -
updateSubmergedInWaterState
private void updateSubmergedInWaterState() -
onSwimmingStart
protected void onSwimmingStart() -
getLandingBlockState
-
shouldSpawnSprintingParticles
public boolean shouldSpawnSprintingParticles() -
spawnSprintingParticles
protected void spawnSprintingParticles() -
isSubmergedIn
-
isInLava
public boolean isInLava() -
updateVelocity
-
movementInputToVelocity
-
getBrightnessAtEyes
public float getBrightnessAtEyes() -
updatePositionAndAngles
public void updatePositionAndAngles(double x, double y, double z, float yaw, float pitch) -
method_30634
public void method_30634(double x, double y, double z) -
refreshPositionAfterTeleport
-
refreshPositionAfterTeleport
public void refreshPositionAfterTeleport(double x, double y, double z) -
refreshPositionAndAngles
-
refreshPositionAndAngles
public void refreshPositionAndAngles(double x, double y, double z, float yaw, float pitch) -
resetPosition
public void resetPosition(double x, double y, double z) -
distanceTo
-
squaredDistanceTo
public double squaredDistanceTo(double x, double y, double z) -
squaredDistanceTo
-
squaredDistanceTo
-
onPlayerCollision
-
pushAwayFrom
-
addVelocity
public void addVelocity(double deltaX, double deltaY, double deltaZ) -
scheduleVelocityUpdate
protected void scheduleVelocityUpdate() -
damage
-
getRotationVec
-
getPitch
public float getPitch(float tickDelta) -
getYaw
public float getYaw(float tickDelta) -
getRotationVector
-
getOppositeRotationVector
-
getOppositeRotationVector
-
getCameraPosVec
-
method_31166
-
method_30950
-
raycast
-
collides
public boolean collides() -
isPushable
public boolean isPushable() -
updateKilledAdvancementCriterion
-
shouldRender
@Environment(CLIENT) public boolean shouldRender(double cameraX, double cameraY, double cameraZ) -
shouldRender
@Environment(CLIENT) public boolean shouldRender(double distance) -
saveSelfToTag
-
saveToTag
-
toTag
-
fromTag
-
shouldSetPositionOnLoad
protected boolean shouldSetPositionOnLoad() -
getSavedEntityId
-
readCustomDataFromTag
-
writeCustomDataToTag
-
toListTag
-
toListTag
-
dropItem
-
dropItem
-
dropStack
-
dropStack
-
isAlive
public boolean isAlive() -
isInsideWall
public boolean isInsideWall() -
interact
Called when a player interacts with this entity.- Parameters:
player- the playerhand- the hand the player used to interact with this entity
-
collidesWith
-
isCollidable
public boolean isCollidable() -
tickRiding
public void tickRiding() -
updatePassengerPosition
-
updatePassengerPosition
-
onPassengerLookAround
-
getHeightOffset
public double getHeightOffset() -
getMountedHeightOffset
public double getMountedHeightOffset() -
startRiding
-
isLiving
@Environment(CLIENT) public boolean isLiving() -
startRiding
-
canStartRiding
-
wouldPoseNotCollide
-
removeAllPassengers
public void removeAllPassengers() -
dismountVehicle
public void dismountVehicle()Dismounts the vehicle if present.For players, will not trigger any networking changes. Use
stopRiding()instead.- See Also:
stopRiding()
-
stopRiding
public void stopRiding() -
addPassenger
-
removePassenger
-
canAddPassenger
-
updateTrackedPositionAndAngles
@Environment(CLIENT) public void updateTrackedPositionAndAngles(double x, double y, double z, float yaw, float pitch, int interpolationSteps, boolean interpolate) -
updateTrackedHeadRotation
@Environment(CLIENT) public void updateTrackedHeadRotation(float yaw, int interpolationSteps) -
getTargetingMargin
public float getTargetingMargin() -
getRotationVector
-
getRotationClient
-
getRotationVecClient
-
setInNetherPortal
-
tickNetherPortal
protected void tickNetherPortal() -
getDefaultNetherPortalCooldown
public int getDefaultNetherPortalCooldown() -
setVelocityClient
@Environment(CLIENT) public void setVelocityClient(double x, double y, double z) -
handleStatus
@Environment(CLIENT) public void handleStatus(byte status) -
animateDamage
@Environment(CLIENT) public void animateDamage() -
getItemsHand
-
getArmorItems
-
getItemsEquipped
-
equipStack
-
isOnFire
public boolean isOnFire() -
hasVehicle
public boolean hasVehicle() -
hasPassengers
public boolean hasPassengers() -
canBeRiddenInWater
public boolean canBeRiddenInWater() -
setSneaking
public void setSneaking(boolean sneaking) -
isSneaking
public boolean isSneaking() -
bypassesSteppingEffects
public boolean bypassesSteppingEffects() -
bypassesLandingEffects
public boolean bypassesLandingEffects() -
isSneaky
public boolean isSneaky() -
isDescending
public boolean isDescending() -
isInSneakingPose
public boolean isInSneakingPose()Returns whether the entity is in a crouching pose.Compared to
isSneaking(), it only makes the entity appear crouching and does not bring other effects of sneaking, such as no less obvious name label rendering, no dismounting while riding, etc.This is used by vanilla for non-player entities to crouch, such as for foxes and cats.
-
isSprinting
public boolean isSprinting() -
setSprinting
public void setSprinting(boolean sprinting) -
isSwimming
public boolean isSwimming() -
isInSwimmingPose
public boolean isInSwimmingPose() -
shouldLeaveSwimmingPose
@Environment(CLIENT) public boolean shouldLeaveSwimmingPose() -
setSwimming
public void setSwimming(boolean swimming) -
isGlowing
public boolean isGlowing() -
setGlowing
public void setGlowing(boolean glowing) -
isInvisible
public boolean isInvisible() -
isInvisibleTo
-
method_32877
-
getScoreboardTeam
-
isTeammate
-
isTeamPlayer
-
setInvisible
public void setInvisible(boolean invisible) -
getFlag
protected boolean getFlag(int index) -
setFlag
protected void setFlag(int index, boolean value) -
getMaxAir
public int getMaxAir() -
getAir
public int getAir() -
setAir
public void setAir(int air) -
getFrozenTicks
public int getFrozenTicks() -
setFrozenTicks
public void setFrozenTicks(int frozenTicks) -
getFreezingScale
public float getFreezingScale() -
isFreezing
public boolean isFreezing() -
getMinFreezeDamageTicks
public int getMinFreezeDamageTicks() -
onStruckByLightning
-
onBubbleColumnSurfaceCollision
public void onBubbleColumnSurfaceCollision(boolean drag) -
onBubbleColumnCollision
public void onBubbleColumnCollision(boolean drag) -
onKilledOther
-
pushOutOfBlocks
protected void pushOutOfBlocks(double x, double y, double z) -
slowMovement
-
removeClickEvents
-
getName
-
getDefaultName
-
isPartOf
-
getHeadYaw
public float getHeadYaw() -
setHeadYaw
public void setHeadYaw(float headYaw) -
setYaw
public void setYaw(float yaw) -
isAttackable
public boolean isAttackable() -
handleAttack
-
toString
-
isInvulnerableTo
-
isInvulnerable
public boolean isInvulnerable() -
setInvulnerable
public void setInvulnerable(boolean invulnerable) -
copyPositionAndRotation
-
copyFrom
-
moveToWorld
Moves this entity to another world.Note all entities except server player entities are completely recreated at the destination.
- Returns:
- the entity in the other world
-
method_30076
protected void method_30076() -
getTeleportTarget
-
method_30633
-
method_30330
protected Optional<class_5459.class_5460> method_30330(ServerWorld serverWorld, BlockPos blockPos, boolean bool) -
canUsePortals
public boolean canUsePortals() -
getEffectiveExplosionResistance
public float getEffectiveExplosionResistance(Explosion explosion, BlockView world, BlockPos pos, BlockState blockState, FluidState fluidState, float max) -
canExplosionDestroyBlock
public boolean canExplosionDestroyBlock(Explosion explosion, BlockView world, BlockPos pos, BlockState state, float explosionPower) -
getSafeFallDistance
public int getSafeFallDistance() -
canAvoidTraps
public boolean canAvoidTraps() -
populateCrashReport
-
doesRenderOnFire
@Environment(CLIENT) public boolean doesRenderOnFire() -
setUuid
-
getUuid
- Specified by:
getUuidin interfaceclass_5568
-
getUuidAsString
-
getEntityName
-
canFly
public boolean canFly() -
getRenderDistanceMultiplier
@Environment(CLIENT) public static double getRenderDistanceMultiplier() -
setRenderDistanceMultiplier
@Environment(CLIENT) public static void setRenderDistanceMultiplier(double value) -
getDisplayName
- Specified by:
getDisplayNamein interfaceNameable
-
setCustomName
-
getCustomName
- Specified by:
getCustomNamein interfaceNameable
-
hasCustomName
public boolean hasCustomName()- Specified by:
hasCustomNamein interfaceNameable
-
setCustomNameVisible
public void setCustomNameVisible(boolean visible) -
isCustomNameVisible
public boolean isCustomNameVisible() -
teleport
public final void teleport(double destX, double destY, double destZ) -
requestTeleport
public void requestTeleport(double destX, double destY, double destZ) -
shouldRenderName
@Environment(CLIENT) public boolean shouldRenderName() -
onTrackedDataSet
-
calculateDimensions
public void calculateDimensions() -
getHorizontalFacing
-
getMovementDirection
-
getHoverEvent
-
canBeSpectated
-
getBoundingBox
- Specified by:
getBoundingBoxin interfaceclass_5568
-
getVisibilityBoundingBox
-
calculateBoundsForPose
-
setBoundingBox
-
getEyeHeight
-
getEyeHeight
-
getStandingEyeHeight
public final float getStandingEyeHeight() -
method_29919
-
method_32318
-
sendSystemMessage
- Specified by:
sendSystemMessagein interfaceCommandOutput
-
getEntityWorld
-
getServer
-
interactAt
-
isImmuneToExplosion
public boolean isImmuneToExplosion() -
dealDamage
-
onStartedTrackingBy
-
onStoppedTrackingBy
-
applyRotation
-
applyMirror
-
entityDataRequiresOperator
public boolean entityDataRequiresOperator() -
getPrimaryPassenger
-
getPassengerList
-
getFirstPassenger
-
hasPassenger
-
hasPassengerType
-
method_31484
-
streamPassengersRecursively
-
method_31748
- Specified by:
method_31748in interfaceclass_5568
-
getPassengersDeep
-
hasPlayerRider
public boolean hasPlayerRider() -
getRootVehicle
Gets the lowest entity this entity is riding. -
isConnectedThroughVehicle
Checks if this entity and another entity share the same root vehicle.- Parameters:
entity- the other entity
-
hasPassengerDeep
-
isLogicalSideForUpdatingMovement
public boolean isLogicalSideForUpdatingMovement() -
getPassengerDismountOffset
protected static Vec3d getPassengerDismountOffset(double vehicleWidth, double passengerWidth, float passengerYaw) -
updatePassengerForDismount
-
getVehicle
-
getPistonBehavior
-
getSoundCategory
-
getBurningDuration
protected int getBurningDuration() -
getCommandSource
-
getPermissionLevel
protected int getPermissionLevel() -
hasPermissionLevel
public boolean hasPermissionLevel(int permissionLevel) -
shouldReceiveFeedback
public boolean shouldReceiveFeedback()- Specified by:
shouldReceiveFeedbackin interfaceCommandOutput
-
shouldTrackOutput
public boolean shouldTrackOutput()- Specified by:
shouldTrackOutputin interfaceCommandOutput
-
shouldBroadcastConsoleToOps
public boolean shouldBroadcastConsoleToOps()- Specified by:
shouldBroadcastConsoleToOpsin interfaceCommandOutput
-
lookAt
-
updateMovementInFluid
-
getFluidHeight
-
method_29241
public double method_29241() -
getWidth
public final float getWidth() -
getHeight
public final float getHeight() -
createSpawnPacket
-
getDimensions
-
getPos
-
getBlockPos
- Specified by:
getBlockPosin interfaceclass_5568
-
getChunkPos
-
getVelocity
-
setVelocity
-
setVelocity
public void setVelocity(double x, double y, double z) -
getBlockX
public final int getBlockX() -
getX
public final double getX() -
offsetX
public double offsetX(double widthScale) -
getParticleX
public double getParticleX(double widthScale) -
getBlockY
public final int getBlockY() -
getY
public final double getY() -
getBodyY
public double getBodyY(double heightScale) -
getRandomBodyY
public double getRandomBodyY() -
getEyeY
public double getEyeY() -
getBlockZ
public final int getBlockZ() -
getZ
public final double getZ() -
offsetZ
public double offsetZ(double widthScale) -
getParticleZ
public double getParticleZ(double widthScale) -
setPos
public void setPos(double x, double y, double z) -
checkDespawn
public void checkDespawn() -
method_30951
-
onSpawnPacket
-
getPickBlockStack
-
setInPowderSnow
public void setInPowderSnow(boolean inPowderSnow) -
canFreeze
public boolean canFreeze() -
isRemoved
public final boolean isRemoved() -
setRemoved
- Specified by:
setRemovedin interfaceclass_5568
-
unsetRemoved
protected void unsetRemoved() -
method_31744
- Specified by:
method_31744in interfaceclass_5568
-
method_31746
public boolean method_31746()- Specified by:
method_31746in interfaceclass_5568
-
isPlayer
public boolean isPlayer()- Specified by:
isPlayerin interfaceclass_5568
-