Package net.minecraft.entity
Class Entity
java.lang.Object
net.minecraft.entity.Entity
- All Implemented Interfaces:
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, CommandOutput
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Entity.PositionUpdater
-
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 void
addPassenger(Entity passenger)
boolean
addScoreboardTag(String tag)
void
addVelocity(double deltaX, double deltaY, double deltaZ)
static Vec3d
adjustMovementForCollisions(Entity entity, Vec3d movement, Box entityBoundingBox, World world, ShapeContext context, ReusableStream<VoxelShape> collisions)
private Vec3d
adjustMovementForCollisions(Vec3d movement)
static Vec3d
adjustMovementForCollisions(Vec3d movement, Box entityBoundingBox, ReusableStream<VoxelShape> collisions)
protected Vec3d
adjustMovementForPiston(Vec3d movement)
protected Vec3d
adjustMovementForSneaking(Vec3d movement, MovementType type)
static Vec3d
adjustSingleAxisMovementForCollisions(Vec3d movement, Box entityBoundingBox, WorldView world, ShapeContext context, ReusableStream<VoxelShape> collisions)
protected void
afterSpawn()
void
animateDamage()
float
applyMirror(BlockMirror mirror)
float
applyRotation(BlockRotation rotation)
void
baseTick()
boolean
bypassesLandingEffects()
boolean
bypassesSteppingEffects()
protected Box
calculateBoundsForPose(EntityPose pos)
void
calculateDimensions()
protected float
calculateNextStepSoundDistance()
private double
calculatePistonMovementFactor(Direction.Axis axis, double offsetFactor)
protected boolean
canAddPassenger(Entity passenger)
boolean
canAvoidTraps()
boolean
canBeRiddenInWater()
boolean
canBeSpectated(ServerPlayerEntity spectator)
protected boolean
canClimb()
boolean
canExplosionDestroyBlock(Explosion explosion, BlockView world, BlockPos pos, BlockState state, float explosionPower)
boolean
canFly()
protected boolean
canStartRiding(Entity entity)
boolean
canUsePortals()
void
changeLookDirection(double cursorDeltaX, double cursorDeltaY)
protected void
checkBlockCollision()
void
checkDespawn()
(package private) void
checkWaterState()
private void
collectPassengers(boolean playersOnly, Set<Entity> output)
boolean
collides()
boolean
collidesWith(Entity other)
void
copyFrom(Entity original)
void
copyPositionAndRotation(Entity entity)
abstract Packet<?>
createSpawnPacket()
boolean
damage(DamageSource source, float amount)
void
dealDamage(LivingEntity attacker, Entity target)
protected void
destroy()
void
detach()
Removes all the passengers and removes this entity from any vehicles it is riding.float
distanceTo(Entity entity)
boolean
doesNotCollide(double offsetX, double offsetY, double offsetZ)
private boolean
doesNotCollide(Box box)
boolean
doesRenderOnFire()
ItemEntity
dropItem(ItemConvertible item)
ItemEntity
dropItem(ItemConvertible item, int yOffset)
ItemEntity
dropStack(ItemStack stack)
ItemEntity
dropStack(ItemStack stack, float yOffset)
boolean
entityDataRequiresOperator()
boolean
equals(Object o)
boolean
equip(int slot, ItemStack item)
void
equipStack(EquipmentSlot slot, ItemStack stack)
void
extinguish()
protected void
fall(double heightDifference, boolean onGround, BlockState landedState, BlockPos landedPosition)
void
fromTag(CompoundTag tag)
int
getAir()
Iterable<ItemStack>
getArmorItems()
BlockPos
getBlockPos()
double
getBodyY(double heightScale)
Box
getBoundingBox()
float
getBrightnessAtEyes()
protected int
getBurningDuration()
Vec3d
getCameraPosVec(float tickDelta)
ServerCommandSource
getCommandSource()
Text
getCustomName()
DataTracker
getDataTracker()
protected Text
getDefaultName()
int
getDefaultNetherPortalCooldown()
EntityDimensions
getDimensions(EntityPose pose)
Text
getDisplayName()
float
getEffectiveExplosionResistance(Explosion explosion, BlockView world, BlockPos pos, BlockState blockState, FluidState fluidState, float max)
int
getEntityId()
String
getEntityName()
World
getEntityWorld()
float
getEyeHeight(EntityPose pose)
protected float
getEyeHeight(EntityPose pose, EntityDimensions dimensions)
double
getEyeY()
int
getFireTicks()
protected boolean
getFlag(int index)
double
getFluidHeight(Tag<Fluid> fluid)
float
getHeadYaw()
float
getHeight()
double
getHeightOffset()
protected SoundEvent
getHighSpeedSplashSound()
Direction
getHorizontalFacing()
protected HoverEvent
getHoverEvent()
Iterable<ItemStack>
getItemsEquipped()
Iterable<ItemStack>
getItemsHand()
protected float
getJumpVelocityMultiplier()
protected BlockState
getLandingBlockState()
protected BlockPos
getLandingPos()
int
getMaxAir()
int
getMaxNetherPortalTime()
double
getMountedHeightOffset()
Direction
getMovementDirection()
Text
getName()
Vec3d
getOppositeRotationVector(float tickDelta)
protected Vec3d
getOppositeRotationVector(float pitch, float yaw)
double
getParticleX(double widthScale)
double
getParticleZ(double widthScale)
protected static Vec3d
getPassengerDismountOffset(double vehicleWidth, double passengerWidth, float passengerYaw)
List<Entity>
getPassengerList()
Collection<Entity>
getPassengersDeep()
protected int
getPermissionLevel()
PistonBehavior
getPistonBehavior()
float
getPitch(float tickDelta)
Vec3d
getPos()
EntityPose
getPose()
Entity
getPrimaryPassenger()
double
getRandomBodyY()
static double
getRenderDistanceMultiplier()
Entity
getRootVehicle()
Gets the lowest entity this entity is riding.Vec2f
getRotationClient()
Vec3d
getRotationVec(float tickDelta)
Vec3d
getRotationVecClient()
Vec3d
getRotationVector()
protected Vec3d
getRotationVector(float pitch, float yaw)
int
getSafeFallDistance()
protected String
getSavedEntityId()
Set<String>
getScoreboardTags()
AbstractTeam
getScoreboardTeam()
MinecraftServer
getServer()
SoundCategory
getSoundCategory()
protected SoundEvent
getSplashSound()
float
getStandingEyeHeight()
protected SoundEvent
getSwimSound()
float
getTargetingMargin()
int
getTeamColorValue()
protected TeleportTarget
getTeleportTarget(ServerWorld destination)
Vec3d
getTrackedPosition()
EntityType<?>
getType()
UUID
getUuid()
String
getUuidAsString()
Entity
getVehicle()
Vec3d
getVelocity()
protected BlockPos
getVelocityAffectingPos()
protected float
getVelocityMultiplier()
Box
getVisibilityBoundingBox()
float
getWidth()
double
getX()
double
getY()
float
getYaw(float tickDelta)
double
getZ()
boolean
handleAttack(Entity attacker)
boolean
handleFallDamage(float fallDistance, float damageMultiplier)
void
handleStatus(byte status)
boolean
hasCustomName()
int
hashCode()
boolean
hasNetherPortalCooldown()
boolean
hasNoGravity()
boolean
hasPassenger(Entity passenger)
boolean
hasPassengerDeep(Entity passenger)
boolean
hasPassengers()
boolean
hasPassengerType(Class<? extends Entity> clazz)
boolean
hasPermissionLevel(int permissionLevel)
boolean
hasPlayerRider()
boolean
hasVehicle()
protected boolean
hasWings()
protected abstract void
initDataTracker()
ActionResult
interact(PlayerEntity player, Hand hand)
Called when a player interacts with this entity.ActionResult
interactAt(PlayerEntity player, Vec3d hitPos, Hand hand)
boolean
isAlive()
boolean
isAttackable()
private boolean
isBeingRainedOn()
boolean
isChunkPosUpdateRequested()
boolean
isCollidable()
boolean
isConnectedThroughVehicle(Entity entity)
Checks if this entity and another entity share the same root vehicle.boolean
isCustomNameVisible()
boolean
isDescending()
boolean
isFireImmune()
boolean
isGlowing()
boolean
isImmuneToExplosion()
boolean
isInLava()
boolean
isInRange(Entity other, double radius)
private boolean
isInsideBubbleColumn()
boolean
isInsideWall()
boolean
isInsideWaterOrBubbleColumn()
boolean
isInSneakingPose()
Returns whether the entity is in a crouching pose.boolean
isInSwimmingPose()
boolean
isInvisible()
boolean
isInvisibleTo(PlayerEntity player)
boolean
isInvulnerable()
boolean
isInvulnerableTo(DamageSource damageSource)
boolean
isLiving()
boolean
isLogicalSideForUpdatingMovement()
boolean
isOnFire()
boolean
isOnGround()
boolean
isPartOf(Entity entity)
boolean
isPushable()
boolean
isSilent()
boolean
isSneaking()
boolean
isSneaky()
boolean
isSpectator()
boolean
isSprinting()
boolean
isSubmergedIn(Tag<Fluid> tag)
boolean
isSubmergedInWater()
Returns whether this entity's hitbox is fully submerged in water.boolean
isSwimming()
boolean
isTeammate(Entity other)
boolean
isTeamPlayer(AbstractTeam team)
boolean
isTouchingWater()
Returns whether this entity's hitbox is touching water fluid.boolean
isTouchingWaterOrRain()
boolean
isWet()
Returns whether this entity is touching water, or is being rained on, or is inside a bubble column...void
kill()
void
lookAt(EntityAnchorArgumentType.EntityAnchor anchorPoint, Vec3d target)
void
method_29239()
double
method_29241()
Vec3d
method_29919()
protected void
method_30076()
protected Optional<class_5459.class_5460>
method_30330(ServerWorld serverWorld, BlockPos blockPos, boolean bool)
boolean
method_30632(BlockPos blockPos, BlockState blockState)
protected Vec3d
method_30633(Direction.Axis axis, class_5459.class_5460 class_5460)
void
method_30634(double x, double y, double z)
Vec3d
method_30950(float float2)
Vec3d
method_30951(float float2)
Vec3d
method_31166(float tickDelta)
void
move(MovementType type, Vec3d movement)
private static Vec3d
movementInputToVelocity(Vec3d movementInput, float speed, float yaw)
void
moveToBoundingBoxCenter()
Entity
moveToWorld(ServerWorld destination)
Moves this entity to another world.double
offsetX(double widthScale)
double
offsetZ(double widthScale)
protected void
onBlockCollision(BlockState state)
void
onBubbleColumnCollision(boolean drag)
void
onBubbleColumnSurfaceCollision(boolean drag)
void
onKilledOther(ServerWorld serverWorld, LivingEntity livingEntity)
void
onPassengerLookAround(Entity passenger)
void
onPlayerCollision(PlayerEntity player)
void
onStartedTrackingBy(ServerPlayerEntity player)
void
onStoppedTrackingBy(ServerPlayerEntity player)
void
onStruckByLightning(ServerWorld world, LightningEntity lightning)
protected void
onSwimmingStart()
void
onTrackedDataSet(TrackedData<?> data)
protected float
playFlySound(float distance)
void
playSound(SoundEvent sound, float volume, float pitch)
protected void
playStepSound(BlockPos pos, BlockState state)
protected void
playSwimSound(float volume)
void
populateCrashReport(CrashReportSection section)
void
pushAwayFrom(Entity entity)
protected void
pushOutOfBlocks(double x, double y, double z)
HitResult
raycast(double maxDistance, float tickDelta, boolean includeFluids)
protected abstract void
readCustomDataFromTag(CompoundTag tag)
protected void
refreshPosition()
void
refreshPositionAfterTeleport(double x, double y, double z)
void
refreshPositionAfterTeleport(Vec3d vec3d)
void
refreshPositionAndAngles(double x, double y, double z, float yaw, float pitch)
void
refreshPositionAndAngles(BlockPos pos, float yaw, float pitch)
void
remove()
void
removeAllPassengers()
private static Text
removeClickEvents(Text textComponent)
protected void
removePassenger(Entity passenger)
boolean
removeScoreboardTag(String tag)
void
requestTeleport(double destX, double destY, double destZ)
void
resetNetherPortalCooldown()
void
resetPosition(double x, double y, double z)
boolean
saveSelfToTag(CompoundTag tag)
boolean
saveToTag(CompoundTag tag)
protected void
scheduleVelocityUpdate()
void
sendSystemMessage(Text message, UUID senderUuid)
void
setAir(int air)
void
setBoundingBox(Box boundingBox)
void
setCustomName(Text name)
void
setCustomNameVisible(boolean visible)
void
setEntityId(int id)
void
setFireTicks(int ticks)
protected void
setFlag(int index, boolean value)
void
setGlowing(boolean glowing)
void
setHeadYaw(float headYaw)
void
setInNetherPortal(BlockPos pos)
void
setInvisible(boolean invisible)
void
setInvulnerable(boolean invulnerable)
void
setNoGravity(boolean noGravity)
void
setOnFireFor(int seconds)
protected void
setOnFireFromLava()
void
setOnGround(boolean onGround)
void
setPos(double x, double y, double z)
void
setPose(EntityPose pose)
static void
setRenderDistanceMultiplier(double value)
protected void
setRotation(float yaw, float pitch)
void
setSilent(boolean silent)
void
setSneaking(boolean sneaking)
void
setSprinting(boolean sprinting)
void
setSwimming(boolean swimming)
void
setUuid(UUID uuid)
void
setVelocity(double x, double y, double z)
void
setVelocity(Vec3d velocity)
void
setVelocityClient(double x, double y, double z)
void
setWorld(World world)
void
setYaw(float yaw)
boolean
shouldBroadcastConsoleToOps()
boolean
shouldLeaveSwimmingPose()
boolean
shouldReceiveFeedback()
boolean
shouldRender(double distance)
boolean
shouldRender(double cameraX, double cameraY, double cameraZ)
boolean
shouldRenderName()
protected boolean
shouldSetPositionOnLoad()
boolean
shouldSpawnSprintingParticles()
boolean
shouldTrackOutput()
void
slowMovement(BlockState state, Vec3d multiplier)
protected void
spawnSprintingParticles()
double
squaredDistanceTo(double x, double y, double z)
double
squaredDistanceTo(Entity entity)
double
squaredDistanceTo(Vec3d vector)
static double
squaredHorizontalLength(Vec3d vector)
boolean
startRiding(Entity entity)
boolean
startRiding(Entity entity, boolean force)
void
stopRiding()
Stream<Entity>
streamPassengersRecursively()
void
teleport(double destX, double destY, double destZ)
boolean
teleportRequested()
void
tick()
protected void
tickNetherPortal()
protected void
tickNetherPortalCooldown()
void
tickRiding()
protected ListTag
toListTag(double[] values)
protected ListTag
toListTag(float[] values)
String
toString()
CompoundTag
toTag(CompoundTag tag)
void
updateKilledAdvancementCriterion(Entity killer, int score, DamageSource damageSource)
boolean
updateMovementInFluid(Tag<Fluid> tag, double double2)
Vec3d
updatePassengerForDismount(LivingEntity passenger)
void
updatePassengerPosition(Entity passenger)
private void
updatePassengerPosition(Entity passenger, Entity.PositionUpdater positionUpdater)
void
updatePosition(double x, double y, double z)
void
updatePositionAndAngles(double x, double y, double z, float yaw, float pitch)
private void
updateSubmergedInWaterState()
void
updateSwimming()
void
updateTrackedHeadRotation(float yaw, int interpolationSteps)
void
updateTrackedPosition(double x, double y, double z)
void
updateTrackedPosition(Vec3d pos)
void
updateTrackedPositionAndAngles(double x, double y, double z, float yaw, float pitch, int interpolationSteps, boolean interpolate)
void
updateVelocity(float speed, Vec3d movementInput)
protected boolean
updateWaterState()
protected boolean
wouldPoseNotCollide(EntityPose pose)
protected abstract void
writeCustomDataToTag(CompoundTag tag)
-
Field Details
-
LOGGER
-
MAX_ENTITY_ID
-
EMPTY_STACK_LIST
-
NULL_BOX
-
renderDistanceMultiplier
private static double renderDistanceMultiplier -
FLAGS
-
AIR
-
CUSTOM_NAME
-
NAME_VISIBLE
-
SILENT
-
NO_GRAVITY
-
POSE
-
type
-
entityId
private int entityId -
inanimate
public boolean inanimate -
passengerList
-
ridingCooldown
protected int ridingCooldown -
vehicle
-
teleporting
public boolean teleporting -
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
-
removed
public boolean removed -
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
-
updateNeeded
public boolean updateNeeded -
chunkX
public int chunkX -
chunkY
public int chunkY -
chunkZ
public int chunkZ -
chunkPosUpdateRequested
private boolean chunkPosUpdateRequested -
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
-
teleportRequested
private boolean teleportRequested -
pistonMovementDelta
private final double[] pistonMovementDelta -
pistonMovementTick
private long pistonMovementTick -
dimensions
-
standingEyeHeight
private float standingEyeHeight
-
-
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() -
setEntityId
public void setEntityId(int id) -
getScoreboardTags
-
addScoreboardTag
-
removeScoreboardTag
-
kill
public void kill() -
initDataTracker
protected abstract void initDataTracker() -
getDataTracker
-
equals
-
hashCode
public int hashCode() -
afterSpawn
@Environment(CLIENT) protected void afterSpawn() -
remove
public void 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() -
resetNetherPortalCooldown
public void resetNetherPortalCooldown() -
hasNetherPortalCooldown
public boolean hasNetherPortalCooldown() -
tickNetherPortalCooldown
protected void tickNetherPortalCooldown() -
getMaxNetherPortalTime
public int getMaxNetherPortalTime() -
setOnFireFromLava
protected 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
-
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() -
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() -
setWorld
-
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() -
method_29239
public void method_29239() -
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
-
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) -
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
-
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:
getDisplayName
in interfaceNameable
-
setCustomName
-
getCustomName
- Specified by:
getCustomName
in interfaceNameable
-
hasCustomName
public boolean hasCustomName()- Specified by:
hasCustomName
in 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
-
getVisibilityBoundingBox
-
calculateBoundsForPose
-
setBoundingBox
-
getEyeHeight
-
getEyeHeight
-
getStandingEyeHeight
public final float getStandingEyeHeight() -
method_29919
-
equip
-
sendSystemMessage
- Specified by:
sendSystemMessage
in interfaceCommandOutput
-
getEntityWorld
-
getServer
-
interactAt
-
isImmuneToExplosion
public boolean isImmuneToExplosion() -
dealDamage
-
onStartedTrackingBy
-
onStoppedTrackingBy
-
applyRotation
-
applyMirror
-
entityDataRequiresOperator
public boolean entityDataRequiresOperator() -
teleportRequested
public boolean teleportRequested() -
isChunkPosUpdateRequested
public boolean isChunkPosUpdateRequested() -
getPrimaryPassenger
-
getPassengerList
-
hasPassenger
-
hasPassengerType
-
getPassengersDeep
-
streamPassengersRecursively
-
hasPlayerRider
public boolean hasPlayerRider() -
collectPassengers
-
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:
shouldReceiveFeedback
in interfaceCommandOutput
-
shouldTrackOutput
public boolean shouldTrackOutput()- Specified by:
shouldTrackOutput
in interfaceCommandOutput
-
shouldBroadcastConsoleToOps
public boolean shouldBroadcastConsoleToOps()- Specified by:
shouldBroadcastConsoleToOps
in interfaceCommandOutput
-
lookAt
-
updateMovementInFluid
-
getFluidHeight
-
method_29241
public double method_29241() -
getWidth
public final float getWidth() -
getHeight
public final float getHeight() -
createSpawnPacket
-
getDimensions
-
getPos
-
getBlockPos
-
getVelocity
-
setVelocity
-
setVelocity
public void setVelocity(double x, double y, double z) -
getX
public final double getX() -
offsetX
public double offsetX(double widthScale) -
getParticleX
public double getParticleX(double widthScale) -
getY
public final double getY() -
getBodyY
public double getBodyY(double heightScale) -
getRandomBodyY
public double getRandomBodyY() -
getEyeY
public double getEyeY() -
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
-