Class Entity

All Implemented Interfaces:
CommandSource, SyncedDataHolder, EntityAccess, Nameable, ScoreHolder, IAttachmentHolder, IEntityExtension, INBTSerializable<CompoundTag>
Direct Known Subclasses:
AreaEffectCloud, BlockAttachedEntity, Display, EndCrystal, EvokerFangs, ExperienceOrb, EyeOfEnder, FallingBlockEntity, Interaction, ItemEntity, LightningBolt, LivingEntity, Marker, OminousItemSpawner, PartEntity, PrimedTnt, Projectile, VehicleEntity

  • 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
    • CONTENTS_SLOT_INDEX

      public static final int CONTENTS_SLOT_INDEX
      See Also:
    • 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_0_2

      public static final float DELTA_AFFECTED_BY_BLOCKS_BELOW_0_2
      See Also:
    • DELTA_AFFECTED_BY_BLOCKS_BELOW_0_5

      public static final double DELTA_AFFECTED_BY_BLOCKS_BELOW_0_5
      See Also:
    • DELTA_AFFECTED_BY_BLOCKS_BELOW_1_0

      public static final double DELTA_AFFECTED_BY_BLOCKS_BELOW_1_0
      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:
    • BASE_SAFE_FALL_DISTANCE

      public static final int BASE_SAFE_FALL_DISTANCE
      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

      private 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

      private 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
    • 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
    • portalProcess

      @Nullable public PortalProcessor portalProcess
    • portalCooldown

      private int portalCooldown
    • 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
    • mainSupportingBlockPos

      public Optional<BlockPos> mainSupportingBlockPos
    • onGroundNoBlocks

      private boolean onGroundNoBlocks
    • crystalSoundIntensity

      private float crystalSoundIntensity
    • lastCrystalSoundPlayTick

      private int lastCrystalSoundPlayTick
    • hasVisualFire

      private boolean hasVisualFire
    • inBlockState

      @Nullable private BlockState inBlockState
    • captureDrops

      @Nullable private Collection<ItemEntity> captureDrops
      Neo: Short-lived holder of dropped item entities. Used mainly for Neo hooks and event logic.

      When not null, records all item entities from spawnAtLocation(ItemStack, float) and ServerPlayer.drop(ItemStack, boolean, boolean) instead of adding them to the world.

    • persistentData

      private CompoundTag persistentData
    • isAddedToLevel

      private boolean isAddedToLevel
      Neo: 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 pos, BlockState state)
    • getTeamColor

      public int getTeamColor()
    • isSpectator

      public boolean isSpectator()
    • unRide

      public final void unRide()
    • syncPacketPositionCodec

      public void syncPacketPositionCodec(double x, double y, double z)
    • getPositionCodec

      public VecDeltaCodec getPositionCodec()
    • getType

      public EntityType<?> getType()
    • getId

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

      public void setId(int id)
    • getTags

      public Set<String> getTags()
    • addTag

      public boolean addTag(String tag)
    • removeTag

      public boolean removeTag(String tag)
    • kill

      public void kill()
    • discard

      public final void discard()
    • defineSynchedData

      protected abstract void defineSynchedData(SynchedEntityData.Builder builder)
    • getEntityData

      public SynchedEntityData getEntityData()
    • equals

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

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

      public void remove(Entity.RemovalReason reason)
    • onClientRemoval

      public void onClientRemoval()
    • setPose

      public void setPose(Pose pose)
    • getPose

      public Pose getPose()
    • hasPose

      public boolean hasPose(Pose pose)
    • closerThan

      public boolean closerThan(Entity entity, double distance)
    • closerThan

      public boolean closerThan(Entity entity, double horizontalDistance, double verticalDistance)
    • setRot

      protected void setRot(float yRot, float xRot)
      Sets the rotation of the entity.
    • setPos

      public final void setPos(Vec3 pos)
    • setPos

      public void setPos(double x, double y, double z)
      Sets the x,y,z of the entity from the given parameters. Also seems to set up a bounding box.
    • makeBoundingBox

      protected AABB makeBoundingBox()
    • reapplyPosition

      protected void reapplyPosition()
    • turn

      public void turn(double yRot, double xRot)
    • tick

      public void tick()
    • baseTick

      public void baseTick()
    • setSharedFlagOnFire

      public void setSharedFlagOnFire(boolean isOnFire)
    • checkBelowWorld

      public void checkBelowWorld()
    • setPortalCooldown

      public void setPortalCooldown()
    • setPortalCooldown

      public void setPortalCooldown(int portalCooldown)
    • getPortalCooldown

      public int getPortalCooldown()
    • isOnPortalCooldown

      public boolean isOnPortalCooldown()
    • processPortalCooldown

      protected void processPortalCooldown()
    • lavaHurt

      public void lavaHurt()
    • igniteForSeconds

      public final void igniteForSeconds(float seconds)
    • igniteForTicks

      public void igniteForTicks(int ticks)
    • setRemainingFireTicks

      public void setRemainingFireTicks(int remainingFireTicks)
    • getRemainingFireTicks

      public int getRemainingFireTicks()
    • clearFire

      public void clearFire()
    • onBelowWorld

      protected void onBelowWorld()
    • isFree

      public boolean isFree(double x, double y, double z)
      Checks if the offset position from the entity's current position has a collision with a block or a liquid.
    • isFree

      private boolean isFree(AABB box)
      Determines if the entity has no collision with a block or a liquid within the specified bounding box.
    • setOnGround

      public void setOnGround(boolean onGround)
    • setOnGroundWithMovement

      public void setOnGroundWithMovement(boolean onGround, Vec3 movement)
    • isSupportedBy

      public boolean isSupportedBy(BlockPos pos)
    • checkSupportingBlock

      protected void checkSupportingBlock(boolean onGround, @Nullable Vec3 movement)
    • onGround

      public boolean onGround()
    • move

      public void move(MoverType type, Vec3 pos)
    • isStateClimbable

      private boolean isStateClimbable(BlockState state)
    • vibrationAndSoundEffectsFromBlock

      private boolean vibrationAndSoundEffectsFromBlock(BlockPos pos, BlockState state, boolean playStepSound, boolean broadcastGameEvent, Vec3 entityPos)
    • isHorizontalCollisionMinor

      protected boolean isHorizontalCollisionMinor(Vec3 deltaMovement)
    • tryCheckInsideBlocks

      protected void tryCheckInsideBlocks()
    • playEntityOnFireExtinguishedSound

      protected void playEntityOnFireExtinguishedSound()
    • extinguishFire

      public void extinguishFire()
    • processFlappingMovement

      protected void processFlappingMovement()
    • getOnPosLegacy

      @Deprecated public BlockPos getOnPosLegacy()
      Deprecated.
    • getBlockPosBelowThatAffectsMyMovement

      public BlockPos getBlockPosBelowThatAffectsMyMovement()
    • getOnPos

      public BlockPos getOnPos()
    • getOnPos

      protected BlockPos getOnPos(float yOffset)
    • getBlockJumpFactor

      protected float getBlockJumpFactor()
    • getBlockSpeedFactor

      protected float getBlockSpeedFactor()
    • maybeBackOffFromEdge

      protected Vec3 maybeBackOffFromEdge(Vec3 vec, MoverType mover)
    • limitPistonMovement

      protected Vec3 limitPistonMovement(Vec3 pos)
    • applyPistonMovementRestriction

      private double applyPistonMovementRestriction(Direction.Axis axis, double distance)
    • collide

      private Vec3 collide(Vec3 vec)
      Given a motion vector, return an updated vector that takes into account restrictions such as collisions (from all directions) and step-up from stepHeight
    • collectCandidateStepUpHeights

      private static float[] collectCandidateStepUpHeights(AABB box, List<VoxelShape> colliders, float deltaY, float maxUpStep)
    • collideBoundingBox

      public static Vec3 collideBoundingBox(@Nullable Entity entity, Vec3 vec, AABB collisionBox, Level level, List<VoxelShape> potentialHits)
    • collectColliders

      private static List<VoxelShape> collectColliders(@Nullable Entity entity, Level level, List<VoxelShape> collisions, AABB boundingBox)
    • collideWithShapes

      private static Vec3 collideWithShapes(Vec3 deltaMovement, AABB entityBB, List<VoxelShape> shapes)
    • 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 state)
    • adjustSpawnLocation

      public BlockPos adjustSpawnLocation(ServerLevel level, BlockPos pos)
    • gameEvent

      public void gameEvent(Holder<GameEvent> gameEvent, @Nullable Entity entity)
    • gameEvent

      public void gameEvent(Holder<GameEvent> gameEvent)
    • walkingStepSound

      private void walkingStepSound(BlockPos pos, BlockState state)
    • waterSwimSound

      protected void waterSwimSound()
    • getPrimaryStepSoundBlockPos

      protected BlockPos getPrimaryStepSoundBlockPos(BlockPos pos)
    • playCombinationStepSounds

      protected void playCombinationStepSounds(BlockState primaryState, BlockState secondaryState, BlockPos primaryPos, BlockPos secondaryPos)
    • playMuffledStepSound

      protected void playMuffledStepSound(BlockState state, BlockPos pos)
    • playStepSound

      protected void playStepSound(BlockPos pos, BlockState state)
    • shouldPlayAmethystStepSound

      private boolean shouldPlayAmethystStepSound(BlockState state)
    • playAmethystStepSound

      private void playAmethystStepSound()
    • playSwimSound

      protected void playSwimSound(float volume)
    • onFlap

      protected void onFlap()
    • isFlapping

      protected boolean isFlapping()
    • playSound

      public void playSound(SoundEvent sound, float volume, float pitch)
    • playSound

      public void playSound(SoundEvent sound)
    • isSilent

      public boolean isSilent()
    • setSilent

      public void setSilent(boolean isSilent)
      When set to true the entity will not play sounds.
    • isNoGravity

      public boolean isNoGravity()
    • setNoGravity

      public void setNoGravity(boolean noGravity)
    • getDefaultGravity

      protected double getDefaultGravity()
    • getGravity

      public final double getGravity()
    • applyGravity

      protected void applyGravity()
    • getMovementEmission

      protected Entity.MovementEmission getMovementEmission()
    • dampensVibrations

      public boolean dampensVibrations()
    • checkFallDamage

      protected void checkFallDamage(double y, boolean onGround, BlockState state, BlockPos pos)
    • fireImmune

      public boolean fireImmune()
    • causeFallDamage

      public boolean causeFallDamage(float fallDistance, float multiplier, DamageSource source)
    • isInWater

      public boolean isInWater()
    • isInRain

      private boolean isInRain()
    • isInBubbleColumn

      private boolean isInBubbleColumn()
    • isInWaterOrRain

      public boolean isInWaterOrRain()
    • isInWaterRainOrBubble

      public boolean isInWaterRainOrBubble()
    • isInWaterOrBubble

      public boolean isInWaterOrBubble()
    • isInLiquid

      public boolean isInLiquid()
    • 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> fluidTag)
      Deprecated.
    • isInLava

      public boolean isInLava()
    • moveRelative

      public void moveRelative(float amount, Vec3 relative)
    • getInputVector

      private static Vec3 getInputVector(Vec3 relative, float motionScaler, float facing)
    • getLightLevelDependentMagicValue

      @Deprecated public float getLightLevelDependentMagicValue()
      Deprecated.
    • absMoveTo

      public void absMoveTo(double x, double y, double z, float yRot, float xRot)
      Sets position and rotation, clamping and wrapping params to valid values. Used by network code.
    • absRotateTo

      public void absRotateTo(float yRot, float xRot)
    • absMoveTo

      public void absMoveTo(double x, double y, double z)
    • moveTo

      public void moveTo(Vec3 vec)
    • moveTo

      public void moveTo(double x, double y, double z)
    • moveTo

      public void moveTo(BlockPos pos, float yRot, float xRot)
    • moveTo

      public void moveTo(Vec3 pos, float yRot, float xRot)
    • moveTo

      public void moveTo(double x, double y, double z, float yRot, float xRot)
      Sets the location and rotation of the entity in the world.
    • setOldPosAndRot

      public final void setOldPosAndRot()
    • distanceTo

      public float distanceTo(Entity entity)
      Returns the distance to the entity.
    • distanceToSqr

      public double distanceToSqr(double x, double y, double z)
      Gets the squared distance to the position.
    • distanceToSqr

      public double distanceToSqr(Entity entity)
      Returns the squared distance to the entity.
    • distanceToSqr

      public double distanceToSqr(Vec3 vec)
    • playerTouch

      public void playerTouch(Player player)
      Called by a player entity when they collide with an entity
    • push

      public void push(Entity entity)
      Applies a velocity to the entities, to push them away from each other.
    • push

      public void push(Vec3 vector)
    • push

      public void push(double x, double y, double z)
      Adds to the current velocity of the entity, and sets
      invalid reference
      #isAirBorne
      to true.
    • markHurt

      protected void markHurt()
    • hurt

      public boolean hurt(DamageSource source, float amount)
      Called when the entity is attacked.
    • getViewVector

      public final Vec3 getViewVector(float partialTicks)
      Gets the interpolated look vector.
    • getNearestViewDirection

      public Direction getNearestViewDirection()
    • getViewXRot

      public float getViewXRot(float partialTicks)
      Returns the current X rotation of the entity.
    • getViewYRot

      public float getViewYRot(float partialTick)
      Returns the current Y rotation of the entity.
    • calculateViewVector

      public final Vec3 calculateViewVector(float xRot, float yRot)
      Calculates the view vector using the X and Y rotation of an entity.
    • getUpVector

      public final Vec3 getUpVector(float partialTicks)
    • calculateUpVector

      protected final Vec3 calculateUpVector(float xRot, float yRot)
    • getEyePosition

      public final Vec3 getEyePosition()
    • getEyePosition

      public final Vec3 getEyePosition(float partialTicks)
    • getLightProbePosition

      public Vec3 getLightProbePosition(float partialTicks)
    • getPosition

      public final Vec3 getPosition(float partialTicks)
    • pick

      public HitResult pick(double hitDistance, float partialTicks, boolean hitFluids)
    • canBeHitByProjectile

      public boolean canBeHitByProjectile()
    • isPickable

      public boolean isPickable()
    • isPushable

      public boolean isPushable()
    • awardKillScore

      public void awardKillScore(Entity killed, int scoreValue, DamageSource source)
    • shouldRender

      public boolean shouldRender(double x, double y, double z)
    • shouldRenderAtSqrDistance

      public boolean shouldRenderAtSqrDistance(double distance)
      Checks if the entity is in range to render.
    • saveAsPassenger

      public boolean saveAsPassenger(CompoundTag compound)
      Writes this entity to NBT, unless it has been removed. Also writes this entity's passengers, and the entity type ID (so the produced NBT is sufficient to recreate the entity). Generally,
      invalid reference
      #writeUnlessPassenger
      or
      invalid reference
      #writeWithoutTypeId
      should be used instead of this method.
      Returns:
      True if the entity was written (and the passed compound should be saved)" false if the entity was not written.
    • save

      public boolean save(CompoundTag compound)
      Writes this entity to NBT, unless it has been removed or it is a passenger. Also writes this entity's passengers, and the entity type ID (so the produced NBT is sufficient to recreate the entity). To always write the entity, use
      invalid reference
      #writeWithoutTypeId
      .
      Returns:
      True if the entity was written (and the passed compound should be saved)" false if the entity was not written.
    • saveWithoutId

      public CompoundTag saveWithoutId(CompoundTag compound)
      Writes this entity, including passengers, to NBT, regardless as to whether it is removed or a passenger. Does not include the entity's type ID, so the NBT is insufficient to recreate the entity using
      invalid reference
      AnvilChunkLoader#readWorldEntity
      . Use
      invalid reference
      #writeUnlessPassenger
      for that purpose.
    • load

      public void load(CompoundTag compound)
      Reads the entity from NBT (calls an abstract helper method to read specialized data)
    • repositionEntityAfterLoad

      protected boolean repositionEntityAfterLoad()
    • getEncodeId

      @Nullable public final String getEncodeId()
    • readAdditionalSaveData

      protected abstract void readAdditionalSaveData(CompoundTag compound)
      (abstract) Protected helper method to read subclass entity data from NBT.
    • addAdditionalSaveData

      protected abstract void addAdditionalSaveData(CompoundTag compound)
    • newDoubleList

      protected ListTag newDoubleList(double... numbers)
      creates a NBT list from the array of doubles passed to this function
    • newFloatList

      protected ListTag newFloatList(float... numbers)
      Returns a new NBTTagList filled with the specified floats
    • spawnAtLocation

      @Nullable public ItemEntity spawnAtLocation(ItemLike item)
    • spawnAtLocation

      @Nullable public ItemEntity spawnAtLocation(ItemLike item, int offsetY)
    • spawnAtLocation

      @Nullable public ItemEntity spawnAtLocation(ItemStack stack)
    • spawnAtLocation

      @Nullable public ItemEntity spawnAtLocation(ItemStack stack, float offsetY)
      Drops an item at the position of the entity.
    • isAlive

      public boolean isAlive()
    • isInWall

      public boolean isInWall()
    • interact

      public InteractionResult interact(Player player, InteractionHand hand)
    • canCollideWith

      public boolean canCollideWith(Entity entity)
    • canBeCollidedWith

      public boolean canBeCollidedWith()
    • rideTick

      public void rideTick()
    • positionRider

      public final void positionRider(Entity passenger)
    • positionRider

      protected void positionRider(Entity passenger, Entity.MoveFunction callback)
    • onPassengerTurned

      public void onPassengerTurned(Entity entityToUpdate)
      Applies this entity's orientation to another entity. Used to update passenger orientation.
    • getVehicleAttachmentPoint

      public Vec3 getVehicleAttachmentPoint(Entity entity)
    • getPassengerRidingPosition

      public Vec3 getPassengerRidingPosition(Entity entity)
    • getPassengerAttachmentPoint

      protected Vec3 getPassengerAttachmentPoint(Entity entity, EntityDimensions dimensions, float partialTick)
    • getDefaultPassengerAttachmentPoint

      protected static Vec3 getDefaultPassengerAttachmentPoint(Entity vehicle, Entity passenger, EntityAttachments attachments)
    • startRiding

      public boolean startRiding(Entity vehicle)
    • showVehicleHealth

      public boolean showVehicleHealth()
    • startRiding

      public boolean startRiding(Entity vehicle, boolean force)
    • canRide

      protected boolean canRide(Entity vehicle)
    • ejectPassengers

      public void ejectPassengers()
    • removeVehicle

      public void removeVehicle()
    • stopRiding

      public void stopRiding()
    • addPassenger

      protected void addPassenger(Entity passenger)
    • removePassenger

      protected void removePassenger(Entity passenger)
    • canAddPassenger

      protected boolean canAddPassenger(Entity passenger)
    • couldAcceptPassenger

      @Deprecated protected boolean couldAcceptPassenger()
      Deprecated.
    • lerpTo

      public void lerpTo(double x, double y, double z, float yRot, float xRot, int steps)
    • lerpTargetX

      public double lerpTargetX()
    • lerpTargetY

      public double lerpTargetY()
    • lerpTargetZ

      public double lerpTargetZ()
    • lerpTargetXRot

      public float lerpTargetXRot()
    • lerpTargetYRot

      public float lerpTargetYRot()
    • lerpHeadTo

      public void lerpHeadTo(float yaw, int pitch)
    • getPickRadius

      public float getPickRadius()
    • getLookAngle

      public Vec3 getLookAngle()
    • getHandHoldingItemAngle

      public Vec3 getHandHoldingItemAngle(Item item)
    • getRotationVector

      public Vec2 getRotationVector()
    • getForward

      public Vec3 getForward()
    • setAsInsidePortal

      public void setAsInsidePortal(Portal portal, BlockPos pos)
    • handlePortal

      protected void handlePortal()
    • getDimensionChangingDelay

      public int getDimensionChangingDelay()
    • lerpMotion

      public void lerpMotion(double x, double y, double z)
      Updates the entity motion clientside, called by packets from the server
    • handleDamageEvent

      public void handleDamageEvent(DamageSource damageSource)
    • handleEntityEvent

      public void handleEntityEvent(byte id)
      Handles an entity event received from a ClientboundEntityEventPacket.
    • animateHurt

      public void animateHurt(float yaw)
    • isOnFire

      public boolean isOnFire()
    • isPassenger

      public boolean isPassenger()
    • isVehicle

      public boolean isVehicle()
    • dismountsUnderwater

      public boolean dismountsUnderwater()
    • canControlVehicle

      public boolean canControlVehicle()
    • setShiftKeyDown

      public void setShiftKeyDown(boolean keyDown)
    • 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 sprinting)
      Set sprinting switch for Entity.
    • isSwimming

      public boolean isSwimming()
    • isVisuallySwimming

      public boolean isVisuallySwimming()
    • isVisuallyCrawling

      public boolean isVisuallyCrawling()
    • setSwimming

      public void setSwimming(boolean swimming)
    • hasGlowingTag

      public final boolean hasGlowingTag()
    • setGlowingTag

      public final void setGlowingTag(boolean hasGlowingTag)
    • isCurrentlyGlowing

      public boolean isCurrentlyGlowing()
    • isInvisible

      public boolean isInvisible()
    • isInvisibleTo

      public boolean isInvisibleTo(Player player)
      Only used by renderer in EntityLivingBase subclasses. Determines if an entity is visible or not to a specific player, if the entity is normally invisible. For EntityLivingBase subclasses, returning false when invisible will render the entity semi-transparent.
    • isOnRails

      public boolean isOnRails()
    • updateDynamicGameEventListener

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

      @Nullable public PlayerTeam getTeam()
    • isAlliedTo

      public boolean isAlliedTo(Entity entity)
      Returns whether this Entity is on the same team as the given Entity.
    • isAlliedTo

      public boolean isAlliedTo(Team team)
      Returns whether this Entity is on the given scoreboard team.
    • setInvisible

      public void setInvisible(boolean invisible)
    • getSharedFlag

      protected boolean getSharedFlag(int flag)
      Returns true if the flag is active for the entity. Known flags: 0: burning 1: sneaking 2: unused 3: sprinting 4: swimming 5: invisible 6: glowing 7: elytra flying
    • setSharedFlag

      protected void setSharedFlag(int flag, boolean set)
      Enable or disable an entity flag, see
      invalid reference
      #getEntityFlag
      to read the known flags.
    • getMaxAirSupply

      public int getMaxAirSupply()
    • getAirSupply

      public int getAirSupply()
    • setAirSupply

      public void setAirSupply(int air)
    • getTicksFrozen

      public int getTicksFrozen()
    • setTicksFrozen

      public void setTicksFrozen(int ticksFrozen)
    • getPercentFrozen

      public float getPercentFrozen()
    • isFullyFrozen

      public boolean isFullyFrozen()
    • getTicksRequiredToFreeze

      public int getTicksRequiredToFreeze()
    • thunderHit

      public void thunderHit(ServerLevel level, LightningBolt lightning)
    • onAboveBubbleCol

      public void onAboveBubbleCol(boolean downwards)
    • onInsideBubbleColumn

      public void onInsideBubbleColumn(boolean downwards)
    • killedEntity

      public boolean killedEntity(ServerLevel level, LivingEntity entity)
    • checkSlowFallDistance

      public void checkSlowFallDistance()
    • resetFallDistance

      public void resetFallDistance()
    • moveTowardsClosestSpace

      protected void moveTowardsClosestSpace(double x, double y, double z)
    • makeStuckInBlock

      public void makeStuckInBlock(BlockState state, Vec3 motionMultiplier)
    • removeAction

      private static Component removeAction(Component name)
    • getName

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

      protected Component getTypeName()
    • is

      public boolean is(Entity entity)
      Returns true if Entity argument is equal to this Entity
    • getYHeadRot

      public float getYHeadRot()
    • setYHeadRot

      public void setYHeadRot(float yHeadRot)
      Sets the head's Y rotation of the entity.
    • setYBodyRot

      public void setYBodyRot(float yBodyRot)
      Set the body Y rotation of the entity.
    • isAttackable

      public boolean isAttackable()
    • skipAttackInteraction

      public boolean skipAttackInteraction(Entity entity)
      Called when a player attacks an entity. If this returns true the attack will not happen.
    • toString

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

      public boolean isInvulnerableTo(DamageSource source)
      Returns whether this Entity is invulnerable to the given DamageSource.
    • isInvulnerable

      public boolean isInvulnerable()
    • setInvulnerable

      public void setInvulnerable(boolean isInvulnerable)
      Sets whether this Entity is invulnerable.
    • copyPosition

      public void copyPosition(Entity entity)
      Sets this entity's location and angles to the location and angles of the passed in entity.
    • restoreFrom

      public void restoreFrom(Entity entity)
      Prepares this entity in new dimension by copying NBT data from entity in old dimension
    • changeDimension

      @Nullable public Entity changeDimension(DimensionTransition transition)
    • placePortalTicket

      public void placePortalTicket(BlockPos pos)
    • removeAfterChangingDimensions

      protected void removeAfterChangingDimensions()
    • getRelativePortalPosition

      public Vec3 getRelativePortalPosition(Direction.Axis axis, BlockUtil.FoundRectangle portal)
    • canUsePortal

      public boolean canUsePortal(boolean allowPassengers)
    • canChangeDimensions

      public boolean canChangeDimensions(Level oldLevel, Level newLevel)
    • getBlockExplosionResistance

      public float getBlockExplosionResistance(Explosion explosion, BlockGetter level, BlockPos pos, BlockState blockState, FluidState fluidState, float explosionPower)
      Explosion resistance of a block relative to this entity
    • shouldBlockExplode

      public boolean shouldBlockExplode(Explosion explosion, BlockGetter level, BlockPos pos, BlockState blockState, float explosionPower)
    • getMaxFallDistance

      public int getMaxFallDistance()
    • isIgnoringBlockTriggers

      public boolean isIgnoringBlockTriggers()
    • fillCrashReportCategory

      public void fillCrashReportCategory(CrashReportCategory category)
    • displayFireAnimation

      public boolean displayFireAnimation()
    • setUUID

      public void setUUID(UUID uniqueId)
    • getUUID

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

      public String getStringUUID()
    • getScoreboardName

      public String getScoreboardName()
      Specified by:
      getScoreboardName in interface ScoreHolder
    • isPushedByFluid

      @Deprecated public boolean isPushedByFluid()
      Deprecated.
    • getViewScale

      public static double getViewScale()
    • setViewScale

      public static void setViewScale(double renderDistWeight)
    • getDisplayName

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

      public void setCustomName(@Nullable Component name)
    • 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 alwaysRenderNameTag)
    • isCustomNameVisible

      public boolean isCustomNameVisible()
    • teleportTo

      public boolean teleportTo(ServerLevel level, double x, double y, double z, Set<RelativeMovement> relativeMovements, float yRot, float xRot)
    • dismountTo

      public void dismountTo(double x, double y, double z)
    • teleportTo

      public void teleportTo(double x, double y, double z)
      Sets the position of the entity and updates the 'last' variables
    • teleportPassengers

      private void teleportPassengers()
    • teleportRelative

      public void teleportRelative(double dx, double dy, double dz)
    • shouldShowName

      public boolean shouldShowName()
    • onSyncedDataUpdated

      public void onSyncedDataUpdated(List<SynchedEntityData.DataValue<?>> dataValues)
      Specified by:
      onSyncedDataUpdated in interface SyncedDataHolder
    • onSyncedDataUpdated

      public void onSyncedDataUpdated(EntityDataAccessor<?> key)
      Specified by:
      onSyncedDataUpdated in interface SyncedDataHolder
    • fixupDimensions

      @Deprecated protected void fixupDimensions()
      Deprecated.
    • refreshDimensions

      public void refreshDimensions()
    • fudgePositionAfterSizeChange

      public boolean fudgePositionAfterSizeChange(EntityDimensions dimensions)
    • getDirection

      public Direction getDirection()
    • getMotionDirection

      public Direction getMotionDirection()
    • createHoverEvent

      protected HoverEvent createHoverEvent()
    • broadcastToPlayer

      public boolean broadcastToPlayer(ServerPlayer player)
    • getBoundingBox

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

      public AABB getBoundingBoxForCulling()
    • setBoundingBox

      public final void setBoundingBox(AABB bb)
    • getEyeHeight

      public final float getEyeHeight(Pose pose)
    • getEyeHeight

      public final float getEyeHeight()
    • getLeashOffset

      public Vec3 getLeashOffset(float partialTick)
    • getLeashOffset

      protected Vec3 getLeashOffset()
    • getSlot

      public SlotAccess getSlot(int slot)
    • sendSystemMessage

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

      public Level getCommandSenderWorld()
    • getServer

      @Nullable public MinecraftServer getServer()
    • interactAt

      public InteractionResult interactAt(Player player, Vec3 vec, InteractionHand hand)
      Applies the given player interaction to this Entity.
    • ignoreExplosion

      public boolean ignoreExplosion(Explosion explosion)
    • startSeenByPlayer

      public void startSeenByPlayer(ServerPlayer serverPlayer)
      Add the given player to the list of players tracking this entity. For instance, a player may track a boss in order to view its associated boss bar.
    • stopSeenByPlayer

      public void stopSeenByPlayer(ServerPlayer serverPlayer)
      Removes the given player from the list of players tracking this entity. See
      invalid reference
      Entity#addTrackingPlayer
      for more information on tracking.
    • rotate

      public float rotate(Rotation transformRotation)
      Transforms the entity's current yaw with the given Rotation and returns it. This does not have a side-effect.
    • mirror

      public float mirror(Mirror transformMirror)
      Transforms the entity's current yaw with the given Mirror and returns it. This does not have a side-effect.
    • onlyOpCanSetNbt

      public boolean onlyOpCanSetNbt()
    • deflection

      public ProjectileDeflection deflection(Projectile projectile)
    • 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 entity)
    • hasPassenger

      public boolean hasPassenger(Predicate<Entity> predicate)
    • 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()
    • countPlayerPassengers

      public int countPlayerPassengers()
    • hasExactlyOnePlayerPassenger

      public boolean hasExactlyOnePlayerPassenger()
    • getRootVehicle

      public Entity getRootVehicle()
    • isPassengerOfSameVehicle

      public boolean isPassengerOfSameVehicle(Entity entity)
    • hasIndirectPassenger

      public boolean hasIndirectPassenger(Entity p_entity)
    • isControlledByLocalInstance

      public boolean isControlledByLocalInstance()
    • isEffectiveAi

      public boolean isEffectiveAi()
    • getCollisionHorizontalEscapeVector

      protected static Vec3 getCollisionHorizontalEscapeVector(double vehicleWidth, double passengerWidth, float yRot)
    • getDismountLocationForPassenger

      public Vec3 getDismountLocationForPassenger(LivingEntity passenger)
    • 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 level)
    • 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 anchor, Vec3 target)
    • getPreciseBodyRotation

      public float getPreciseBodyRotation(float partialTick)
    • updateFluidHeightAndDoFluidPushing

      @Deprecated public boolean updateFluidHeightAndDoFluidPushing(TagKey<Fluid> fluidTag, double motionScale)
      Deprecated.
    • updateFluidHeightAndDoFluidPushing

      public void updateFluidHeightAndDoFluidPushing()
    • touchingUnloadedChunk

      public boolean touchingUnloadedChunk()
    • getFluidHeight

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

      public double getFluidJumpThreshold()
    • getBbWidth

      public final float getBbWidth()
    • getBbHeight

      public final float getBbHeight()
    • getAddEntityPacket

      public Packet<ClientGamePacketListener> getAddEntityPacket(ServerEntity entity)
    • getDimensions

      public EntityDimensions getDimensions(Pose pose)
    • getAttachments

      public final EntityAttachments getAttachments()
    • position

      public Vec3 position()
    • trackingPosition

      public Vec3 trackingPosition()
    • blockPosition

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

      public BlockState getInBlockState()
    • chunkPosition

      public ChunkPos chunkPosition()
    • getDeltaMovement

      public Vec3 getDeltaMovement()
    • setDeltaMovement

      public void setDeltaMovement(Vec3 deltaMovement)
    • addDeltaMovement

      public void addDeltaMovement(Vec3 addend)
    • setDeltaMovement

      public void setDeltaMovement(double x, double y, double z)
    • getBlockX

      public final int getBlockX()
    • getX

      public final double getX()
    • getX

      public double getX(double scale)
    • getRandomX

      public double getRandomX(double scale)
    • getBlockY

      public final int getBlockY()
    • getY

      public final double getY()
    • getY

      public double getY(double scale)
    • getRandomY

      public double getRandomY()
    • getEyeY

      public double getEyeY()
    • getBlockZ

      public final int getBlockZ()
    • getZ

      public final double getZ()
    • getZ

      public double getZ(double scale)
    • getRandomZ

      public double getRandomZ(double scale)
    • setPosRaw

      public final void setPosRaw(double x, double y, double z)
      Directly updates the
      invalid reference
      #posX
      ,
      invalid reference
      posY
      , and
      invalid reference
      posZ
      fields, without performing any collision checks, updating the bounding box position, or sending any packets. In general, this is not what you want and
      invalid reference
      #setPosition
      is better, as that handles the bounding box.
    • checkDespawn

      public void checkDespawn()
    • getRopeHoldPosition

      public Vec3 getRopeHoldPosition(float partialTicks)
    • recreateFromPacket

      public void recreateFromPacket(ClientboundAddEntityPacket packet)
    • getPickResult

      @Nullable public ItemStack getPickResult()
    • setIsInPowderSnow

      public void setIsInPowderSnow(boolean isInPowderSnow)
    • canFreeze

      public boolean canFreeze()
    • isFreezing

      public boolean isFreezing()
    • getYRot

      public float getYRot()
    • getVisualRotationYInDegrees

      public float getVisualRotationYInDegrees()
    • setYRot

      public void setYRot(float yRot)
      Sets the rotation of this entity around the y-axis (the yaw) in degrees.
    • getXRot

      public float getXRot()
    • setXRot

      public void setXRot(float xRot)
      Sets the rotation of this entity around the x-axis (the pitch) in degrees.
    • canSprint

      public boolean canSprint()
    • maxUpStep

      public float maxUpStep()
    • onExplosionHit

      public void onExplosionHit(@Nullable Entity entity)
    • isRemoved

      public final boolean isRemoved()
    • getRemovalReason

      @Nullable public Entity.RemovalReason getRemovalReason()
    • setRemoved

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

      protected void unsetRemoved()
    • setLevelCallback

      public void setLevelCallback(EntityInLevelCallback levelCallback)
      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 level, BlockPos pos)
    • captureDrops

      @Nullable public Collection<ItemEntity> captureDrops()
      Specified by:
      captureDrops in interface IEntityExtension
    • captureDrops

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

      public CompoundTag getPersistentData()
      Description copied from interface: IEntityExtension
      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 IEntityExtension
      Returns:
      A NBTTagCompound
    • canTrample

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

      public final boolean isAddedToLevel()
      Description copied from interface: IEntityExtension
      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:
      isAddedToLevel in interface IEntityExtension
      Returns:
      True if this entity is being tracked by a world
    • onAddedToLevel

      public void onAddedToLevel()
      Description copied from interface: IEntityExtension
      Called after the entity has been added to the world's ticking list.
      Specified by:
      onAddedToLevel in interface IEntityExtension
    • onRemovedFromLevel

      public void onRemovedFromLevel()
      Description copied from interface: IEntityExtension
      Called after the entity has been removed to the world's ticking list.
      Specified by:
      onRemovedFromLevel in interface IEntityExtension
    • revive

      public void revive()
      Description copied from interface: IEntityExtension
      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 IEntityExtension
    • setFluidTypeHeight

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

      public final double getFluidTypeHeight(FluidType type)
      Description copied from interface: IEntityExtension
      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 IEntityExtension
      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: IEntityExtension
      Returns whether the fluid type the entity is currently in matches the specified condition.
      Specified by:
      isInFluidType in interface IEntityExtension
      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: IEntityExtension
      Returns whether the entity is in a fluid.
      Specified by:
      isInFluidType in interface IEntityExtension
      Returns:
      true if the entity is in a fluid, false otherwise
    • getEyeInFluidType

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

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

      @Nullable public final <T> T setData(AttachmentType<T> type, T data)
      Description copied from interface: IAttachmentHolder
      Sets the data attachment of the given type.
      Specified by:
      setData in interface IAttachmentHolder
      Overrides:
      setData in class AttachmentHolder
      Returns:
      the previous value for that attachment type, if any, or null if there was none
    • getCapability

      @Nullable public final <T, C extends @Nullable Object> T getCapability(EntityCapability<T,C> capability, C context)
    • getCapability

      @Nullable public final <T> T getCapability(EntityCapability<T,@Nullable Void> capability)
    • level

      public Level level()
    • setLevel

      protected void setLevel(Level level)
    • damageSources

      public DamageSources damageSources()
    • registryAccess

      public RegistryAccess registryAccess()
    • lerpPositionAndRotationStep

      protected void lerpPositionAndRotationStep(int steps, double targetX, double targetY, double targetZ, double targetYRot, double targetXRot)
    • getRandom

      public RandomSource getRandom()
    • getKnownMovement

      public Vec3 getKnownMovement()
    • getWeaponItem

      @Nullable public ItemStack getWeaponItem()