Class Entity

All Implemented Interfaces:
DataComponentGetter, TypedInstance<EntityType<?>>, SyncedDataHolder, DebugValueSource, ItemOwner, SlotProvider, EntityAccess, UniquelyIdentifyable, Nameable, ScoreHolder, IAttachmentHolder, IEntityExtension
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
    • TAG_ID

      public static final String TAG_ID
      See Also:
    • TAG_UUID

      public static final String TAG_UUID
      See Also:
    • TAG_PASSENGERS

      public static final String TAG_PASSENGERS
      See Also:
    • TAG_DATA

      public static final String TAG_DATA
      See Also:
    • TAG_POS

      public static final String TAG_POS
      See Also:
    • TAG_MOTION

      public static final String TAG_MOTION
      See Also:
    • TAG_ROTATION

      public static final String TAG_ROTATION
      See Also:
    • TAG_PORTAL_COOLDOWN

      public static final String TAG_PORTAL_COOLDOWN
      See Also:
    • TAG_NO_GRAVITY

      public static final String TAG_NO_GRAVITY
      See Also:
    • TAG_AIR

      public static final String TAG_AIR
      See Also:
    • TAG_ON_GROUND

      public static final String TAG_ON_GROUND
      See Also:
    • TAG_FALL_DISTANCE

      public static final String TAG_FALL_DISTANCE
      See Also:
    • TAG_FIRE

      public static final String TAG_FIRE
      See Also:
    • TAG_SILENT

      public static final String TAG_SILENT
      See Also:
    • TAG_GLOWING

      public static final String TAG_GLOWING
      See Also:
    • TAG_INVULNERABLE

      public static final String TAG_INVULNERABLE
      See Also:
    • TAG_CUSTOM_NAME

      public static final String TAG_CUSTOM_NAME
      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:
    • TAG_LIST_CODEC

      private static final Codec<List<String>> TAG_LIST_CODEC
    • 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:
    • MAX_BLOCK_ITERATIONS_ALONG_TRAVEL_PER_TICK

      private static final int MAX_BLOCK_ITERATIONS_ALONG_TRAVEL_PER_TICK
      See Also:
    • MAX_MOVEMENT_RESETTING_TRACE_DISTANCE

      private static final double MAX_MOVEMENT_RESETTING_TRACE_DISTANCE
      See Also:
    • viewScale

      private static double viewScale
    • type

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

      private boolean requiresPrecisePosition
    • id

      private int id
    • blocksBuilding

      public boolean blocksBuilding
    • passengers

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

      protected int boardingCooldown
    • vehicle

      private @Nullable 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

      private @Nullable 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:
    • moveDist

      public float moveDist
    • flyDist

      public float flyDist
    • fallDistance

      public double 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
    • fluidInteraction

      private final EntityFluidInteraction fluidInteraction
    • wasTouchingWater

      protected boolean wasTouchingWater
    • wasEyeInWater

      protected boolean wasEyeInWater
    • 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
    • needsSync

      public boolean needsSync
    • portalProcess

      public @Nullable 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
    • mainSupportingBlockPos

      public Optional<BlockPos> mainSupportingBlockPos
    • onGroundNoBlocks

      private boolean onGroundNoBlocks
    • crystalSoundIntensity

      private float crystalSoundIntensity
    • lastCrystalSoundPlayTick

      private int lastCrystalSoundPlayTick
    • hasVisualFire

      private boolean hasVisualFire
    • lastKnownSpeed

      private Vec3 lastKnownSpeed
    • lastKnownPosition

      private @Nullable Vec3 lastKnownPosition
    • inBlockState

      private @Nullable BlockState inBlockState
    • MAX_MOVEMENTS_HANDELED_PER_TICK

      public static final int MAX_MOVEMENTS_HANDELED_PER_TICK
      See Also:
    • movementThisTick

      private final ArrayDeque<Entity.Movement> movementThisTick
    • finalMovementsThisTick

      private final List<Entity.Movement> finalMovementsThisTick
    • visitedBlocks

      private final it.unimi.dsi.fastutil.longs.LongSet visitedBlocks
    • insideEffectCollector

      private final InsideBlockEffectApplier.StepBasedCollector insideEffectCollector
    • customData

      private CustomData customData
    • captureDrops

      private @Nullable 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

      invalid reference
      #spawnAtLocation(ItemStack, float)
      and ServerPlayer.drop(ItemStack, boolean, boolean) instead of adding them to the world.
    • persistentData

      private @Nullable 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.
  • Constructor Details

  • Method Details

    • isColliding

      public boolean isColliding(BlockPos pos, BlockState state)
    • getTeamColor

      public int getTeamColor()
    • isSpectator

      public boolean isSpectator()
    • canInteractWithLevel

      public boolean canInteractWithLevel()
    • unRide

      public final void unRide()
    • syncPacketPositionCodec

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

      public VecDeltaCodec getPositionCodec()
    • getType

      public EntityType<?> getType()
    • typeHolder

      public Holder<EntityType<?>> typeHolder()
      Specified by:
      typeHolder in interface TypedInstance<EntityType<?>>
    • getRequiresPrecisePosition

      public boolean getRequiresPrecisePosition()
    • setRequiresPrecisePosition

      public void setRequiresPrecisePosition(boolean requiresPrecisePosition)
    • getId

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

      public void setId(int id)
    • entityTags

      public Set<String> entityTags()
    • addTag

      public boolean addTag(String tag)
    • removeTag

      public boolean removeTag(String tag)
    • kill

      public void kill(ServerLevel level)
    • discard

      public final void discard()
    • defineSynchedData

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

      public SynchedEntityData getEntityData()
    • equals

      public boolean equals(Object obj)
      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()
    • onRemoval

      public void onRemoval(Entity.RemovalReason reason)
    • setPose

      public void setPose(Pose pose)
    • getPose

      public Pose getPose()
    • hasPose

      public boolean hasPose(Pose pose)
    • closerThan

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

      public boolean closerThan(Entity other, double distanceXZ, double distanceY)
    • setRot

      protected void setRot(float yRot, float xRot)
    • setPos

      public final void setPos(Vec3 pos)
    • setPos

      public void setPos(double x, double y, double z)
    • makeBoundingBox

      protected final AABB makeBoundingBox()
    • makeBoundingBox

      protected AABB makeBoundingBox(Vec3 position)
    • reapplyPosition

      protected void reapplyPosition()
    • turn

      public void turn(double xo, double yo)
    • updateDataBeforeSync

      public void updateDataBeforeSync()
    • tick

      public void tick()
    • baseTick

      public void baseTick()
    • computeSpeed

      protected void computeSpeed()
    • setSharedFlagOnFire

      public void setSharedFlagOnFire(boolean value)
    • 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()
    • lavaIgnite

      public void lavaIgnite()
    • lavaHurt

      public void lavaHurt()
    • shouldPlayLavaHurtSound

      protected boolean shouldPlayLavaHurtSound()
    • igniteForSeconds

      public final void igniteForSeconds(float numberOfSeconds)
    • igniteForTicks

      public void igniteForTicks(int numberOfTicks)
    • setRemainingFireTicks

      public void setRemainingFireTicks(int remainingTicks)
    • getRemainingFireTicks

      public int getRemainingFireTicks()
    • clearFire

      public void clearFire()
    • onBelowWorld

      protected void onBelowWorld()
    • isFree

      public boolean isFree(double xa, double ya, double za)
    • isFree

      private boolean isFree(AABB box)
    • setOnGround

      public void setOnGround(boolean onGround)
    • setOnGroundWithMovement

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

      public void setOnGroundWithMovement(boolean onGround, boolean horizontalCollision, 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 moverType, Vec3 delta)
    • applyMovementEmissionAndPlaySound

      private void applyMovementEmissionAndPlaySound(Entity.MovementEmission emission, Vec3 clippedMovement, BlockPos effectPos, BlockState effectState)
    • applyEffectsFromBlocks

      protected void applyEffectsFromBlocks()
    • applyEffectsFromBlocksForLastMovements

      protected void applyEffectsFromBlocksForLastMovements()
    • addMovementThisTick

      private void addMovementThisTick(Entity.Movement movement)
    • removeLatestMovementRecording

      public void removeLatestMovementRecording()
    • clearMovementThisTick

      protected void clearMovementThisTick()
    • hasMovedHorizontallyRecently

      public boolean hasMovedHorizontallyRecently()
    • applyEffectsFromBlocks

      public void applyEffectsFromBlocks(Vec3 from, Vec3 to)
    • applyEffectsFromBlocks

      private void applyEffectsFromBlocks(List<Entity.Movement> movements)
    • isAffectedByBlocks

      protected boolean isAffectedByBlocks()
    • isStateClimbable

      private boolean isStateClimbable(BlockState state)
    • vibrationAndSoundEffectsFromBlock

      private boolean vibrationAndSoundEffectsFromBlock(BlockPos pos, BlockState blockState, boolean shouldSound, boolean shouldVibrate, Vec3 clippedMovement)
    • isHorizontalCollisionMinor

      protected boolean isHorizontalCollisionMinor(Vec3 movement)
    • 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 offset)
    • getBlockJumpFactor

      protected float getBlockJumpFactor()
    • getBlockSpeedFactor

      protected float getBlockSpeedFactor()
    • maybeBackOffFromEdge

      protected Vec3 maybeBackOffFromEdge(Vec3 delta, MoverType moverType)
    • limitPistonMovement

      protected Vec3 limitPistonMovement(Vec3 vec)
    • applyPistonMovementRestriction

      private double applyPistonMovementRestriction(Direction.Axis axis, double amount)
    • getAvailableSpaceBelow

      public double getAvailableSpaceBelow(double maxDistance)
    • collide

      private Vec3 collide(Vec3 movement)
    • collectCandidateStepUpHeights

      private static float[] collectCandidateStepUpHeights(AABB boundingBox, List<VoxelShape> colliders, float maxStepHeight, float stepHeightToSkip)
    • collideBoundingBox

      public static Vec3 collideBoundingBox(@Nullable Entity source, Vec3 movement, AABB boundingBox, Level level, List<VoxelShape> entityColliders)
    • collectAllColliders

      public static List<VoxelShape> collectAllColliders(@Nullable Entity source, Level level, AABB boundingBox)
    • collectColliders

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

      private static Vec3 collideWithShapes(Vec3 movement, AABB boundingBox, List<VoxelShape> shapes)
    • nextStep

      protected float nextStep()
    • getSwimSound

      protected SoundEvent getSwimSound()
    • getSwimSplashSound

      protected SoundEvent getSwimSplashSound()
    • getSwimHighSpeedSplashSound

      protected SoundEvent getSwimHighSpeedSplashSound()
    • checkInsideBlocks

      private void checkInsideBlocks(List<Entity.Movement> movements, InsideBlockEffectApplier.StepBasedCollector effectCollector)
    • checkInsideBlocks

      private int checkInsideBlocks(Vec3 from, Vec3 to, InsideBlockEffectApplier.StepBasedCollector effectCollector, it.unimi.dsi.fastutil.longs.LongSet visitedBlocks, int maxMovementIterations)
    • debugBlockIntersection

      private void debugBlockIntersection(ServerLevel level, BlockPos pos, boolean insideBlock, boolean insideFluid)
    • collidedWithFluid

      public boolean collidedWithFluid(FluidState fluidState, BlockPos blockPos, Vec3 from, Vec3 to)
    • collidedWithShapeMovingFrom

      public boolean collidedWithShapeMovingFrom(Vec3 from, Vec3 to, List<AABB> aabbs)
    • onInsideBlock

      protected void onInsideBlock(BlockState state)
    • adjustSpawnLocation

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

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

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

      private void walkingStepSound(BlockPos onPos, BlockState onState)
    • waterSwimSound

      protected void waterSwimSound()
    • getPrimaryStepSoundBlockPos

      protected BlockPos getPrimaryStepSoundBlockPos(BlockPos affectingPos)
    • playCombinationStepSounds

      protected void playCombinationStepSounds(BlockState primaryStepSound, BlockState secondaryStepSound, BlockPos primaryPos, BlockPos secondaryPos)
    • playMuffledStepSound

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

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

      private boolean shouldPlayAmethystStepSound(BlockState affectingState)
    • 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 silent)
    • 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()
    • doCheckFallDamage

      public final void doCheckFallDamage(double xa, double ya, double za, boolean onGround)
    • checkFallDamage

      protected void checkFallDamage(double ya, boolean onGround, BlockState onState, BlockPos pos)
    • fireImmune

      public boolean fireImmune()
    • causeFallDamage

      public boolean causeFallDamage(double fallDistance, float damageModifier, DamageSource damageSource)
    • propagateFallToPassengers

      protected void propagateFallToPassengers(double fallDistance, float damageModifier, DamageSource damageSource)
    • isInWater

      public boolean isInWater()
    • isInRain

      boolean isInRain()
    • isInWaterOrRain

      public boolean isInWaterOrRain()
    • isInLiquid

      public boolean isInLiquid()
    • isUnderWater

      public boolean isUnderWater()
    • isInShallowWater

      public boolean isInShallowWater()
    • isInClouds

      public boolean isInClouds()
    • updateSwimming

      public void updateSwimming()
    • updateFluidInteraction

      protected boolean updateFluidInteraction()
    • doWaterSplashEffect

      protected void doWaterSplashEffect()
    • getBlockStateOnLegacy

      @Deprecated protected BlockState getBlockStateOnLegacy()
      Deprecated.
    • getBlockStateOn

      public BlockState getBlockStateOn()
    • canSpawnSprintParticle

      public boolean canSpawnSprintParticle()
    • spawnSprintParticle

      protected void spawnSprintParticle()
    • isEyeInFluid

      public boolean isEyeInFluid(TagKey<Fluid> type)
    • isInLava

      public boolean isInLava()
    • moveRelative

      public void moveRelative(float speed, Vec3 input)
    • getInputVector

      protected static Vec3 getInputVector(Vec3 input, float speed, float yRot)
    • getLightLevelDependentMagicValue

      @Deprecated public float getLightLevelDependentMagicValue()
      Deprecated.
    • absSnapTo

      public void absSnapTo(double x, double y, double z, float yRot, float xRot)
    • absSnapRotationTo

      public void absSnapRotationTo(float yRot, float xRot)
    • absSnapTo

      public void absSnapTo(double x, double y, double z)
    • snapTo

      public void snapTo(Vec3 pos)
    • snapTo

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

      public void snapTo(BlockPos spawnPos, float yRot, float xRot)
    • snapTo

      public void snapTo(Vec3 spawnPos, float yRot, float xRot)
    • snapTo

      public void snapTo(double x, double y, double z, float yRot, float xRot)
    • setOldPosAndRot

      public final void setOldPosAndRot()
    • setOldPosAndRot

      public final void setOldPosAndRot(Vec3 position, float yRot, float xRot)
    • setOldPos

      protected void setOldPos()
    • setOldRot

      public void setOldRot()
    • setOldPos

      private void setOldPos(Vec3 position)
    • setOldRot

      private void setOldRot(float yRot, float xRot)
    • oldPosition

      public final Vec3 oldPosition()
    • distanceTo

      public float distanceTo(Entity entity)
    • distanceToSqr

      public double distanceToSqr(double x2, double y2, double z2)
    • distanceToSqr

      public double distanceToSqr(Entity entity)
    • distanceToSqr

      public double distanceToSqr(Vec3 pos)
    • playerTouch

      public void playerTouch(Player player)
    • push

      public void push(Entity entity)
    • push

      public void push(Vec3 impulse)
    • push

      public void push(double xa, double ya, double za)
    • markHurt

      protected void markHurt()
    • hurt

      @Deprecated public final void hurt(DamageSource source, float damage)
      Deprecated.
    • hurtOrSimulate

      @Deprecated public final boolean hurtOrSimulate(DamageSource source, float damage)
      Deprecated.
    • hurtServer

      public abstract boolean hurtServer(ServerLevel level, DamageSource source, float damage)
    • hurtClient

      public boolean hurtClient(DamageSource source)
    • getViewVector

      public final Vec3 getViewVector(float a)
    • getNearestViewDirection

      public Direction getNearestViewDirection()
    • getViewXRot

      public float getViewXRot(float a)
    • getViewYRot

      public float getViewYRot(float a)
    • getXRot

      public float getXRot(float partialTicks)
    • getYRot

      public float getYRot(float partialTicks)
    • calculateViewVector

      public final Vec3 calculateViewVector(float xRot, float yRot)
    • getUpVector

      public final Vec3 getUpVector(float a)
    • calculateUpVector

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

      public final Vec3 getEyePosition()
    • getEyePosition

      public final Vec3 getEyePosition(float partialTickTime)
    • getLightProbePosition

      public Vec3 getLightProbePosition(float partialTickTime)
    • getPosition

      public final Vec3 getPosition(float partialTickTime)
    • pick

      public HitResult pick(double range, float a, boolean withLiquids)
    • canBeHitByProjectile

      public boolean canBeHitByProjectile()
    • isPickable

      public boolean isPickable()
    • isPushable

      public boolean isPushable()
    • awardKillScore

      public void awardKillScore(Entity victim, DamageSource killingBlow)
    • shouldRender

      public boolean shouldRender(double camX, double camY, double camZ)
    • shouldRenderAtSqrDistance

      public boolean shouldRenderAtSqrDistance(double distance)
    • saveAsPassenger

      public boolean saveAsPassenger(ValueOutput output)
    • save

      public boolean save(ValueOutput output)
    • saveWithoutId

      public void saveWithoutId(ValueOutput output)
    • load

      public void load(ValueInput input)
    • repositionEntityAfterLoad

      protected boolean repositionEntityAfterLoad()
    • getEncodeId

      public final @Nullable String getEncodeId()
    • readAdditionalSaveData

      protected abstract void readAdditionalSaveData(ValueInput input)
    • addAdditionalSaveData

      protected abstract void addAdditionalSaveData(ValueOutput output)
    • spawnAtLocation

      public @Nullable ItemEntity spawnAtLocation(ServerLevel level, ItemLike resource)
    • spawnAtLocation

      public @Nullable ItemEntity spawnAtLocation(ServerLevel level, ItemStack itemStack)
    • spawnAtLocation

      public @Nullable ItemEntity spawnAtLocation(ServerLevel level, ItemStack itemStack, Vec3 offset)
    • spawnAtLocation

      public @Nullable ItemEntity spawnAtLocation(ServerLevel level, ItemStack itemStack, float offset)
    • isAlive

      public boolean isAlive()
    • isInWall

      public boolean isInWall()
    • interact

      public InteractionResult interact(Player player, InteractionHand hand, Vec3 location)
    • shearOffAllLeashConnections

      public boolean shearOffAllLeashConnections(@Nullable Player player)
    • dropAllLeashConnections

      public boolean dropAllLeashConnections(@Nullable Player player)
    • attemptToShearEquipment

      private boolean attemptToShearEquipment(Player player, InteractionHand hand, ItemStack heldItem, Mob target)
    • canCollideWith

      public boolean canCollideWith(Entity entity)
    • canBeCollidedWith

      public boolean canBeCollidedWith(@Nullable Entity other)
    • rideTick

      public void rideTick()
    • positionRider

      public final void positionRider(Entity passenger)
    • positionRider

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

      public void onPassengerTurned(Entity passenger)
    • getVehicleAttachmentPoint

      public Vec3 getVehicleAttachmentPoint(Entity vehicle)
    • getPassengerRidingPosition

      public Vec3 getPassengerRidingPosition(Entity passenger)
    • getPassengerAttachmentPoint

      protected Vec3 getPassengerAttachmentPoint(Entity passenger, EntityDimensions dimensions, float scale)
    • getDefaultPassengerAttachmentPoint

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

      public final boolean startRiding(Entity entity)
    • showVehicleHealth

      public boolean showVehicleHealth()
    • startRiding

      public boolean startRiding(Entity entityToRide, boolean force, boolean sendEventAndTriggers)
    • 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.
    • isInterpolating

      public final boolean isInterpolating()
    • moveOrInterpolateTo

      public final void moveOrInterpolateTo(Vec3 position, float yRot, float xRot)
    • moveOrInterpolateTo

      public final void moveOrInterpolateTo(float yRot, float xRot)
    • moveOrInterpolateTo

      public final void moveOrInterpolateTo(Vec3 position)
    • moveOrInterpolateTo

      public final void moveOrInterpolateTo(Optional<Vec3> position, Optional<Float> yRot, Optional<Float> xRot)
    • getInterpolation

      public @Nullable InterpolationHandler getInterpolation()
    • lerpHeadTo

      public void lerpHeadTo(float yRot, int steps)
    • getPickRadius

      public float getPickRadius()
    • getLookAngle

      public Vec3 getLookAngle()
    • getHeadLookAngle

      public Vec3 getHeadLookAngle()
    • 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(Vec3 movement)
    • handleDamageEvent

      public void handleDamageEvent(DamageSource source)
    • handleEntityEvent

      public void handleEntityEvent(byte id)
    • animateHurt

      public void animateHurt(float direction)
    • 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 shiftKeyDown)
    • 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 isSprinting)
    • 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 value)
    • isCurrentlyGlowing

      public boolean isCurrentlyGlowing()
    • isInvisible

      public boolean isInvisible()
    • isInvisibleTo

      public boolean isInvisibleTo(Player player)
    • isOnRails

      public boolean isOnRails()
    • updateDynamicGameEventListener

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

      public @Nullable PlayerTeam getTeam()
    • isAlliedTo

      public final boolean isAlliedTo(@Nullable Entity other)
    • considersEntityAsAlly

      protected boolean considersEntityAsAlly(Entity other)
    • isAlliedTo

      public boolean isAlliedTo(@Nullable Team other)
    • setInvisible

      public void setInvisible(boolean invisible)
    • getSharedFlag

      protected boolean getSharedFlag(int flag)
    • setSharedFlag

      protected void setSharedFlag(int flag, boolean value)
    • getMaxAirSupply

      public int getMaxAirSupply()
    • getAirSupply

      public int getAirSupply()
    • setAirSupply

      public void setAirSupply(int supply)
    • clearFreeze

      public void clearFreeze()
    • getTicksFrozen

      public int getTicksFrozen()
    • setTicksFrozen

      public void setTicksFrozen(int ticks)
    • getPercentFrozen

      public float getPercentFrozen()
    • isFullyFrozen

      public boolean isFullyFrozen()
    • getTicksRequiredToFreeze

      public int getTicksRequiredToFreeze()
    • thunderHit

      public void thunderHit(ServerLevel level, LightningBolt lightningBolt)
    • onAboveBubbleColumn

      public void onAboveBubbleColumn(boolean dragDown, BlockPos pos)
    • handleOnAboveBubbleColumn

      protected static void handleOnAboveBubbleColumn(Entity entity, boolean dragDown, BlockPos pos)
    • sendBubbleColumnParticles

      protected static void sendBubbleColumnParticles(Level level, BlockPos pos)
    • onInsideBubbleColumn

      public void onInsideBubbleColumn(boolean dragDown)
    • handleOnInsideBubbleColumn

      protected static void handleOnInsideBubbleColumn(Entity entity, boolean dragDown)
    • killedEntity

      public boolean killedEntity(ServerLevel level, LivingEntity entity, DamageSource source)
    • checkFallDistanceAccumulation

      public void checkFallDistanceAccumulation()
    • resetFallDistance

      public void resetFallDistance()
    • moveTowardsClosestSpace

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

      public void makeStuckInBlock(BlockState blockState, Vec3 speedMultiplier)
    • removeAction

      private static Component removeAction(Component component)
    • getName

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

      protected Component getTypeName()
    • is

      public boolean is(Entity other)
    • getYHeadRot

      public float getYHeadRot()
    • setYHeadRot

      public void setYHeadRot(float yHeadRot)
    • setYBodyRot

      public void setYBodyRot(float yBodyRot)
    • isAttackable

      public boolean isAttackable()
    • skipAttackInteraction

      public boolean skipAttackInteraction(Entity source)
    • toString

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

      protected final boolean isInvulnerableToBase(DamageSource source)
    • isInvulnerable

      public boolean isInvulnerable()
    • setInvulnerable

      public void setInvulnerable(boolean invulnerable)
    • copyPosition

      public void copyPosition(Entity target)
    • restoreFrom

      public void restoreFrom(Entity oldEntity)
    • teleport

      public @Nullable Entity teleport(TeleportTransition transition)
    • teleportSameDimension

      private Entity teleportSameDimension(ServerLevel level, TeleportTransition transition)
    • teleportCrossDimension

      private @Nullable Entity teleportCrossDimension(ServerLevel oldLevel, ServerLevel newLevel, TeleportTransition transition)
    • teleportSpectators

      protected void teleportSpectators(TeleportTransition transition, ServerLevel oldLevel)
    • calculatePassengerTransition

      private TeleportTransition calculatePassengerTransition(TeleportTransition transition, Entity passenger)
    • sendTeleportTransitionToRidingPlayers

      private void sendTeleportTransitionToRidingPlayers(TeleportTransition transition)
    • teleportSetPosition

      public void teleportSetPosition(PositionMoveRotation destination, Set<Relative> relatives)
    • teleportSetPosition

      public void teleportSetPosition(PositionMoveRotation currentValues, PositionMoveRotation destination, Set<Relative> relatives)
    • forceSetRotation

      public void forceSetRotation(float yRot, boolean relativeY, float xRot, boolean relativeX)
    • placePortalTicket

      public void placePortalTicket(BlockPos ticketPosition)
    • removeAfterChangingDimensions

      protected void removeAfterChangingDimensions()
    • getRelativePortalPosition

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

      public boolean canUsePortal(boolean ignorePassenger)
    • canTeleport

      public boolean canTeleport(Level from, Level to)
    • getBlockExplosionResistance

      public float getBlockExplosionResistance(Explosion explosion, BlockGetter level, BlockPos pos, BlockState block, FluidState fluid, float resistance)
    • shouldBlockExplode

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

      public int getMaxFallDistance()
    • isIgnoringBlockTriggers

      public boolean isIgnoringBlockTriggers()
    • fillCrashReportCategory

      public void fillCrashReportCategory(CrashReportCategory category)
    • displayFireAnimation

      public boolean displayFireAnimation()
    • setUUID

      public void setUUID(UUID uuid)
    • getUUID

      public UUID getUUID()
      Specified by:
      getUUID in interface UniquelyIdentifyable
    • 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 viewScale)
    • getDisplayName

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

      public void setCustomName(@Nullable Component name)
    • getCustomName

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

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

      public void setCustomNameVisible(boolean visible)
    • isCustomNameVisible

      public boolean isCustomNameVisible()
    • belowNameDisplay

      public @Nullable Component belowNameDisplay()
    • teleportTo

      public boolean teleportTo(ServerLevel level, double x, double y, double z, Set<Relative> relatives, float newYRot, float newXRot, boolean resetCamera)
    • dismountTo

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

      public void teleportTo(double x, double y, double z)
    • 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<?>> updatedItems)
      Specified by:
      onSyncedDataUpdated in interface SyncedDataHolder
    • onSyncedDataUpdated

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

      @Deprecated protected void fixupDimensions()
      Deprecated.
    • refreshDimensions

      public void refreshDimensions()
    • fudgePositionAfterSizeChange

      public boolean fudgePositionAfterSizeChange(EntityDimensions previousDimensions)
    • 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
    • setBoundingBox

      public final void setBoundingBox(AABB bb)
    • getEyeHeight

      public final float getEyeHeight(Pose pose)
    • getEyeHeight

      public final float getEyeHeight()
    • getSlot

      public @Nullable SlotAccess getSlot(int slot)
      Specified by:
      getSlot in interface SlotProvider
    • ignoreExplosion

      public boolean ignoreExplosion(Explosion explosion)
    • startSeenByPlayer

      public void startSeenByPlayer(ServerPlayer player)
    • stopSeenByPlayer

      public void stopSeenByPlayer(ServerPlayer player)
    • rotate

      public float rotate(Rotation rotation)
    • mirror

      public float mirror(Mirror mirror)
    • deflection

      public ProjectileDeflection deflection(Projectile projectile)
    • getControllingPassenger

      public @Nullable LivingEntity getControllingPassenger()
    • hasControllingPassenger

      public final boolean hasControllingPassenger()
    • getPassengers

      public final List<Entity> getPassengers()
    • getFirstPassenger

      public @Nullable Entity getFirstPassenger()
    • hasPassenger

      public boolean hasPassenger(Entity entity)
    • hasPassenger

      public boolean hasPassenger(Predicate<Entity> test)
    • 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 other)
    • hasIndirectPassenger

      public boolean hasIndirectPassenger(Entity entity)
    • isLocalInstanceAuthoritative

      public final boolean isLocalInstanceAuthoritative()
    • isLocalClientAuthoritative

      protected boolean isLocalClientAuthoritative()
    • isClientAuthoritative

      public boolean isClientAuthoritative()
    • canSimulateMovement

      public boolean canSimulateMovement()
    • isEffectiveAi

      public boolean isEffectiveAi()
    • getCollisionHorizontalEscapeVector

      protected static Vec3 getCollisionHorizontalEscapeVector(double colliderWidth, double collidingWidth, float directionDegrees)
    • getDismountLocationForPassenger

      public Vec3 getDismountLocationForPassenger(LivingEntity passenger)
    • getVehicle

      public @Nullable Entity getVehicle()
    • getControlledVehicle

      public @Nullable Entity getControlledVehicle()
    • getPistonPushReaction

      public PushReaction getPistonPushReaction()
    • getSoundSource

      public SoundSource getSoundSource()
    • getFireImmuneTicks

      protected int getFireImmuneTicks()
    • createCommandSourceStackForNameResolution

      public CommandSourceStack createCommandSourceStackForNameResolution(ServerLevel level)
    • lookAt

      public void lookAt(EntityAnchorArgument.Anchor anchor, Vec3 pos)
    • getPreciseBodyRotation

      public float getPreciseBodyRotation(float partial)
    • touchingUnloadedChunk

      public boolean touchingUnloadedChunk()
    • getFluidHeight

      public double getFluidHeight(TagKey<Fluid> type)
    • getFluidJumpThreshold

      public double getFluidJumpThreshold()
    • getBbWidth

      public final float getBbWidth()
    • getBbHeight

      public final float getBbHeight()
    • getAddEntityPacket

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

      public EntityDimensions getDimensions(Pose pose)
    • getAttachments

      public final EntityAttachments getAttachments()
    • position

      public Vec3 position()
      Specified by:
      position in interface ItemOwner
    • 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 momentum)
    • setDeltaMovement

      public void setDeltaMovement(double xd, double yd, double zd)
    • getBlockX

      public final int getBlockX()
    • getX

      public final double getX()
    • getX

      public double getX(double progress)
    • getRandomX

      public double getRandomX(double spread)
    • getBlockY

      public final int getBlockY()
    • getY

      public final double getY()
    • getY

      public double getY(double progress)
    • getRandomY

      public double getRandomY(double spread)
    • getRandomY

      public double getRandomY()
    • getEyeY

      public double getEyeY()
    • getBlockZ

      public final int getBlockZ()
    • getZ

      public final double getZ()
    • getZ

      public double getZ(double progress)
    • getRandomZ

      public double getRandomZ(double spread)
    • setPosRaw

      public final void setPosRaw(double x, double y, double z)
    • checkDespawn

      public void checkDespawn()
    • getQuadLeashHolderOffsets

      public Vec3[] getQuadLeashHolderOffsets()
    • supportQuadLeashAsHolder

      public boolean supportQuadLeashAsHolder()
    • notifyLeashHolder

      public void notifyLeashHolder(Leashable entity)
    • notifyLeasheeRemoved

      public void notifyLeasheeRemoved(Leashable entity)
    • getRopeHoldPosition

      public Vec3 getRopeHoldPosition(float partialTickTime)
    • recreateFromPacket

      public void recreateFromPacket(ClientboundAddEntityPacket packet)
    • getPickResult

      public @Nullable ItemStack getPickResult()
    • setIsInPowderSnow

      public void setIsInPowderSnow(boolean isInPowderSnow)
    • canFreeze

      public boolean canFreeze()
    • isFreezing

      public boolean isFreezing()
    • getYRot

      public float getYRot()
    • getVisualRotationYInDegrees

      public float getVisualRotationYInDegrees()
      Specified by:
      getVisualRotationYInDegrees in interface ItemOwner
    • setYRot

      public void setYRot(float yRot)
    • getXRot

      public float getXRot()
    • setXRot

      public void setXRot(float xRot)
    • canSprint

      public boolean canSprint()
    • maxUpStep

      public float maxUpStep()
    • onExplosionHit

      public void onExplosionHit(@Nullable Entity explosionCausedBy)
    • isRemoved

      public final boolean isRemoved()
      Specified by:
      isRemoved in interface UniquelyIdentifyable
    • getRemovalReason

      public @Nullable Entity.RemovalReason getRemovalReason()
    • setRemoved

      public final void setRemoved(Entity.RemovalReason reason)
      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(ServerLevel level, BlockPos pos)
    • captureDrops

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

      public @Nullable 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(ServerLevel level, BlockState state, BlockPos pos, double 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
    • setData

      public final <T> @Nullable 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
    • syncData

      public final void syncData(AttachmentType<?> type)
      Description copied from interface: IAttachmentHolder
      Syncs a data attachment of the given type with all relevant clients.

      If there is currently no attachment of the given type, the removal of the attachment is synced to the client.

      Specified by:
      syncData in interface IAttachmentHolder
      See Also:
    • getCapability

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

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

      public boolean isFlyingVehicle()
    • level

      public Level level()
      Specified by:
      level in interface ItemOwner
    • setLevel

      protected void setLevel(Level level)
    • damageSources

      public DamageSources damageSources()
    • registryAccess

      public RegistryAccess registryAccess()
    • lerpPositionAndRotationStep

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

      public RandomSource getRandom()
    • getKnownMovement

      public Vec3 getKnownMovement()
    • getKnownSpeed

      public Vec3 getKnownSpeed()
    • getWeaponItem

      public @Nullable ItemStack getWeaponItem()
    • getLootTable

      public Optional<ResourceKey<LootTable>> getLootTable()
    • applyImplicitComponents

      protected void applyImplicitComponents(DataComponentGetter components)
    • applyComponentsFromItemStack

      public final void applyComponentsFromItemStack(ItemStack stack)
    • get

      public <T> @Nullable T get(DataComponentType<? extends T> type)
      Specified by:
      get in interface DataComponentGetter
    • castComponentValue

      @Contract("_,!null->!null;_,_->_") protected static <T> @Nullable T castComponentValue(DataComponentType<T> type, @Nullable Object value)
    • setComponent

      public <T> void setComponent(DataComponentType<T> type, T value)
    • applyImplicitComponent

      protected <T> boolean applyImplicitComponent(DataComponentType<T> type, T value)
    • applyImplicitComponentIfPresent

      protected <T> boolean applyImplicitComponentIfPresent(DataComponentGetter components, DataComponentType<T> type)
    • problemPath

      public ProblemReporter.PathElement problemPath()
    • registerDebugValues

      public void registerDebugValues(ServerLevel level, DebugValueSource.Registration registration)
      Specified by:
      registerDebugValues in interface DebugValueSource
    • getFluidInteractionBox

      public @Nullable AABB getFluidInteractionBox()
    • modifyPassengerFluidInteractionBox

      protected @Nullable AABB modifyPassengerFluidInteractionBox(AABB passengerBox)