Class Entity

All Implemented Interfaces:
CommandSource, EntityAccess, Nameable, ICapabilityProvider, ICapabilityProviderImpl<Entity>, ICapabilitySerializable<CompoundTag>, IForgeEntity, INBTSerializable<CompoundTag>
Direct Known Subclasses:
AbstractMinecart, AreaEffectCloud, Boat, Display, EndCrystal, EvokerFangs, ExperienceOrb, EyeOfEnder, FallingBlockEntity, HangingEntity, Interaction, ItemEntity, LightningBolt, LivingEntity, Marker, PartEntity, PrimedTnt, Projectile

public abstract class Entity extends CapabilityProvider<Entity> implements Nameable, EntityAccess, CommandSource, IForgeEntity
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • ID_TAG

      public static final String ID_TAG
      See Also:
    • PASSENGERS_TAG

      public static final String PASSENGERS_TAG
      See Also:
    • ENTITY_COUNTER

      protected static final AtomicInteger ENTITY_COUNTER
    • EMPTY_LIST

      private static final List<ItemStack> EMPTY_LIST
    • BOARDING_COOLDOWN

      public static final int BOARDING_COOLDOWN
      See Also:
    • TOTAL_AIR_SUPPLY

      public static final int TOTAL_AIR_SUPPLY
      See Also:
    • MAX_ENTITY_TAG_COUNT

      public static final int MAX_ENTITY_TAG_COUNT
      See Also:
    • DELTA_AFFECTED_BY_BLOCKS_BELOW

      public static final double DELTA_AFFECTED_BY_BLOCKS_BELOW
      See Also:
    • BREATHING_DISTANCE_BELOW_EYES

      public static final float BREATHING_DISTANCE_BELOW_EYES
      See Also:
    • BASE_TICKS_REQUIRED_TO_FREEZE

      public static final int BASE_TICKS_REQUIRED_TO_FREEZE
      See Also:
    • FREEZE_HURT_FREQUENCY

      public static final int FREEZE_HURT_FREQUENCY
      See Also:
    • INITIAL_AABB

      private static final AABB INITIAL_AABB
    • WATER_FLOW_SCALE

      private static final double WATER_FLOW_SCALE
      See Also:
    • LAVA_FAST_FLOW_SCALE

      private static final double LAVA_FAST_FLOW_SCALE
      See Also:
    • LAVA_SLOW_FLOW_SCALE

      private static final double LAVA_SLOW_FLOW_SCALE
      See Also:
    • UUID_TAG

      public static final String UUID_TAG
      See Also:
    • viewScale

      private static double viewScale
    • type

      @Deprecated private final EntityType<?> type
      Deprecated.
    • id

      private int id
    • blocksBuilding

      public boolean blocksBuilding
    • passengers

      private com.google.common.collect.ImmutableList<Entity> passengers
    • boardingCooldown

      protected int boardingCooldown
    • vehicle

      @Nullable private Entity vehicle
    • level

      public Level level
    • xo

      public double xo
    • yo

      public double yo
    • zo

      public double zo
    • position

      private Vec3 position
    • blockPosition

      private BlockPos blockPosition
    • chunkPosition

      private ChunkPos chunkPosition
    • deltaMovement

      private Vec3 deltaMovement
    • yRot

      private float yRot
    • xRot

      private float xRot
    • yRotO

      public float yRotO
    • xRotO

      public float xRotO
    • bb

      private AABB bb
    • onGround

      protected boolean onGround
    • horizontalCollision

      public boolean horizontalCollision
    • verticalCollision

      public boolean verticalCollision
    • verticalCollisionBelow

      public boolean verticalCollisionBelow
    • minorHorizontalCollision

      public boolean minorHorizontalCollision
    • hurtMarked

      public boolean hurtMarked
    • stuckSpeedMultiplier

      protected Vec3 stuckSpeedMultiplier
    • removalReason

      @Nullable private Entity.RemovalReason removalReason
    • DEFAULT_BB_WIDTH

      public static final float DEFAULT_BB_WIDTH
      See Also:
    • DEFAULT_BB_HEIGHT

      public static final float DEFAULT_BB_HEIGHT
      See Also:
    • walkDistO

      public float walkDistO
    • walkDist

      public float walkDist
    • moveDist

      public float moveDist
    • flyDist

      public float flyDist
    • fallDistance

      public float fallDistance
    • nextStep

      private float nextStep
    • xOld

      public double xOld
    • yOld

      public double yOld
    • zOld

      public double zOld
    • maxUpStep

      @Deprecated public float maxUpStep
      Deprecated.
    • noPhysics

      public boolean noPhysics
    • random

      protected final RandomSource random
    • tickCount

      public int tickCount
    • remainingFireTicks

      private int remainingFireTicks
    • wasTouchingWater

      protected boolean wasTouchingWater
    • fluidHeight

      @Deprecated protected it.unimi.dsi.fastutil.objects.Object2DoubleMap<TagKey<Fluid>> fluidHeight
      Deprecated.
    • wasEyeInWater

      protected boolean wasEyeInWater
    • fluidOnEyes

      @Deprecated private final Set<TagKey<Fluid>> fluidOnEyes
      Deprecated.
    • invulnerableTime

      public int invulnerableTime
    • firstTick

      protected boolean firstTick
    • entityData

      protected final SynchedEntityData entityData
    • DATA_SHARED_FLAGS_ID

      protected static final EntityDataAccessor<Byte> DATA_SHARED_FLAGS_ID
    • FLAG_ONFIRE

      protected static final int FLAG_ONFIRE
      See Also:
    • FLAG_SHIFT_KEY_DOWN

      private static final int FLAG_SHIFT_KEY_DOWN
      See Also:
    • FLAG_SPRINTING

      private static final int FLAG_SPRINTING
      See Also:
    • FLAG_SWIMMING

      private static final int FLAG_SWIMMING
      See Also:
    • FLAG_INVISIBLE

      private static final int FLAG_INVISIBLE
      See Also:
    • FLAG_GLOWING

      protected static final int FLAG_GLOWING
      See Also:
    • FLAG_FALL_FLYING

      protected static final int FLAG_FALL_FLYING
      See Also:
    • DATA_AIR_SUPPLY_ID

      private static final EntityDataAccessor<Integer> DATA_AIR_SUPPLY_ID
    • DATA_CUSTOM_NAME

      private static final EntityDataAccessor<Optional<Component>> DATA_CUSTOM_NAME
    • DATA_CUSTOM_NAME_VISIBLE

      private static final EntityDataAccessor<Boolean> DATA_CUSTOM_NAME_VISIBLE
    • DATA_SILENT

      private static final EntityDataAccessor<Boolean> DATA_SILENT
    • DATA_NO_GRAVITY

      private static final EntityDataAccessor<Boolean> DATA_NO_GRAVITY
    • DATA_POSE

      protected static final EntityDataAccessor<Pose> DATA_POSE
    • DATA_TICKS_FROZEN

      private static final EntityDataAccessor<Integer> DATA_TICKS_FROZEN
    • levelCallback

      private EntityInLevelCallback levelCallback
    • packetPositionCodec

      private final VecDeltaCodec packetPositionCodec
    • noCulling

      public boolean noCulling
    • hasImpulse

      public boolean hasImpulse
    • portalCooldown

      private int portalCooldown
    • isInsidePortal

      protected boolean isInsidePortal
    • portalTime

      protected int portalTime
    • portalEntrancePos

      protected BlockPos portalEntrancePos
    • invulnerable

      private boolean invulnerable
    • uuid

      protected UUID uuid
    • stringUUID

      protected String stringUUID
    • hasGlowingTag

      private boolean hasGlowingTag
    • tags

      private final Set<String> tags
    • pistonDeltas

      private final double[] pistonDeltas
    • pistonDeltasGameTime

      private long pistonDeltasGameTime
    • dimensions

      private EntityDimensions dimensions
    • eyeHeight

      private float eyeHeight
    • isInPowderSnow

      public boolean isInPowderSnow
    • wasInPowderSnow

      public boolean wasInPowderSnow
    • wasOnFire

      public boolean wasOnFire
    • crystalSoundIntensity

      private float crystalSoundIntensity
    • lastCrystalSoundPlayTick

      private int lastCrystalSoundPlayTick
    • hasVisualFire

      private boolean hasVisualFire
    • feetBlockState

      @Nullable private BlockState feetBlockState
    • canUpdate

      private boolean canUpdate
    • captureDrops

      private Collection<ItemEntity> captureDrops
    • persistentData

      private CompoundTag persistentData
    • isAddedToWorld

      private boolean isAddedToWorld
      Internal use for keeping track of entities that are tracked by a world, to allow guarantees that entity position changes will force a chunk load, avoiding potential issues with entity desyncing and bad chunk data.
    • forgeFluidTypeHeight

      protected it.unimi.dsi.fastutil.objects.Object2DoubleMap<FluidType> forgeFluidTypeHeight
    • forgeFluidTypeOnEyes

      private FluidType forgeFluidTypeOnEyes
  • Constructor Details

  • Method Details

    • isColliding

      public boolean isColliding(BlockPos p_20040_, BlockState p_20041_)
    • getTeamColor

      public int getTeamColor()
    • isSpectator

      public boolean isSpectator()
    • unRide

      public final void unRide()
    • syncPacketPositionCodec

      public void syncPacketPositionCodec(double p_217007_, double p_217008_, double p_217009_)
    • getPositionCodec

      public VecDeltaCodec getPositionCodec()
    • getType

      public EntityType<?> getType()
    • getId

      public int getId()
      Specified by:
      getId in interface EntityAccess
    • setId

      public void setId(int p_20235_)
    • getTags

      public Set<String> getTags()
    • addTag

      public boolean addTag(String p_20050_)
    • removeTag

      public boolean removeTag(String p_20138_)
    • kill

      public void kill()
    • discard

      public final void discard()
    • defineSynchedData

      protected abstract void defineSynchedData()
    • getEntityData

      public SynchedEntityData getEntityData()
    • equals

      public boolean equals(Object p_20245_)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • remove

      public void remove(Entity.RemovalReason p_146834_)
    • onClientRemoval

      public void onClientRemoval()
    • setPose

      public void setPose(Pose p_20125_)
    • getPose

      public Pose getPose()
    • hasPose

      public boolean hasPose(Pose p_217004_)
    • closerThan

      public boolean closerThan(Entity p_19951_, double p_19952_)
    • closerThan

      public boolean closerThan(Entity p_216993_, double p_216994_, double p_216995_)
    • setRot

      protected void setRot(float p_19916_, float p_19917_)
    • setPos

      public final void setPos(Vec3 p_146885_)
    • setPos

      public void setPos(double p_20210_, double p_20211_, double p_20212_)
    • makeBoundingBox

      protected AABB makeBoundingBox()
    • reapplyPosition

      protected void reapplyPosition()
    • turn

      public void turn(double p_19885_, double p_19886_)
    • tick

      public void tick()
    • baseTick

      public void baseTick()
    • setSharedFlagOnFire

      public void setSharedFlagOnFire(boolean p_146869_)
    • checkOutOfWorld

      public void checkOutOfWorld()
    • setPortalCooldown

      public void setPortalCooldown()
    • isOnPortalCooldown

      public boolean isOnPortalCooldown()
    • processPortalCooldown

      protected void processPortalCooldown()
    • getPortalWaitTime

      public int getPortalWaitTime()
    • lavaHurt

      public void lavaHurt()
    • setSecondsOnFire

      public void setSecondsOnFire(int p_20255_)
    • setRemainingFireTicks

      public void setRemainingFireTicks(int p_20269_)
    • getRemainingFireTicks

      public int getRemainingFireTicks()
    • clearFire

      public void clearFire()
    • outOfWorld

      protected void outOfWorld()
    • isFree

      public boolean isFree(double p_20230_, double p_20231_, double p_20232_)
    • isFree

      private boolean isFree(AABB p_20132_)
    • setOnGround

      public void setOnGround(boolean p_20181_)
    • isOnGround

      public boolean isOnGround()
    • move

      public void move(MoverType p_19973_, Vec3 p_19974_)
    • isHorizontalCollisionMinor

      protected boolean isHorizontalCollisionMinor(Vec3 p_196625_)
    • tryCheckInsideBlocks

      protected void tryCheckInsideBlocks()
    • playEntityOnFireExtinguishedSound

      protected void playEntityOnFireExtinguishedSound()
    • extinguishFire

      public void extinguishFire()
    • processFlappingMovement

      protected void processFlappingMovement()
    • getOnPosLegacy

      @Deprecated public BlockPos getOnPosLegacy()
      Deprecated.
    • getOnPos

      public BlockPos getOnPos()
    • getOnPos

      private BlockPos getOnPos(float p_216987_)
    • getBlockJumpFactor

      protected float getBlockJumpFactor()
    • getBlockSpeedFactor

      protected float getBlockSpeedFactor()
    • getBlockPosBelowThatAffectsMyMovement

      protected BlockPos getBlockPosBelowThatAffectsMyMovement()
    • maybeBackOffFromEdge

      protected Vec3 maybeBackOffFromEdge(Vec3 p_20019_, MoverType p_20020_)
    • limitPistonMovement

      protected Vec3 limitPistonMovement(Vec3 p_20134_)
    • applyPistonMovementRestriction

      private double applyPistonMovementRestriction(Direction.Axis p_20043_, double p_20044_)
    • collide

      private Vec3 collide(Vec3 p_20273_)
    • collideBoundingBox

      public static Vec3 collideBoundingBox(@Nullable Entity p_198895_, Vec3 p_198896_, AABB p_198897_, Level p_198898_, List<VoxelShape> p_198899_)
    • collideWithShapes

      private static Vec3 collideWithShapes(Vec3 p_198901_, AABB p_198902_, List<VoxelShape> p_198903_)
    • nextStep

      protected float nextStep()
    • getSwimSound

      protected SoundEvent getSwimSound()
    • getSwimSplashSound

      protected SoundEvent getSwimSplashSound()
    • getSwimHighSpeedSplashSound

      protected SoundEvent getSwimHighSpeedSplashSound()
    • checkInsideBlocks

      protected void checkInsideBlocks()
    • onInsideBlock

      protected void onInsideBlock(BlockState p_20005_)
    • gameEvent

      public void gameEvent(GameEvent p_146853_, @Nullable Entity p_146854_)
    • gameEvent

      public void gameEvent(GameEvent p_146851_)
    • playStepSound

      protected void playStepSound(BlockPos p_20135_, BlockState p_20136_)
    • playAmethystStepSound

      private void playAmethystStepSound(BlockState p_146883_)
    • playSwimSound

      protected void playSwimSound(float p_20213_)
    • onFlap

      protected void onFlap()
    • isFlapping

      protected boolean isFlapping()
    • playSound

      public void playSound(SoundEvent p_19938_, float p_19939_, float p_19940_)
    • playSound

      public void playSound(SoundEvent p_216991_)
    • isSilent

      public boolean isSilent()
    • setSilent

      public void setSilent(boolean p_20226_)
    • isNoGravity

      public boolean isNoGravity()
    • setNoGravity

      public void setNoGravity(boolean p_20243_)
    • getMovementEmission

      protected Entity.MovementEmission getMovementEmission()
    • dampensVibrations

      public boolean dampensVibrations()
    • checkFallDamage

      protected void checkFallDamage(double p_19911_, boolean p_19912_, BlockState p_19913_, BlockPos p_19914_)
    • fireImmune

      public boolean fireImmune()
    • causeFallDamage

      public boolean causeFallDamage(float p_146828_, float p_146829_, DamageSource p_146830_)
    • isInWater

      public boolean isInWater()
    • isInRain

      private boolean isInRain()
    • isInBubbleColumn

      private boolean isInBubbleColumn()
    • isInWaterOrRain

      public boolean isInWaterOrRain()
    • isInWaterRainOrBubble

      public boolean isInWaterRainOrBubble()
    • isInWaterOrBubble

      public boolean isInWaterOrBubble()
    • isUnderWater

      public boolean isUnderWater()
    • updateSwimming

      public void updateSwimming()
    • updateInWaterStateAndDoFluidPushing

      protected boolean updateInWaterStateAndDoFluidPushing()
    • updateInWaterStateAndDoWaterCurrentPushing

      void updateInWaterStateAndDoWaterCurrentPushing()
    • updateFluidOnEyes

      private void updateFluidOnEyes()
    • doWaterSplashEffect

      protected void doWaterSplashEffect()
    • getBlockStateOnLegacy

      @Deprecated protected BlockState getBlockStateOnLegacy()
      Deprecated.
    • getBlockStateOn

      public BlockState getBlockStateOn()
    • canSpawnSprintParticle

      public boolean canSpawnSprintParticle()
    • spawnSprintParticle

      protected void spawnSprintParticle()
    • isEyeInFluid

      @Deprecated public boolean isEyeInFluid(TagKey<Fluid> p_204030_)
      Deprecated.
    • isInLava

      public boolean isInLava()
    • moveRelative

      public void moveRelative(float p_19921_, Vec3 p_19922_)
    • getInputVector

      private static Vec3 getInputVector(Vec3 p_20016_, float p_20017_, float p_20018_)
    • getLightLevelDependentMagicValue

      @Deprecated public float getLightLevelDependentMagicValue()
      Deprecated.
    • absMoveTo

      public void absMoveTo(double p_19891_, double p_19892_, double p_19893_, float p_19894_, float p_19895_)
    • absMoveTo

      public void absMoveTo(double p_20249_, double p_20250_, double p_20251_)
    • moveTo

      public void moveTo(Vec3 p_20220_)
    • moveTo

      public void moveTo(double p_20105_, double p_20106_, double p_20107_)
    • moveTo

      public void moveTo(BlockPos p_20036_, float p_20037_, float p_20038_)
    • moveTo

      public void moveTo(double p_20108_, double p_20109_, double p_20110_, float p_20111_, float p_20112_)
    • setOldPosAndRot

      public final void setOldPosAndRot()
    • distanceTo

      public float distanceTo(Entity p_20271_)
    • distanceToSqr

      public double distanceToSqr(double p_20276_, double p_20277_, double p_20278_)
    • distanceToSqr

      public double distanceToSqr(Entity p_20281_)
    • distanceToSqr

      public double distanceToSqr(Vec3 p_20239_)
    • playerTouch

      public void playerTouch(Player p_20081_)
    • push

      public void push(Entity p_20293_)
    • push

      public void push(double p_20286_, double p_20287_, double p_20288_)
    • markHurt

      protected void markHurt()
    • hurt

      public boolean hurt(DamageSource p_19946_, float p_19947_)
    • getViewVector

      public final Vec3 getViewVector(float p_20253_)
    • getViewXRot

      public float getViewXRot(float p_20268_)
    • getViewYRot

      public float getViewYRot(float p_20279_)
    • calculateViewVector

      protected final Vec3 calculateViewVector(float p_20172_, float p_20173_)
    • getUpVector

      public final Vec3 getUpVector(float p_20290_)
    • calculateUpVector

      protected final Vec3 calculateUpVector(float p_20215_, float p_20216_)
    • getEyePosition

      public final Vec3 getEyePosition()
    • getEyePosition

      public final Vec3 getEyePosition(float p_20300_)
    • getLightProbePosition

      public Vec3 getLightProbePosition(float p_20309_)
    • getPosition

      public final Vec3 getPosition(float p_20319_)
    • pick

      public HitResult pick(double p_19908_, float p_19909_, boolean p_19910_)
    • canBeHitByProjectile

      public boolean canBeHitByProjectile()
    • isPickable

      public boolean isPickable()
    • isPushable

      public boolean isPushable()
    • awardKillScore

      public void awardKillScore(Entity p_19953_, int p_19954_, DamageSource p_19955_)
    • shouldRender

      public boolean shouldRender(double p_20296_, double p_20297_, double p_20298_)
    • shouldRenderAtSqrDistance

      public boolean shouldRenderAtSqrDistance(double p_19883_)
    • saveAsPassenger

      public boolean saveAsPassenger(CompoundTag p_20087_)
    • save

      public boolean save(CompoundTag p_20224_)
    • saveWithoutId

      public CompoundTag saveWithoutId(CompoundTag p_20241_)
    • load

      public void load(CompoundTag p_20259_)
    • repositionEntityAfterLoad

      protected boolean repositionEntityAfterLoad()
    • getEncodeId

      @Nullable public final String getEncodeId()
    • readAdditionalSaveData

      protected abstract void readAdditionalSaveData(CompoundTag p_20052_)
    • addAdditionalSaveData

      protected abstract void addAdditionalSaveData(CompoundTag p_20139_)
    • newDoubleList

      protected ListTag newDoubleList(double... p_20064_)
    • newFloatList

      protected ListTag newFloatList(float... p_20066_)
    • spawnAtLocation

      @Nullable public ItemEntity spawnAtLocation(ItemLike p_19999_)
    • spawnAtLocation

      @Nullable public ItemEntity spawnAtLocation(ItemLike p_20001_, int p_20002_)
    • spawnAtLocation

      @Nullable public ItemEntity spawnAtLocation(ItemStack p_19984_)
    • spawnAtLocation

      @Nullable public ItemEntity spawnAtLocation(ItemStack p_19985_, float p_19986_)
    • isAlive

      public boolean isAlive()
    • isInWall

      public boolean isInWall()
    • interact

      public InteractionResult interact(Player p_19978_, InteractionHand p_19979_)
    • canCollideWith

      public boolean canCollideWith(Entity p_20303_)
    • canBeCollidedWith

      public boolean canBeCollidedWith()
    • rideTick

      public void rideTick()
    • positionRider

      public void positionRider(Entity p_20312_)
    • positionRider

      private void positionRider(Entity p_19957_, Entity.MoveFunction p_19958_)
    • onPassengerTurned

      public void onPassengerTurned(Entity p_20320_)
    • getMyRidingOffset

      public double getMyRidingOffset()
    • getPassengersRidingOffset

      public double getPassengersRidingOffset()
    • startRiding

      public boolean startRiding(Entity p_20330_)
    • showVehicleHealth

      public boolean showVehicleHealth()
    • startRiding

      public boolean startRiding(Entity p_19966_, boolean p_19967_)
    • canRide

      protected boolean canRide(Entity p_20339_)
    • canEnterPose

      protected boolean canEnterPose(Pose p_20176_)
    • ejectPassengers

      public void ejectPassengers()
    • removeVehicle

      public void removeVehicle()
    • stopRiding

      public void stopRiding()
    • addPassenger

      protected void addPassenger(Entity p_20349_)
    • removePassenger

      protected void removePassenger(Entity p_20352_)
    • canAddPassenger

      protected boolean canAddPassenger(Entity p_20354_)
    • couldAcceptPassenger

      @Deprecated protected boolean couldAcceptPassenger()
      Deprecated.
    • lerpTo

      public void lerpTo(double p_19896_, double p_19897_, double p_19898_, float p_19899_, float p_19900_, int p_19901_, boolean p_19902_)
    • lerpHeadTo

      public void lerpHeadTo(float p_19918_, int p_19919_)
    • getPickRadius

      public float getPickRadius()
    • getLookAngle

      public Vec3 getLookAngle()
    • getHandHoldingItemAngle

      public Vec3 getHandHoldingItemAngle(Item p_204035_)
    • getRotationVector

      public Vec2 getRotationVector()
    • getForward

      public Vec3 getForward()
    • handleInsidePortal

      public void handleInsidePortal(BlockPos p_20222_)
    • handleNetherPortal

      protected void handleNetherPortal()
    • getDimensionChangingDelay

      public int getDimensionChangingDelay()
    • lerpMotion

      public void lerpMotion(double p_20306_, double p_20307_, double p_20308_)
    • handleDamageEvent

      public void handleDamageEvent(DamageSource p_270704_)
    • handleEntityEvent

      public void handleEntityEvent(byte p_19882_)
    • animateHurt

      public void animateHurt(float p_265161_)
    • getHandSlots

      public Iterable<ItemStack> getHandSlots()
    • getArmorSlots

      public Iterable<ItemStack> getArmorSlots()
    • getAllSlots

      public Iterable<ItemStack> getAllSlots()
    • setItemSlot

      public void setItemSlot(EquipmentSlot p_19968_, ItemStack p_19969_)
    • isOnFire

      public boolean isOnFire()
    • isPassenger

      public boolean isPassenger()
    • isVehicle

      public boolean isVehicle()
    • dismountsUnderwater

      public boolean dismountsUnderwater()
    • setShiftKeyDown

      public void setShiftKeyDown(boolean p_20261_)
    • isShiftKeyDown

      public boolean isShiftKeyDown()
    • isSteppingCarefully

      public boolean isSteppingCarefully()
    • isSuppressingBounce

      public boolean isSuppressingBounce()
    • isDiscrete

      public boolean isDiscrete()
    • isDescending

      public boolean isDescending()
    • isCrouching

      public boolean isCrouching()
    • isSprinting

      public boolean isSprinting()
    • setSprinting

      public void setSprinting(boolean p_20274_)
    • isSwimming

      public boolean isSwimming()
    • isVisuallySwimming

      public boolean isVisuallySwimming()
    • isVisuallyCrawling

      public boolean isVisuallyCrawling()
    • setSwimming

      public void setSwimming(boolean p_20283_)
    • hasGlowingTag

      public final boolean hasGlowingTag()
    • setGlowingTag

      public final void setGlowingTag(boolean p_146916_)
    • isCurrentlyGlowing

      public boolean isCurrentlyGlowing()
    • isInvisible

      public boolean isInvisible()
    • isInvisibleTo

      public boolean isInvisibleTo(Player p_20178_)
    • updateDynamicGameEventListener

      public void updateDynamicGameEventListener(BiConsumer<DynamicGameEventListener<?>,ServerLevel> p_216996_)
    • getTeam

      @Nullable public Team getTeam()
    • isAlliedTo

      public boolean isAlliedTo(Entity p_20355_)
    • isAlliedTo

      public boolean isAlliedTo(Team p_20032_)
    • setInvisible

      public void setInvisible(boolean p_20304_)
    • getSharedFlag

      protected boolean getSharedFlag(int p_20292_)
    • setSharedFlag

      protected void setSharedFlag(int p_20116_, boolean p_20117_)
    • getMaxAirSupply

      public int getMaxAirSupply()
    • getAirSupply

      public int getAirSupply()
    • setAirSupply

      public void setAirSupply(int p_20302_)
    • getTicksFrozen

      public int getTicksFrozen()
    • setTicksFrozen

      public void setTicksFrozen(int p_146918_)
    • getPercentFrozen

      public float getPercentFrozen()
    • isFullyFrozen

      public boolean isFullyFrozen()
    • getTicksRequiredToFreeze

      public int getTicksRequiredToFreeze()
    • thunderHit

      public void thunderHit(ServerLevel p_19927_, LightningBolt p_19928_)
    • onAboveBubbleCol

      public void onAboveBubbleCol(boolean p_20313_)
    • onInsideBubbleColumn

      public void onInsideBubbleColumn(boolean p_20322_)
    • wasKilled

      public boolean wasKilled(ServerLevel p_216988_, LivingEntity p_216989_)
    • checkSlowFallDistance

      public void checkSlowFallDistance()
    • resetFallDistance

      public void resetFallDistance()
    • moveTowardsClosestSpace

      protected void moveTowardsClosestSpace(double p_20315_, double p_20316_, double p_20317_)
    • makeStuckInBlock

      public void makeStuckInBlock(BlockState p_20006_, Vec3 p_20007_)
    • removeAction

      private static Component removeAction(Component p_20141_)
    • getName

      public Component getName()
      Specified by:
      getName in interface Nameable
    • getTypeName

      protected Component getTypeName()
    • is

      public boolean is(Entity p_20356_)
    • getYHeadRot

      public float getYHeadRot()
    • setYHeadRot

      public void setYHeadRot(float p_20328_)
    • setYBodyRot

      public void setYBodyRot(float p_20338_)
    • isAttackable

      public boolean isAttackable()
    • skipAttackInteraction

      public boolean skipAttackInteraction(Entity p_20357_)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isInvulnerableTo

      public boolean isInvulnerableTo(DamageSource p_20122_)
    • isInvulnerable

      public boolean isInvulnerable()
    • setInvulnerable

      public void setInvulnerable(boolean p_20332_)
    • copyPosition

      public void copyPosition(Entity p_20360_)
    • restoreFrom

      public void restoreFrom(Entity p_20362_)
    • changeDimension

      @Nullable public Entity changeDimension(ServerLevel p_20118_)
    • changeDimension

      @Nullable public Entity changeDimension(ServerLevel p_20118_, ITeleporter teleporter)
    • removeAfterChangingDimensions

      protected void removeAfterChangingDimensions()
    • findDimensionEntryPoint

      @Nullable protected PortalInfo findDimensionEntryPoint(ServerLevel p_19923_)
    • getRelativePortalPosition

      protected Vec3 getRelativePortalPosition(Direction.Axis p_20045_, BlockUtil.FoundRectangle p_20046_)
    • getExitPortal

      protected Optional<BlockUtil.FoundRectangle> getExitPortal(ServerLevel p_185935_, BlockPos p_185936_, boolean p_185937_, WorldBorder p_185938_)
    • canChangeDimensions

      public boolean canChangeDimensions()
    • getBlockExplosionResistance

      public float getBlockExplosionResistance(Explosion p_19992_, BlockGetter p_19993_, BlockPos p_19994_, BlockState p_19995_, FluidState p_19996_, float p_19997_)
    • shouldBlockExplode

      public boolean shouldBlockExplode(Explosion p_19987_, BlockGetter p_19988_, BlockPos p_19989_, BlockState p_19990_, float p_19991_)
    • getMaxFallDistance

      public int getMaxFallDistance()
    • isIgnoringBlockTriggers

      public boolean isIgnoringBlockTriggers()
    • fillCrashReportCategory

      public void fillCrashReportCategory(CrashReportCategory p_20051_)
    • displayFireAnimation

      public boolean displayFireAnimation()
    • setUUID

      public void setUUID(UUID p_20085_)
    • getUUID

      public UUID getUUID()
      Specified by:
      getUUID in interface EntityAccess
    • getStringUUID

      public String getStringUUID()
    • getScoreboardName

      public String getScoreboardName()
    • isPushedByFluid

      @Deprecated public boolean isPushedByFluid()
      Deprecated.
    • getViewScale

      public static double getViewScale()
    • setViewScale

      public static void setViewScale(double p_20104_)
    • getDisplayName

      public Component getDisplayName()
      Specified by:
      getDisplayName in interface Nameable
    • setCustomName

      public void setCustomName(@Nullable Component p_20053_)
    • getCustomName

      @Nullable public Component getCustomName()
      Specified by:
      getCustomName in interface Nameable
    • hasCustomName

      public boolean hasCustomName()
      Specified by:
      hasCustomName in interface Nameable
    • setCustomNameVisible

      public void setCustomNameVisible(boolean p_20341_)
    • isCustomNameVisible

      public boolean isCustomNameVisible()
    • teleportToWithTicket

      public final void teleportToWithTicket(double p_20325_, double p_20326_, double p_20327_)
    • teleportTo

      public boolean teleportTo(ServerLevel p_265257_, double p_265407_, double p_265727_, double p_265410_, Set<RelativeMovement> p_265083_, float p_265573_, float p_265094_)
    • dismountTo

      public void dismountTo(double p_146825_, double p_146826_, double p_146827_)
    • teleportTo

      public void teleportTo(double p_19887_, double p_19888_, double p_19889_)
    • teleportRelative

      public void teleportRelative(double p_249341_, double p_252229_, double p_252038_)
    • shouldShowName

      public boolean shouldShowName()
    • onSyncedDataUpdated

      public void onSyncedDataUpdated(List<SynchedEntityData.DataValue<?>> p_270372_)
    • onSyncedDataUpdated

      public void onSyncedDataUpdated(EntityDataAccessor<?> p_20059_)
    • fixupDimensions

      @Deprecated protected void fixupDimensions()
      Deprecated.
    • refreshDimensions

      public void refreshDimensions()
    • getDirection

      public Direction getDirection()
    • getMotionDirection

      public Direction getMotionDirection()
    • createHoverEvent

      protected HoverEvent createHoverEvent()
    • broadcastToPlayer

      public boolean broadcastToPlayer(ServerPlayer p_19937_)
    • getBoundingBox

      public final AABB getBoundingBox()
      Specified by:
      getBoundingBox in interface EntityAccess
    • getBoundingBoxForCulling

      public AABB getBoundingBoxForCulling()
    • getBoundingBoxForPose

      protected AABB getBoundingBoxForPose(Pose p_20218_)
    • setBoundingBox

      public final void setBoundingBox(AABB p_20012_)
    • getEyeHeight

      protected float getEyeHeight(Pose p_19976_, EntityDimensions p_19977_)
    • getEyeHeight

      public float getEyeHeight(Pose p_20237_)
    • getEyeHeight

      public final float getEyeHeight()
    • getLeashOffset

      public Vec3 getLeashOffset(float p_249286_)
    • getLeashOffset

      protected Vec3 getLeashOffset()
    • getSlot

      public SlotAccess getSlot(int p_146919_)
    • sendSystemMessage

      public void sendSystemMessage(Component p_216998_)
      Specified by:
      sendSystemMessage in interface CommandSource
    • getCommandSenderWorld

      public Level getCommandSenderWorld()
    • getServer

      @Nullable public MinecraftServer getServer()
    • interactAt

      public InteractionResult interactAt(Player p_19980_, Vec3 p_19981_, InteractionHand p_19982_)
    • ignoreExplosion

      public boolean ignoreExplosion()
    • doEnchantDamageEffects

      public void doEnchantDamageEffects(LivingEntity p_19971_, Entity p_19972_)
    • startSeenByPlayer

      public void startSeenByPlayer(ServerPlayer p_20119_)
    • stopSeenByPlayer

      public void stopSeenByPlayer(ServerPlayer p_20174_)
    • rotate

      public float rotate(Rotation p_20004_)
    • mirror

      public float mirror(Mirror p_20003_)
    • onlyOpCanSetNbt

      public boolean onlyOpCanSetNbt()
    • getControllingPassenger

      @Nullable public LivingEntity getControllingPassenger()
    • hasControllingPassenger

      public final boolean hasControllingPassenger()
    • getPassengers

      public final List<Entity> getPassengers()
    • getFirstPassenger

      @Nullable public Entity getFirstPassenger()
    • hasPassenger

      public boolean hasPassenger(Entity p_20364_)
    • hasPassenger

      public boolean hasPassenger(Predicate<Entity> p_146863_)
    • getIndirectPassengersStream

      private Stream<Entity> getIndirectPassengersStream()
    • getSelfAndPassengers

      public Stream<Entity> getSelfAndPassengers()
      Specified by:
      getSelfAndPassengers in interface EntityAccess
    • getPassengersAndSelf

      public Stream<Entity> getPassengersAndSelf()
      Specified by:
      getPassengersAndSelf in interface EntityAccess
    • getIndirectPassengers

      public Iterable<Entity> getIndirectPassengers()
    • hasExactlyOnePlayerPassenger

      public boolean hasExactlyOnePlayerPassenger()
    • getRootVehicle

      public Entity getRootVehicle()
    • isPassengerOfSameVehicle

      public boolean isPassengerOfSameVehicle(Entity p_20366_)
    • hasIndirectPassenger

      public boolean hasIndirectPassenger(Entity p_20368_)
    • isControlledByLocalInstance

      public boolean isControlledByLocalInstance()
    • isEffectiveAi

      public boolean isEffectiveAi()
    • getCollisionHorizontalEscapeVector

      protected static Vec3 getCollisionHorizontalEscapeVector(double p_19904_, double p_19905_, float p_19906_)
    • getDismountLocationForPassenger

      public Vec3 getDismountLocationForPassenger(LivingEntity p_20123_)
    • getVehicle

      @Nullable public Entity getVehicle()
    • getControlledVehicle

      @Nullable public Entity getControlledVehicle()
    • getPistonPushReaction

      public PushReaction getPistonPushReaction()
    • getSoundSource

      public SoundSource getSoundSource()
    • getFireImmuneTicks

      protected int getFireImmuneTicks()
    • createCommandSourceStack

      public CommandSourceStack createCommandSourceStack()
    • getPermissionLevel

      protected int getPermissionLevel()
    • hasPermissions

      public boolean hasPermissions(int p_20311_)
    • acceptsSuccess

      public boolean acceptsSuccess()
      Specified by:
      acceptsSuccess in interface CommandSource
    • acceptsFailure

      public boolean acceptsFailure()
      Specified by:
      acceptsFailure in interface CommandSource
    • shouldInformAdmins

      public boolean shouldInformAdmins()
      Specified by:
      shouldInformAdmins in interface CommandSource
    • lookAt

      public void lookAt(EntityAnchorArgument.Anchor p_20033_, Vec3 p_20034_)
    • updateFluidHeightAndDoFluidPushing

      @Deprecated public boolean updateFluidHeightAndDoFluidPushing(TagKey<Fluid> p_204032_, double p_204033_)
      Deprecated.
    • updateFluidHeightAndDoFluidPushing

      @Deprecated(forRemoval=true, since="1.19.4") public void updateFluidHeightAndDoFluidPushing()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • updateFluidHeightAndDoFluidPushing

      public void updateFluidHeightAndDoFluidPushing(Predicate<FluidState> shouldUpdate)
    • touchingUnloadedChunk

      public boolean touchingUnloadedChunk()
    • getFluidHeight

      @Deprecated public double getFluidHeight(TagKey<Fluid> p_204037_)
      Deprecated.
    • getFluidJumpThreshold

      public double getFluidJumpThreshold()
    • getBbWidth

      public final float getBbWidth()
    • getBbHeight

      public final float getBbHeight()
    • getAddEntityPacket

      public Packet<ClientGamePacketListener> getAddEntityPacket()
    • getDimensions

      public EntityDimensions getDimensions(Pose p_19975_)
    • position

      public Vec3 position()
    • trackingPosition

      public Vec3 trackingPosition()
    • blockPosition

      public BlockPos blockPosition()
      Specified by:
      blockPosition in interface EntityAccess
    • getFeetBlockState

      public BlockState getFeetBlockState()
    • chunkPosition

      public ChunkPos chunkPosition()
    • getDeltaMovement

      public Vec3 getDeltaMovement()
    • setDeltaMovement

      public void setDeltaMovement(Vec3 p_20257_)
    • addDeltaMovement

      public void addDeltaMovement(Vec3 p_250128_)
    • setDeltaMovement

      public void setDeltaMovement(double p_20335_, double p_20336_, double p_20337_)
    • getBlockX

      public final int getBlockX()
    • getX

      public final double getX()
    • getX

      public double getX(double p_20166_)
    • getRandomX

      public double getRandomX(double p_20209_)
    • getBlockY

      public final int getBlockY()
    • getY

      public final double getY()
    • getY

      public double getY(double p_20228_)
    • getRandomY

      public double getRandomY()
    • getEyeY

      public double getEyeY()
    • getBlockZ

      public final int getBlockZ()
    • getZ

      public final double getZ()
    • getZ

      public double getZ(double p_20247_)
    • getRandomZ

      public double getRandomZ(double p_20263_)
    • setPosRaw

      public final void setPosRaw(double p_20344_, double p_20345_, double p_20346_)
    • checkDespawn

      public void checkDespawn()
    • getRopeHoldPosition

      public Vec3 getRopeHoldPosition(float p_20347_)
    • recreateFromPacket

      public void recreateFromPacket(ClientboundAddEntityPacket p_146866_)
    • getPickResult

      @Nullable public ItemStack getPickResult()
    • setIsInPowderSnow

      public void setIsInPowderSnow(boolean p_146925_)
    • canFreeze

      public boolean canFreeze()
    • isFreezing

      public boolean isFreezing()
    • getYRot

      public float getYRot()
    • getVisualRotationYInDegrees

      public float getVisualRotationYInDegrees()
    • setYRot

      public void setYRot(float p_146923_)
    • getXRot

      public float getXRot()
    • setXRot

      public void setXRot(float p_146927_)
    • canSprint

      public boolean canSprint()
    • maxUpStep

      public float maxUpStep()
    • setMaxUpStep

      public void setMaxUpStep(float p_275672_)
    • isRemoved

      public final boolean isRemoved()
    • getRemovalReason

      @Nullable public Entity.RemovalReason getRemovalReason()
    • setRemoved

      public final void setRemoved(Entity.RemovalReason p_146876_)
      Specified by:
      setRemoved in interface EntityAccess
    • unsetRemoved

      protected void unsetRemoved()
    • setLevelCallback

      public void setLevelCallback(EntityInLevelCallback p_146849_)
      Specified by:
      setLevelCallback in interface EntityAccess
    • shouldBeSaved

      public boolean shouldBeSaved()
      Specified by:
      shouldBeSaved in interface EntityAccess
    • isAlwaysTicking

      public boolean isAlwaysTicking()
      Specified by:
      isAlwaysTicking in interface EntityAccess
    • mayInteract

      public boolean mayInteract(Level p_146843_, BlockPos p_146844_)
    • canUpdate

      public void canUpdate(boolean value)
      Specified by:
      canUpdate in interface IForgeEntity
    • canUpdate

      public boolean canUpdate()
      Specified by:
      canUpdate in interface IForgeEntity
    • captureDrops

      public Collection<ItemEntity> captureDrops()
      Specified by:
      captureDrops in interface IForgeEntity
    • captureDrops

      public Collection<ItemEntity> captureDrops(Collection<ItemEntity> value)
      Specified by:
      captureDrops in interface IForgeEntity
    • getPersistentData

      public CompoundTag getPersistentData()
      Description copied from interface: IForgeEntity
      Returns a NBTTagCompound that can be used to store custom data for this entity. It will be written, and read from disc, so it persists over world saves.
      Specified by:
      getPersistentData in interface IForgeEntity
      Returns:
      A NBTTagCompound
    • canTrample

      public boolean canTrample(BlockState state, BlockPos pos, float fallDistance)
      Description copied from interface: IForgeEntity
      Checks if this Entity can trample a Block.
      Specified by:
      canTrample in interface IForgeEntity
      pos - The block pos
      fallDistance - The fall distance
      Returns:
      true if this entity can trample, false otherwise
    • isAddedToWorld

      public final boolean isAddedToWorld()
      Description copied from interface: IForgeEntity
      Gets whether this entity has been added to a world (for tracking). Specifically between the times when an entity is added to a world and the entity being removed from the world's tracked lists.
      Specified by:
      isAddedToWorld in interface IForgeEntity
      Returns:
      True if this entity is being tracked by a world
    • onAddedToWorld

      public void onAddedToWorld()
      Description copied from interface: IForgeEntity
      Called after the entity has been added to the world's ticking list. Can be overriden, but needs to call super to prevent MC-136995.
      Specified by:
      onAddedToWorld in interface IForgeEntity
    • onRemovedFromWorld

      public void onRemovedFromWorld()
      Description copied from interface: IForgeEntity
      Called after the entity has been removed to the world's ticking list. Can be overriden, but needs to call super to prevent MC-136995.
      Specified by:
      onRemovedFromWorld in interface IForgeEntity
    • revive

      public void revive()
      Description copied from interface: IForgeEntity
      Revives an entity that has been removed from a world. Used as replacement for entity.removed = true. Having it as a function allows the entity to react to being revived.
      Specified by:
      revive in interface IForgeEntity
    • getEyeHeightAccess

      public float getEyeHeightAccess(Pose pose, EntityDimensions size)
    • setFluidTypeHeight

      protected final void setFluidTypeHeight(FluidType type, double height)
    • getFluidTypeHeight

      public final double getFluidTypeHeight(FluidType type)
      Description copied from interface: IForgeEntity
      Returns the height of the fluid type in relation to the bounding box of the entity. If the entity is not in the fluid type, then 0 is returned.
      Specified by:
      getFluidTypeHeight in interface IForgeEntity
      Parameters:
      type - the type of the fluid
      Returns:
      the height of the fluid compared to the entity
    • isInFluidType

      public final boolean isInFluidType(BiPredicate<FluidType,Double> predicate, boolean forAllTypes)
      Description copied from interface: IForgeEntity
      Returns whether the fluid type the entity is currently in matches the specified condition.
      Specified by:
      isInFluidType in interface IForgeEntity
      Parameters:
      predicate - a test taking in the fluid type and its height
      forAllTypes - true if all fluid types should match the condition instead of at least one
      Returns:
      true if a fluid type meets the condition, false otherwise
    • isInFluidType

      public final boolean isInFluidType()
      Description copied from interface: IForgeEntity
      Returns whether the entity is in a fluid.
      Specified by:
      isInFluidType in interface IForgeEntity
      Returns:
      true if the entity is in a fluid, false otherwise
    • getEyeInFluidType

      public final FluidType getEyeInFluidType()
      Description copied from interface: IForgeEntity
      Returns the fluid that is on the entity's eyes.
      Specified by:
      getEyeInFluidType in interface IForgeEntity
      Returns:
      the fluid that is on the entity's eyes
    • getMaxHeightFluidType

      public FluidType getMaxHeightFluidType()
      Description copied from interface: IForgeEntity
      Returns the fluid type which is the highest on the bounding box of the entity.
      Specified by:
      getMaxHeightFluidType in interface IForgeEntity
      Returns:
      the fluid type which is the highest on the bounding box of the entity
    • getLevel

      public Level getLevel()
    • damageSources

      public DamageSources damageSources()