public abstract class Entity extends Object implements Nameable, CommandOutput
Modifier and Type | Class and Description |
---|---|
static interface |
Entity.PositionUpdater |
DUMMY
Constructor and Description |
---|
Entity(EntityType<?> type,
World world) |
Modifier and Type | Method and 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) |
private boolean |
doesNotCollide(Box box) |
boolean |
doesNotCollide(double offsetX,
double offsetY,
double offsetZ) |
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(BlockPos pos,
float yaw,
float pitch) |
void |
refreshPositionAndAngles(double x,
double y,
double z,
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) |
protected static final Logger LOGGER
private static final AtomicInteger MAX_ENTITY_ID
private static final Box NULL_BOX
private static double renderDistanceMultiplier
protected static final TrackedData<Byte> FLAGS
private static final TrackedData<Integer> AIR
private static final TrackedData<Optional<Text>> CUSTOM_NAME
private static final TrackedData<Boolean> NAME_VISIBLE
private static final TrackedData<Boolean> SILENT
private static final TrackedData<Boolean> NO_GRAVITY
protected static final TrackedData<EntityPose> POSE
private final EntityType<?> type
private int entityId
public boolean inanimate
protected int ridingCooldown
public boolean teleporting
public World world
public double prevX
public double prevY
public double prevZ
private Vec3d pos
private BlockPos blockPos
private Vec3d velocity
public float yaw
public float pitch
public float prevYaw
public float prevPitch
private Box entityBounds
protected boolean onGround
public boolean horizontalCollision
public boolean verticalCollision
public boolean velocityModified
protected Vec3d movementMultiplier
public boolean removed
public float prevHorizontalSpeed
public float horizontalSpeed
public float distanceTraveled
public float fallDistance
private float nextStepSoundDistance
private float nextFlySoundDistance
public double lastRenderX
public double lastRenderY
public double lastRenderZ
public float stepHeight
public boolean noClip
public float pushSpeedReduction
protected final Random random
public int age
private int fireTicks
protected boolean touchingWater
protected boolean submergedInWater
public int timeUntilRegen
protected boolean firstUpdate
protected final DataTracker dataTracker
public boolean updateNeeded
public int chunkX
public int chunkY
public int chunkZ
private boolean chunkPosUpdateRequested
private Vec3d trackedPosition
public boolean ignoreCameraFrustum
public boolean velocityDirty
private int netherPortalCooldown
protected boolean inNetherPortal
protected int netherPortalTime
protected BlockPos lastNetherPortalPosition
private boolean invulnerable
protected UUID uuid
protected String uuidString
protected boolean glowing
private boolean teleportRequested
private final double[] pistonMovementDelta
private long pistonMovementTick
private EntityDimensions dimensions
private float standingEyeHeight
public Entity(EntityType<?> type, World world)
@Environment(value=CLIENT) public boolean method_30632(BlockPos blockPos, BlockState blockState)
@Environment(value=CLIENT) public int getTeamColorValue()
public boolean isSpectator()
public final void detach()
public void updateTrackedPosition(double x, double y, double z)
public void updateTrackedPosition(Vec3d pos)
@Environment(value=CLIENT) public Vec3d getTrackedPosition()
public EntityType<?> getType()
public int getEntityId()
public void setEntityId(int id)
public boolean addScoreboardTag(String tag)
public boolean removeScoreboardTag(String tag)
public void kill()
protected abstract void initDataTracker()
public DataTracker getDataTracker()
@Environment(value=CLIENT) protected void afterSpawn()
public void remove()
public void setPose(EntityPose pose)
public EntityPose getPose()
public boolean isInRange(Entity other, double radius)
protected void setRotation(float yaw, float pitch)
public void updatePosition(double x, double y, double z)
protected void refreshPosition()
@Environment(value=CLIENT) public void changeLookDirection(double cursorDeltaX, double cursorDeltaY)
public void tick()
public void baseTick()
public void resetNetherPortalCooldown()
public boolean hasNetherPortalCooldown()
protected void tickNetherPortalCooldown()
public int getMaxNetherPortalTime()
protected void setOnFireFromLava()
public void setOnFireFor(int seconds)
public void setFireTicks(int ticks)
public int getFireTicks()
public void extinguish()
protected void destroy()
public boolean doesNotCollide(double offsetX, double offsetY, double offsetZ)
private boolean doesNotCollide(Box box)
public void setOnGround(boolean onGround)
public boolean isOnGround()
public void move(MovementType type, Vec3d movement)
protected BlockPos getLandingPos()
protected float getJumpVelocityMultiplier()
protected float getVelocityMultiplier()
protected BlockPos getVelocityAffectingPos()
protected Vec3d adjustMovementForSneaking(Vec3d movement, MovementType type)
private double calculatePistonMovementFactor(Direction.Axis axis, double offsetFactor)
public static double squaredHorizontalLength(Vec3d vector)
public static Vec3d adjustMovementForCollisions(@Nullable Entity entity, Vec3d movement, Box entityBoundingBox, World world, ShapeContext context, ReusableStream<VoxelShape> collisions)
public static Vec3d adjustMovementForCollisions(Vec3d movement, Box entityBoundingBox, ReusableStream<VoxelShape> collisions)
public static Vec3d adjustSingleAxisMovementForCollisions(Vec3d movement, Box entityBoundingBox, WorldView world, ShapeContext context, ReusableStream<VoxelShape> collisions)
protected float calculateNextStepSoundDistance()
public void moveToBoundingBoxCenter()
protected SoundEvent getSwimSound()
protected SoundEvent getSplashSound()
protected SoundEvent getHighSpeedSplashSound()
protected void checkBlockCollision()
protected void onBlockCollision(BlockState state)
protected void playStepSound(BlockPos pos, BlockState state)
protected void playSwimSound(float volume)
protected float playFlySound(float distance)
protected boolean hasWings()
public void playSound(SoundEvent sound, float volume, float pitch)
public boolean isSilent()
public void setSilent(boolean silent)
public boolean hasNoGravity()
public void setNoGravity(boolean noGravity)
protected boolean canClimb()
protected void fall(double heightDifference, boolean onGround, BlockState landedState, BlockPos landedPosition)
public boolean isFireImmune()
public boolean handleFallDamage(float fallDistance, float damageMultiplier)
public boolean isTouchingWater()
private boolean isBeingRainedOn()
private boolean isInsideBubbleColumn()
public boolean isTouchingWaterOrRain()
public boolean isWet()
isTouchingWater()
,
isBeingRainedOn()
,
isInsideBubbleColumn()
public boolean isInsideWaterOrBubbleColumn()
public boolean isSubmergedInWater()
public void updateSwimming()
protected boolean updateWaterState()
void checkWaterState()
private void updateSubmergedInWaterState()
protected void onSwimmingStart()
protected BlockState getLandingBlockState()
public boolean shouldSpawnSprintingParticles()
protected void spawnSprintingParticles()
public boolean isInLava()
public void updateVelocity(float speed, Vec3d movementInput)
private static Vec3d movementInputToVelocity(Vec3d movementInput, float speed, float yaw)
public float getBrightnessAtEyes()
public void setWorld(World world)
public void updatePositionAndAngles(double x, double y, double z, float yaw, float pitch)
public void method_30634(double x, double y, double z)
public void refreshPositionAfterTeleport(Vec3d vec3d)
public void refreshPositionAfterTeleport(double x, double y, double z)
public void refreshPositionAndAngles(BlockPos pos, float yaw, float pitch)
public void refreshPositionAndAngles(double x, double y, double z, float yaw, float pitch)
public void resetPosition(double x, double y, double z)
public float distanceTo(Entity entity)
public double squaredDistanceTo(double x, double y, double z)
public double squaredDistanceTo(Entity entity)
public double squaredDistanceTo(Vec3d vector)
public void onPlayerCollision(PlayerEntity player)
public void pushAwayFrom(Entity entity)
public void addVelocity(double deltaX, double deltaY, double deltaZ)
protected void scheduleVelocityUpdate()
public boolean damage(DamageSource source, float amount)
public final Vec3d getRotationVec(float tickDelta)
public float getPitch(float tickDelta)
public float getYaw(float tickDelta)
protected final Vec3d getRotationVector(float pitch, float yaw)
public final Vec3d getOppositeRotationVector(float tickDelta)
protected final Vec3d getOppositeRotationVector(float pitch, float yaw)
public final Vec3d getCameraPosVec(float tickDelta)
@Environment(value=CLIENT) public Vec3d method_31166(float tickDelta)
@Environment(value=CLIENT) public final Vec3d method_30950(float float2)
public HitResult raycast(double maxDistance, float tickDelta, boolean includeFluids)
public boolean collides()
public boolean isPushable()
public void updateKilledAdvancementCriterion(Entity killer, int score, DamageSource damageSource)
@Environment(value=CLIENT) public boolean shouldRender(double cameraX, double cameraY, double cameraZ)
@Environment(value=CLIENT) public boolean shouldRender(double distance)
public boolean saveSelfToTag(CompoundTag tag)
public boolean saveToTag(CompoundTag tag)
public CompoundTag toTag(CompoundTag tag)
public void fromTag(CompoundTag tag)
protected boolean shouldSetPositionOnLoad()
protected abstract void readCustomDataFromTag(CompoundTag tag)
protected abstract void writeCustomDataToTag(CompoundTag tag)
protected ListTag toListTag(double[] values)
protected ListTag toListTag(float[] values)
@Nullable public ItemEntity dropItem(ItemConvertible item)
@Nullable public ItemEntity dropItem(ItemConvertible item, int yOffset)
@Nullable public ItemEntity dropStack(ItemStack stack)
@Nullable public ItemEntity dropStack(ItemStack stack, float yOffset)
public boolean isAlive()
public boolean isInsideWall()
public ActionResult interact(PlayerEntity player, Hand hand)
player
- the playerhand
- the hand the player used to interact with this entitypublic boolean collidesWith(Entity other)
public boolean isCollidable()
public void tickRiding()
public void updatePassengerPosition(Entity passenger)
private void updatePassengerPosition(Entity passenger, Entity.PositionUpdater positionUpdater)
@Environment(value=CLIENT) public void onPassengerLookAround(Entity passenger)
public double getHeightOffset()
public double getMountedHeightOffset()
public boolean startRiding(Entity entity)
@Environment(value=CLIENT) public boolean isLiving()
public boolean startRiding(Entity entity, boolean force)
protected boolean canStartRiding(Entity entity)
protected boolean wouldPoseNotCollide(EntityPose pose)
public void removeAllPassengers()
public void method_29239()
public void stopRiding()
protected void addPassenger(Entity passenger)
protected void removePassenger(Entity passenger)
protected boolean canAddPassenger(Entity passenger)
@Environment(value=CLIENT) public void updateTrackedPositionAndAngles(double x, double y, double z, float yaw, float pitch, int interpolationSteps, boolean interpolate)
@Environment(value=CLIENT) public void updateTrackedHeadRotation(float yaw, int interpolationSteps)
public float getTargetingMargin()
public Vec3d getRotationVector()
public Vec2f getRotationClient()
@Environment(value=CLIENT) public Vec3d getRotationVecClient()
public void setInNetherPortal(BlockPos pos)
protected void tickNetherPortal()
public int getDefaultNetherPortalCooldown()
@Environment(value=CLIENT) public void setVelocityClient(double x, double y, double z)
@Environment(value=CLIENT) public void handleStatus(byte status)
@Environment(value=CLIENT) public void animateDamage()
public void equipStack(EquipmentSlot slot, ItemStack stack)
public boolean isOnFire()
public boolean hasVehicle()
public boolean hasPassengers()
public boolean canBeRiddenInWater()
public void setSneaking(boolean sneaking)
public boolean isSneaking()
public boolean bypassesSteppingEffects()
public boolean bypassesLandingEffects()
public boolean isSneaky()
public boolean isDescending()
public boolean isInSneakingPose()
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.
public boolean isSprinting()
public void setSprinting(boolean sprinting)
public boolean isSwimming()
public boolean isInSwimmingPose()
@Environment(value=CLIENT) public boolean shouldLeaveSwimmingPose()
public void setSwimming(boolean swimming)
public boolean isGlowing()
public void setGlowing(boolean glowing)
public boolean isInvisible()
@Environment(value=CLIENT) public boolean isInvisibleTo(PlayerEntity player)
@Nullable public AbstractTeam getScoreboardTeam()
public boolean isTeammate(Entity other)
public boolean isTeamPlayer(AbstractTeam team)
public void setInvisible(boolean invisible)
protected boolean getFlag(int index)
protected void setFlag(int index, boolean value)
public int getMaxAir()
public int getAir()
public void setAir(int air)
public void onStruckByLightning(ServerWorld world, LightningEntity lightning)
public void onBubbleColumnSurfaceCollision(boolean drag)
public void onBubbleColumnCollision(boolean drag)
public void onKilledOther(ServerWorld serverWorld, LivingEntity livingEntity)
protected void pushOutOfBlocks(double x, double y, double z)
public void slowMovement(BlockState state, Vec3d multiplier)
protected Text getDefaultName()
public boolean isPartOf(Entity entity)
public float getHeadYaw()
public void setHeadYaw(float headYaw)
public void setYaw(float yaw)
public boolean isAttackable()
public boolean handleAttack(Entity attacker)
public boolean isInvulnerableTo(DamageSource damageSource)
public boolean isInvulnerable()
public void setInvulnerable(boolean invulnerable)
public void copyPositionAndRotation(Entity entity)
public void copyFrom(Entity original)
@Nullable public Entity moveToWorld(ServerWorld destination)
Note all entities except server player entities are completely recreated at the destination.
protected void method_30076()
@Nullable protected TeleportTarget getTeleportTarget(ServerWorld destination)
protected Vec3d method_30633(Direction.Axis axis, class_5459.class_5460 class_5460)
protected Optional<class_5459.class_5460> method_30330(ServerWorld serverWorld, BlockPos blockPos, boolean bool)
public boolean canUsePortals()
public float getEffectiveExplosionResistance(Explosion explosion, BlockView world, BlockPos pos, BlockState blockState, FluidState fluidState, float max)
public boolean canExplosionDestroyBlock(Explosion explosion, BlockView world, BlockPos pos, BlockState state, float explosionPower)
public int getSafeFallDistance()
public boolean canAvoidTraps()
public void populateCrashReport(CrashReportSection section)
@Environment(value=CLIENT) public boolean doesRenderOnFire()
public void setUuid(UUID uuid)
public UUID getUuid()
public String getUuidAsString()
public String getEntityName()
public boolean canFly()
@Environment(value=CLIENT) public static double getRenderDistanceMultiplier()
@Environment(value=CLIENT) public static void setRenderDistanceMultiplier(double value)
public Text getDisplayName()
getDisplayName
in interface Nameable
@Nullable public Text getCustomName()
getCustomName
in interface Nameable
public boolean hasCustomName()
hasCustomName
in interface Nameable
public void setCustomNameVisible(boolean visible)
public boolean isCustomNameVisible()
public final void teleport(double destX, double destY, double destZ)
public void requestTeleport(double destX, double destY, double destZ)
@Environment(value=CLIENT) public boolean shouldRenderName()
public void onTrackedDataSet(TrackedData<?> data)
public void calculateDimensions()
public Direction getHorizontalFacing()
public Direction getMovementDirection()
protected HoverEvent getHoverEvent()
public boolean canBeSpectated(ServerPlayerEntity spectator)
public Box getBoundingBox()
@Environment(value=CLIENT) public Box getVisibilityBoundingBox()
protected Box calculateBoundsForPose(EntityPose pos)
public void setBoundingBox(Box boundingBox)
protected float getEyeHeight(EntityPose pose, EntityDimensions dimensions)
@Environment(value=CLIENT) public float getEyeHeight(EntityPose pose)
public final float getStandingEyeHeight()
@Environment(value=CLIENT) public Vec3d method_29919()
public boolean equip(int slot, ItemStack item)
public void sendSystemMessage(Text message, UUID senderUuid)
sendSystemMessage
in interface CommandOutput
public World getEntityWorld()
@Nullable public MinecraftServer getServer()
public ActionResult interactAt(PlayerEntity player, Vec3d hitPos, Hand hand)
public boolean isImmuneToExplosion()
public void dealDamage(LivingEntity attacker, Entity target)
public void onStartedTrackingBy(ServerPlayerEntity player)
public void onStoppedTrackingBy(ServerPlayerEntity player)
public float applyRotation(BlockRotation rotation)
public float applyMirror(BlockMirror mirror)
public boolean entityDataRequiresOperator()
public boolean teleportRequested()
public boolean isChunkPosUpdateRequested()
public boolean hasPassenger(Entity passenger)
public Collection<Entity> getPassengersDeep()
public boolean hasPlayerRider()
public Entity getRootVehicle()
public boolean isConnectedThroughVehicle(Entity entity)
entity
- the other entity@Environment(value=CLIENT) public boolean hasPassengerDeep(Entity passenger)
public boolean isLogicalSideForUpdatingMovement()
protected static Vec3d getPassengerDismountOffset(double vehicleWidth, double passengerWidth, float passengerYaw)
public Vec3d updatePassengerForDismount(LivingEntity passenger)
public PistonBehavior getPistonBehavior()
public SoundCategory getSoundCategory()
protected int getBurningDuration()
public ServerCommandSource getCommandSource()
protected int getPermissionLevel()
public boolean hasPermissionLevel(int permissionLevel)
public boolean shouldReceiveFeedback()
shouldReceiveFeedback
in interface CommandOutput
public boolean shouldTrackOutput()
shouldTrackOutput
in interface CommandOutput
public boolean shouldBroadcastConsoleToOps()
shouldBroadcastConsoleToOps
in interface CommandOutput
public void lookAt(EntityAnchorArgumentType.EntityAnchor anchorPoint, Vec3d target)
public double method_29241()
public final float getWidth()
public final float getHeight()
public abstract Packet<?> createSpawnPacket()
public EntityDimensions getDimensions(EntityPose pose)
public Vec3d getPos()
public BlockPos getBlockPos()
public Vec3d getVelocity()
public void setVelocity(Vec3d velocity)
public void setVelocity(double x, double y, double z)
public final double getX()
public double offsetX(double widthScale)
public double getParticleX(double widthScale)
public final double getY()
public double getBodyY(double heightScale)
public double getRandomBodyY()
public double getEyeY()
public final double getZ()
public double offsetZ(double widthScale)
public double getParticleZ(double widthScale)
public void setPos(double x, double y, double z)
public void checkDespawn()
@Environment(value=CLIENT) public Vec3d method_30951(float float2)