Class Entity
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.entity.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
public abstract class Entity
extends AttachmentHolder
implements Nameable, EntityAccess, ScoreHolder, SyncedDataHolder, DataComponentGetter, ItemOwner, SlotProvider, DebugValueSource, TypedInstance<EntityType<?>>, IEntityExtension
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final recordstatic @interfacestatic interfaceprivate static final recordstatic enumstatic enumNested classes/interfaces inherited from class AttachmentHolder
AttachmentHolder.AsFieldNested classes/interfaces inherited from interface DebugValueSource
DebugValueSource.Registration, DebugValueSource.ValueGetter<T>Nested classes/interfaces inherited from interface ItemOwner
ItemOwner.OffsetFromOwner -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intprivate AABBprivate BlockPosbooleanstatic final intprotected intprivate @Nullable Collection<ItemEntity> Neo: Short-lived holder of dropped item entities.private ChunkPosstatic final intprivate floatprivate CustomDataprivate static final EntityDataAccessor<Integer> private static final EntityDataAccessor<Optional<Component>> private static final EntityDataAccessor<Boolean> private static final EntityDataAccessor<Boolean> protected static final EntityDataAccessor<Pose> protected static final EntityDataAccessor<Byte> private static final EntityDataAccessor<Boolean> private static final EntityDataAccessor<Integer> static final floatstatic final floatstatic final floatstatic final doublestatic final doubleprivate Vec3private EntityDimensionsprotected static final AtomicIntegerprotected final SynchedEntityDataprivate floatdoubleprivate final List<Entity.Movement> protected booleanprotected static final intprotected static final intprivate static final intprotected static final intprivate static final intprivate static final intprivate static final intprivate final EntityFluidInteractionfloatstatic final intprivate booleanprivate booleanbooleanbooleanprivate intprivate @Nullable BlockStateprivate static final AABBprivate final InsideBlockEffectApplier.StepBasedCollectorprivate booleanintprivate booleanNeo: 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.booleanprivate intprivate @Nullable Vec3private Vec3private static final doubleprivate static final doubleprivate Levelprivate EntityInLevelCallbackprivate static final org.slf4j.Loggerprivate static final intstatic final intprivate static final doublestatic final intbooleanfloatprivate final ArrayDeque<Entity.Movement> booleanprivate floatbooleanprivate booleanprivate booleanprivate final VecDeltaCodecprivate com.google.common.collect.ImmutableList<Entity> private @Nullable CompoundTagprivate final double[]private longprivate int@Nullable PortalProcessorprivate Vec3protected final RandomSourceprivate intprivate @Nullable Entity.RemovalReasonprivate booleanprotected Stringprotected Vec3static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringintstatic final intprivate final EntityType<?> Deprecated.protected UUIDprivate @Nullable Entitybooleanbooleanprivate static doubleprivate final it.unimi.dsi.fastutil.longs.LongSetprotected booleanbooleanprotected booleanprivate static final doubledoubledoubleprivate floatfloatdoubledoubleprivate floatfloatdoubledoubleFields inherited from class AttachmentHolder
ATTACHMENTS_NBT_KEYFields inherited from interface ScoreHolder
WILDCARD, WILDCARD_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidabsSnapRotationTo(float yRot, float xRot) voidabsSnapTo(double x, double y, double z) voidabsSnapTo(double x, double y, double z, float yRot, float xRot) protected abstract voidaddAdditionalSaveData(ValueOutput output) voidaddDeltaMovement(Vec3 momentum) private voidaddMovementThisTick(Entity.Movement movement) protected voidaddPassenger(Entity passenger) booleanadjustSpawnLocation(ServerLevel level, BlockPos spawnSuggestion) voidanimateHurt(float direction) final voidprotected voidprivate voidapplyEffectsFromBlocks(List<Entity.Movement> movements) voidapplyEffectsFromBlocks(Vec3 from, Vec3 to) protected voidprotected voidprotected <T> booleanapplyImplicitComponent(DataComponentType<T> type, T value) protected <T> booleanapplyImplicitComponentIfPresent(DataComponentGetter components, DataComponentType<T> type) protected voidapplyImplicitComponents(DataComponentGetter components) private voidapplyMovementEmissionAndPlaySound(Entity.MovementEmission emission, Vec3 clippedMovement, BlockPos effectPos, BlockState effectState) private doubleapplyPistonMovementRestriction(Direction.Axis axis, double amount) private booleanattemptToShearEquipment(Player player, InteractionHand hand, ItemStack heldItem, Mob target) voidawardKillScore(Entity victim, DamageSource killingBlow) voidbaseTick()@Nullable ComponentbooleanbroadcastToPlayer(ServerPlayer player) private TeleportTransitioncalculatePassengerTransition(TeleportTransition transition, Entity passenger) protected final Vec3calculateUpVector(float xRot, float yRot) final Vec3calculateViewVector(float xRot, float yRot) protected booleancanAddPassenger(Entity passenger) booleancanBeCollidedWith(@Nullable Entity other) booleanbooleancanCollideWith(Entity entity) booleanbooleanbooleanprotected booleanbooleanbooleanbooleanbooleancanTeleport(Level from, Level to) booleancanTrample(ServerLevel level, BlockState state, BlockPos pos, double fallDistance) booleancanUsePortal(boolean ignorePassenger) @Nullable Collection<ItemEntity> @Nullable Collection<ItemEntity> captureDrops(@Nullable Collection<ItemEntity> value) protected static <T> @Nullable TcastComponentValue(DataComponentType<T> type, @Nullable Object value) booleancauseFallDamage(double fallDistance, float damageModifier, DamageSource damageSource) voidvoidprotected voidcheckFallDamage(double ya, boolean onGround, BlockState onState, BlockPos pos) voidprivate voidcheckInsideBlocks(List<Entity.Movement> movements, InsideBlockEffectApplier.StepBasedCollector effectCollector) private intcheckInsideBlocks(Vec3 from, Vec3 to, InsideBlockEffectApplier.StepBasedCollector effectCollector, it.unimi.dsi.fastutil.longs.LongSet visitedBlocks, int maxMovementIterations) protected voidcheckSupportingBlock(boolean onGround, @Nullable Vec3 movement) voidvoidprotected voidbooleancloserThan(Entity other, double distance) booleancloserThan(Entity other, double distanceXZ, double distanceY) static List<VoxelShape> collectAllColliders(@Nullable Entity source, Level level, AABB boundingBox) private static float[]collectCandidateStepUpHeights(AABB boundingBox, List<VoxelShape> colliders, float maxStepHeight, float stepHeightToSkip) private static List<VoxelShape> collectColliders(@Nullable Entity source, Level level, List<VoxelShape> entityColliders, AABB boundingBox) private Vec3static Vec3collideBoundingBox(@Nullable Entity source, Vec3 movement, AABB boundingBox, Level level, List<VoxelShape> entityColliders) booleancollidedWithFluid(FluidState fluidState, BlockPos blockPos, Vec3 from, Vec3 to) booleancollidedWithShapeMovingFrom(Vec3 from, Vec3 to, List<AABB> aabbs) private static Vec3collideWithShapes(Vec3 movement, AABB boundingBox, List<VoxelShape> shapes) protected voidprotected booleanconsidersEntityAsAlly(Entity other) voidcopyPosition(Entity target) protected booleanDeprecated.intprotected HoverEventbooleanprivate voiddebugBlockIntersection(ServerLevel level, BlockPos pos, boolean insideBlock, boolean insideFluid) protected abstract voiddefineSynchedData(SynchedEntityData.Builder entityData) deflection(Projectile projectile) final voiddiscard()booleanvoiddismountTo(double x, double y, double z) booleanfloatdistanceTo(Entity entity) doubledistanceToSqr(double x2, double y2, double z2) doubledistanceToSqr(Entity entity) doubledistanceToSqr(Vec3 pos) final voiddoCheckFallDamage(double xa, double ya, double za, boolean onGround) protected voidbooleandropAllLeashConnections(@Nullable Player player) voidbooleanvoidvoidfillCrashReportCategory(CrashReportCategory category) booleanprotected voidDeprecated.voidforceSetRotation(float yRot, boolean relativeY, float xRot, boolean relativeX) booleanfudgePositionAfterSizeChange(EntityDimensions previousDimensions) voidvoid<T> @Nullable Tget(DataComponentType<? extends T> type) getAddEntityPacket(ServerEntity serverEntity) intfinal EntityAttachmentsdoublegetAvailableSpaceBelow(double maxDistance) final floatfinal floatfloatgetBlockExplosionResistance(Explosion explosion, BlockGetter level, BlockPos pos, BlockState block, FluidState fluid, float resistance) protected floatprotected floatprotected BlockStateDeprecated.final intfinal intfinal intfinal AABBfinal <T, C extends @Nullable Object>
@Nullable TgetCapability(EntityCapability<T, C> capability, C context) final <T> @Nullable TgetCapability(EntityCapability<T, @Nullable Void> capability) protected static Vec3getCollisionHorizontalEscapeVector(double colliderWidth, double collidingWidth, float directionDegrees) @Nullable Entity@Nullable LivingEntity@Nullable Componentprotected doubleprotected static Vec3getDefaultPassengerAttachmentPoint(Entity vehicle, Entity passenger, EntityAttachments attachments) intgetDimensions(Pose pose) getDismountLocationForPassenger(LivingEntity passenger) final @Nullable Stringfinal floatfinal floatgetEyeHeight(Pose pose) final Vec3final Vec3getEyePosition(float partialTickTime) doublegetEyeY()protected int@Nullable EntitydoublegetFluidHeight(TagKey<Fluid> type) @Nullable AABBdoublefinal doublegetHandHoldingItemAngle(Item item) intgetId()protected static Vec3getInputVector(Vec3 input, float speed, float yRot) @Nullable InterpolationHandlerfloatDeprecated.getLightProbePosition(float partialTickTime) intintprotected Entity.MovementEmissiongetName()getOnPos()protected BlockPosgetOnPos(float offset) Deprecated.protected Vec3getPassengerAttachmentPoint(Entity passenger, EntityDimensions dimensions, float scale) getPassengerRidingPosition(Entity passenger) floatReturns a NBTTagCompound that can be used to store custom data for this entity.float@Nullable ItemStackintgetPose()final Vec3getPosition(float partialTickTime) floatgetPreciseBodyRotation(float partial) protected BlockPosgetPrimaryStepSoundBlockPos(BlockPos affectingPos) Vec3[]doublegetRandomX(double spread) doubledoublegetRandomY(double spread) doublegetRandomZ(double spread) getRelativePortalPosition(Direction.Axis axis, BlockUtil.FoundRectangle portalArea) int@Nullable Entity.RemovalReasonbooleangetRopeHoldPosition(float partialTickTime) protected booleangetSharedFlag(int flag) @Nullable SlotAccessgetSlot(int slot) protected SoundEventprotected SoundEventprotected SoundEvent@Nullable PlayerTeamgetTeam()intintintEntityType<?> getType()protected Componentfinal Vec3getUpVector(float a) getUUID()@Nullable EntitygetVehicleAttachmentPoint(Entity vehicle) static doublefinal Vec3getViewVector(float a) floatgetViewXRot(float a) floatgetViewYRot(float a) float@Nullable ItemStackfinal doublegetX()doublegetX(double progress) floatgetXRot()floatgetXRot(float partialTicks) final doublegetY()doublegetY(double progress) floatfloatgetYRot()floatgetYRot(float partialTicks) final doublegetZ()doublegetZ(double progress) voidhandleDamageEvent(DamageSource source) voidhandleEntityEvent(byte id) protected static voidhandleOnAboveBubbleColumn(Entity entity, boolean dragDown, BlockPos pos) protected static voidhandleOnInsideBubbleColumn(Entity entity, boolean dragDown) protected voidfinal booleanbooleanbooleanfinal booleaninthashCode()booleanhasIndirectPassenger(Entity entity) booleanbooleanhasPassenger(Predicate<Entity> test) booleanhasPassenger(Entity entity) booleanfinal voidhurt(DamageSource source, float damage) Deprecated.booleanhurtClient(DamageSource source) final booleanhurtOrSimulate(DamageSource source, float damage) Deprecated.abstract booleanhurtServer(ServerLevel level, DamageSource source, float damage) final voidigniteForSeconds(float numberOfSeconds) voidigniteForTicks(int numberOfTicks) booleanignoreExplosion(Explosion explosion) interact(Player player, InteractionHand hand, Vec3 location) booleanfinal booleanGets whether this entity has been added to a world (for tracking).protected booleanbooleanisAlive()final booleanisAlliedTo(@Nullable Entity other) booleanisAlliedTo(@Nullable Team other) booleanbooleanbooleanbooleanisColliding(BlockPos pos, BlockState state) booleanbooleanbooleanbooleanbooleanbooleanbooleanisEyeInFluid(TagKey<Fluid> type) protected booleanbooleanbooleanisFree(double xa, double ya, double za) private booleanbooleanbooleanprotected booleanisHorizontalCollisionMinor(Vec3 movement) booleanbooleanbooleanisInLava()boolean(package private) booleanisInRain()booleanfinal booleanbooleanbooleanisInvisibleTo(Player player) booleanprotected final booleanisInvulnerableToBase(DamageSource source) booleanisInWall()booleanbooleanprotected booleanfinal booleanbooleanbooleanisOnFire()booleanbooleanbooleanbooleanisPassengerOfSameVehicle(Entity other) booleanbooleanbooleanDeprecated.final booleanbooleanbooleanisSilent()booleanbooleanprivate booleanisStateClimbable(BlockState state) booleanbooleanisSupportedBy(BlockPos pos) booleanbooleanbooleanbooleanbooleanbooleanvoidkill(ServerLevel level) booleankilledEntity(ServerLevel level, LivingEntity entity, DamageSource source) voidlavaHurt()voidvoidlerpHeadTo(float yRot, int steps) voidlerpMotion(Vec3 movement) protected voidlerpPositionAndRotationStep(int stepsToTarget, double targetX, double targetY, double targetZ, double targetYRot, double targetXRot) level()protected Vec3limitPistonMovement(Vec3 vec) voidload(ValueInput input) voidlookAt(EntityAnchorArgument.Anchor anchor, Vec3 pos) protected final AABBprotected AABBmakeBoundingBox(Vec3 position) voidmakeStuckInBlock(BlockState blockState, Vec3 speedMultiplier) protected voidmarkHurt()floatprotected Vec3maybeBackOffFromEdge(Vec3 delta, MoverType moverType) booleanmayInteract(ServerLevel level, BlockPos pos) floatprotected @Nullable AABBmodifyPassengerFluidInteractionBox(AABB passengerBox) voidfinal voidmoveOrInterpolateTo(float yRot, float xRot) final voidfinal voidmoveOrInterpolateTo(Vec3 position) final voidmoveOrInterpolateTo(Vec3 position, float yRot, float xRot) voidmoveRelative(float speed, Vec3 input) protected voidmoveTowardsClosestSpace(double x, double y, double z) protected floatnextStep()voidnotifyLeasheeRemoved(Leashable entity) voidnotifyLeashHolder(Leashable entity) final Vec3voidonAboveBubbleColumn(boolean dragDown, BlockPos pos) voidCalled after the entity has been added to the world's ticking list.protected voidvoidvoidonExplosionHit(@Nullable Entity explosionCausedBy) protected voidonFlap()booleanonGround()protected voidonInsideBlock(BlockState state) voidonInsideBubbleColumn(boolean dragDown) voidonPassengerTurned(Entity passenger) voidonRemoval(Entity.RemovalReason reason) voidCalled after the entity has been removed to the world's ticking list.voidonSyncedDataUpdated(List<SynchedEntityData.DataValue<?>> updatedItems) voidonSyncedDataUpdated(EntityDataAccessor<?> accessor) pick(double range, float a, boolean withLiquids) voidplacePortalTicket(BlockPos ticketPosition) private voidprotected voidplayCombinationStepSounds(BlockState primaryStepSound, BlockState secondaryStepSound, BlockPos primaryPos, BlockPos secondaryPos) protected voidvoidplayerTouch(Player player) protected voidplayMuffledStepSound(BlockState blockState, BlockPos pos) voidplaySound(SoundEvent sound) voidplaySound(SoundEvent sound, float volume, float pitch) protected voidplayStepSound(BlockPos pos, BlockState blockState) protected voidplaySwimSound(float volume) position()final voidpositionRider(Entity passenger) protected voidpositionRider(Entity passenger, Entity.MoveFunction moveFunction) protected voidprotected voidprotected voidpropagateFallToPassengers(double fallDistance, float damageModifier, DamageSource damageSource) voidpush(double xa, double ya, double za) voidvoidprotected abstract voidreadAdditionalSaveData(ValueInput input) protected voidvoidvoidvoidregisterDebugValues(ServerLevel level, DebugValueSource.Registration registration) voidremove(Entity.RemovalReason reason) private static ComponentremoveAction(Component component) protected voidvoidprotected voidremovePassenger(Entity passenger) booleanvoidprotected booleanvoidvoidrestoreFrom(Entity oldEntity) voidrevive()Revives an entity that has been removed from a world.voidrideTick()floatbooleansave(ValueOutput output) booleansaveAsPassenger(ValueOutput output) voidsaveWithoutId(ValueOutput output) protected static voidsendBubbleColumnParticles(Level level, BlockPos pos) private voidvoidsetAirSupply(int supply) voidsetAsInsidePortal(Portal portal, BlockPos pos) final voidsetBoundingBox(AABB bb) <T> voidsetComponent(DataComponentType<T> type, T value) voidsetCustomName(@Nullable Component name) voidsetCustomNameVisible(boolean visible) final <T> @Nullable TsetData(AttachmentType<T> type, T data) Sets the data attachment of the given type.voidsetDeltaMovement(double xd, double yd, double zd) voidsetDeltaMovement(Vec3 deltaMovement) final voidsetGlowingTag(boolean value) voidsetId(int id) voidsetInvisible(boolean invisible) voidsetInvulnerable(boolean invulnerable) voidsetIsInPowderSnow(boolean isInPowderSnow) protected voidvoidsetLevelCallback(EntityInLevelCallback levelCallback) voidsetNoGravity(boolean noGravity) protected voidprivate voidfinal voidfinal voidsetOldPosAndRot(Vec3 position, float yRot, float xRot) voidprivate voidsetOldRot(float yRot, float xRot) voidsetOnGround(boolean onGround) voidsetOnGroundWithMovement(boolean onGround, boolean horizontalCollision, Vec3 movement) voidsetOnGroundWithMovement(boolean onGround, Vec3 movement) voidvoidsetPortalCooldown(int portalCooldown) voidsetPos(double x, double y, double z) final voidvoidfinal voidsetPosRaw(double x, double y, double z) voidsetRemainingFireTicks(int remainingTicks) final voidsetRemoved(Entity.RemovalReason reason) voidsetRequiresPrecisePosition(boolean requiresPrecisePosition) protected voidsetRot(float yRot, float xRot) protected voidsetSharedFlag(int flag, boolean value) voidsetSharedFlagOnFire(boolean value) voidsetShiftKeyDown(boolean shiftKeyDown) voidsetSilent(boolean silent) voidsetSprinting(boolean isSprinting) voidsetSwimming(boolean swimming) voidsetTicksFrozen(int ticks) voidstatic voidsetViewScale(double viewScale) voidsetXRot(float xRot) voidsetYBodyRot(float yBodyRot) voidsetYHeadRot(float yHeadRot) voidsetYRot(float yRot) booleanshearOffAllLeashConnections(@Nullable Player player) booleanbooleanshouldBlockExplode(Explosion explosion, BlockGetter level, BlockPos pos, BlockState state, float power) private booleanshouldPlayAmethystStepSound(BlockState affectingState) protected booleanbooleanshouldRender(double camX, double camY, double camZ) booleanshouldRenderAtSqrDistance(double distance) booleanbooleanbooleanskipAttackInteraction(Entity source) voidsnapTo(double x, double y, double z) voidsnapTo(double x, double y, double z, float yRot, float xRot) voidvoidvoid@Nullable ItemEntityspawnAtLocation(ServerLevel level, ItemStack itemStack) @Nullable ItemEntityspawnAtLocation(ServerLevel level, ItemStack itemStack, float offset) @Nullable ItemEntityspawnAtLocation(ServerLevel level, ItemStack itemStack, Vec3 offset) @Nullable ItemEntityspawnAtLocation(ServerLevel level, ItemLike resource) protected voidfinal booleanstartRiding(Entity entity) booleanstartRiding(Entity entityToRide, boolean force, boolean sendEventAndTriggers) voidstartSeenByPlayer(ServerPlayer player) voidvoidstopSeenByPlayer(ServerPlayer player) booleanfinal voidsyncData(AttachmentType<?> type) Syncs a data attachment of the given type with all relevant clients.voidsyncPacketPositionCodec(double x, double y, double z) @Nullable Entityteleport(TeleportTransition transition) private @Nullable EntityteleportCrossDimension(ServerLevel oldLevel, ServerLevel newLevel, TeleportTransition transition) private voidvoidteleportRelative(double dx, double dy, double dz) private EntityteleportSameDimension(ServerLevel level, TeleportTransition transition) voidteleportSetPosition(PositionMoveRotation destination, Set<Relative> relatives) voidteleportSetPosition(PositionMoveRotation currentValues, PositionMoveRotation destination, Set<Relative> relatives) protected voidteleportSpectators(TeleportTransition transition, ServerLevel oldLevel) voidteleportTo(double x, double y, double z) booleanteleportTo(ServerLevel level, double x, double y, double z, Set<Relative> relatives, float newYRot, float newXRot, boolean resetCamera) voidthunderHit(ServerLevel level, LightningBolt lightningBolt) voidtick()toString()booleanvoidturn(double xo, double yo) Holder<EntityType<?>> final voidunRide()protected voidvoidvoidprotected booleanvoidprivate booleanvibrationAndSoundEffectsFromBlock(BlockPos pos, BlockState blockState, boolean shouldSound, boolean shouldVibrate, Vec3 clippedMovement) private voidwalkingStepSound(BlockPos onPos, BlockState onState) protected voidMethods inherited from class AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, removeData, serializeAttachmentsMethods inherited from interface DataComponentGetter
get, getOrDefault, getOrDefault, getTyped, has, hasMethods inherited from interface IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData, syncDataMethods inherited from interface IEntityExtension
canBeRiddenUnderFluidType, canFluidExtinguish, canHydrateInFluidType, canRiderInteract, canSwimInFluidType, copyAttachmentsFrom, getClassification, getFluidFallDistanceModifier, getFluidMotionScale, getParts, getSoundFromFluidType, hasCustomOutlineRendering, isMultipartEntity, isPushedByFluid, sendPairingData, shouldRiderSitMethods inherited from interface ItemOwner
asLivingEntityMethods inherited from interface Nameable
getPlainTextNameMethods inherited from interface ScoreHolder
getFeedbackDisplayNameMethods inherited from interface SlotProvider
getSlotsFromRange
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
TAG_ID
- See Also:
-
TAG_UUID
- See Also:
-
TAG_PASSENGERS
- See Also:
-
TAG_DATA
- See Also:
-
TAG_POS
- See Also:
-
TAG_MOTION
- See Also:
-
TAG_ROTATION
- See Also:
-
TAG_PORTAL_COOLDOWN
- See Also:
-
TAG_NO_GRAVITY
- See Also:
-
TAG_AIR
- See Also:
-
TAG_ON_GROUND
- See Also:
-
TAG_FALL_DISTANCE
- See Also:
-
TAG_FIRE
- See Also:
-
TAG_SILENT
- See Also:
-
TAG_GLOWING
- See Also:
-
TAG_INVULNERABLE
- See Also:
-
TAG_CUSTOM_NAME
- See Also:
-
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
-
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
-
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. -
requiresPrecisePosition
private boolean requiresPrecisePosition -
id
private int id -
blocksBuilding
public boolean blocksBuilding -
passengers
-
boardingCooldown
protected int boardingCooldown -
vehicle
-
level
-
xo
public double xo -
yo
public double yo -
zo
public double zo -
position
-
blockPosition
-
chunkPosition
-
deltaMovement
-
yRot
private float yRot -
xRot
private float xRot -
yRotO
public float yRotO -
xRotO
public float xRotO -
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
-
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
-
tickCount
public int tickCount -
remainingFireTicks
private int remainingFireTicks -
fluidInteraction
-
wasTouchingWater
protected boolean wasTouchingWater -
wasEyeInWater
protected boolean wasEyeInWater -
invulnerableTime
public int invulnerableTime -
firstTick
protected boolean firstTick -
entityData
-
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
-
DATA_CUSTOM_NAME
-
DATA_CUSTOM_NAME_VISIBLE
-
DATA_SILENT
-
DATA_NO_GRAVITY
-
DATA_POSE
-
DATA_TICKS_FROZEN
-
levelCallback
-
packetPositionCodec
-
needsSync
public boolean needsSync -
portalProcess
-
portalCooldown
private int portalCooldown -
invulnerable
private boolean invulnerable -
uuid
-
stringUUID
-
hasGlowingTag
private boolean hasGlowingTag -
tags
-
pistonDeltas
private final double[] pistonDeltas -
pistonDeltasGameTime
private long pistonDeltasGameTime -
dimensions
-
eyeHeight
private float eyeHeight -
isInPowderSnow
public boolean isInPowderSnow -
wasInPowderSnow
public boolean wasInPowderSnow -
mainSupportingBlockPos
-
onGroundNoBlocks
private boolean onGroundNoBlocks -
crystalSoundIntensity
private float crystalSoundIntensity -
lastCrystalSoundPlayTick
private int lastCrystalSoundPlayTick -
hasVisualFire
private boolean hasVisualFire -
lastKnownSpeed
-
lastKnownPosition
-
inBlockState
-
MAX_MOVEMENTS_HANDELED_PER_TICK
public static final int MAX_MOVEMENTS_HANDELED_PER_TICK- See Also:
-
movementThisTick
-
finalMovementsThisTick
-
visitedBlocks
private final it.unimi.dsi.fastutil.longs.LongSet visitedBlocks -
insideEffectCollector
-
customData
-
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
andinvalid reference
#spawnAtLocation(ItemStack, float)ServerPlayer.drop(ItemStack, boolean, boolean)instead of adding them to the world. -
persistentData
-
isAddedToLevel
private boolean isAddedToLevelNeo: 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
-
Entity
-
-
Method Details
-
isColliding
-
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
-
getType
-
typeHolder
- Specified by:
typeHolderin interfaceTypedInstance<EntityType<?>>
-
getRequiresPrecisePosition
public boolean getRequiresPrecisePosition() -
setRequiresPrecisePosition
public void setRequiresPrecisePosition(boolean requiresPrecisePosition) -
getId
public int getId()- Specified by:
getIdin interfaceEntityAccess
-
setId
public void setId(int id) -
entityTags
-
addTag
-
removeTag
-
kill
-
discard
public final void discard() -
defineSynchedData
-
getEntityData
-
equals
-
hashCode
-
remove
-
onClientRemoval
public void onClientRemoval() -
onRemoval
-
setPose
-
getPose
-
hasPose
-
closerThan
-
closerThan
-
setRot
protected void setRot(float yRot, float xRot) -
setPos
-
setPos
public void setPos(double x, double y, double z) -
makeBoundingBox
-
makeBoundingBox
-
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() -
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
-
setOnGround
public void setOnGround(boolean onGround) -
setOnGroundWithMovement
-
setOnGroundWithMovement
-
isSupportedBy
-
checkSupportingBlock
-
onGround
public boolean onGround() -
move
-
applyMovementEmissionAndPlaySound
private void applyMovementEmissionAndPlaySound(Entity.MovementEmission emission, Vec3 clippedMovement, BlockPos effectPos, BlockState effectState) -
applyEffectsFromBlocks
protected void applyEffectsFromBlocks() -
applyEffectsFromBlocksForLastMovements
protected void applyEffectsFromBlocksForLastMovements() -
addMovementThisTick
-
removeLatestMovementRecording
public void removeLatestMovementRecording() -
clearMovementThisTick
protected void clearMovementThisTick() -
hasMovedHorizontallyRecently
public boolean hasMovedHorizontallyRecently() -
applyEffectsFromBlocks
-
applyEffectsFromBlocks
-
isAffectedByBlocks
protected boolean isAffectedByBlocks() -
isStateClimbable
-
vibrationAndSoundEffectsFromBlock
private boolean vibrationAndSoundEffectsFromBlock(BlockPos pos, BlockState blockState, boolean shouldSound, boolean shouldVibrate, Vec3 clippedMovement) -
isHorizontalCollisionMinor
-
playEntityOnFireExtinguishedSound
protected void playEntityOnFireExtinguishedSound() -
extinguishFire
public void extinguishFire() -
processFlappingMovement
protected void processFlappingMovement() -
getOnPosLegacy
Deprecated. -
getBlockPosBelowThatAffectsMyMovement
-
getOnPos
-
getOnPos
-
getBlockJumpFactor
protected float getBlockJumpFactor() -
getBlockSpeedFactor
protected float getBlockSpeedFactor() -
maybeBackOffFromEdge
-
limitPistonMovement
-
applyPistonMovementRestriction
-
getAvailableSpaceBelow
public double getAvailableSpaceBelow(double maxDistance) -
collide
-
collectCandidateStepUpHeights
private static float[] collectCandidateStepUpHeights(AABB boundingBox, List<VoxelShape> colliders, float maxStepHeight, float stepHeightToSkip) -
collideBoundingBox
-
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
-
nextStep
protected float nextStep() -
getSwimSound
-
getSwimSplashSound
-
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
-
collidedWithShapeMovingFrom
-
onInsideBlock
-
adjustSpawnLocation
-
gameEvent
-
gameEvent
-
walkingStepSound
-
waterSwimSound
protected void waterSwimSound() -
getPrimaryStepSoundBlockPos
-
playCombinationStepSounds
protected void playCombinationStepSounds(BlockState primaryStepSound, BlockState secondaryStepSound, BlockPos primaryPos, BlockPos secondaryPos) -
playMuffledStepSound
-
playStepSound
-
shouldPlayAmethystStepSound
-
playAmethystStepSound
private void playAmethystStepSound() -
playSwimSound
protected void playSwimSound(float volume) -
onFlap
protected void onFlap() -
isFlapping
protected boolean isFlapping() -
playSound
-
playSound
-
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
-
dampensVibrations
public boolean dampensVibrations() -
doCheckFallDamage
public final void doCheckFallDamage(double xa, double ya, double za, boolean onGround) -
checkFallDamage
-
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. -
getBlockStateOn
-
canSpawnSprintParticle
public boolean canSpawnSprintParticle() -
spawnSprintParticle
protected void spawnSprintParticle() -
isEyeInFluid
-
isInLava
public boolean isInLava() -
moveRelative
-
getInputVector
-
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
-
snapTo
public void snapTo(double x, double y, double z) -
snapTo
-
snapTo
-
snapTo
public void snapTo(double x, double y, double z, float yRot, float xRot) -
setOldPosAndRot
public final void setOldPosAndRot() -
setOldPosAndRot
-
setOldPos
protected void setOldPos() -
setOldRot
public void setOldRot() -
setOldPos
-
setOldRot
private void setOldRot(float yRot, float xRot) -
oldPosition
-
distanceTo
-
distanceToSqr
public double distanceToSqr(double x2, double y2, double z2) -
distanceToSqr
-
distanceToSqr
-
playerTouch
-
push
-
push
-
push
public void push(double xa, double ya, double za) -
markHurt
protected void markHurt() -
hurt
Deprecated. -
hurtOrSimulate
Deprecated. -
hurtServer
-
hurtClient
-
getViewVector
-
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
-
getUpVector
-
calculateUpVector
-
getEyePosition
-
getEyePosition
-
getLightProbePosition
-
getPosition
-
pick
-
canBeHitByProjectile
public boolean canBeHitByProjectile() -
isPickable
public boolean isPickable() -
isPushable
public boolean isPushable() -
awardKillScore
-
shouldRender
public boolean shouldRender(double camX, double camY, double camZ) -
shouldRenderAtSqrDistance
public boolean shouldRenderAtSqrDistance(double distance) -
saveAsPassenger
-
save
-
saveWithoutId
-
load
-
repositionEntityAfterLoad
protected boolean repositionEntityAfterLoad() -
getEncodeId
-
readAdditionalSaveData
-
addAdditionalSaveData
-
spawnAtLocation
-
spawnAtLocation
-
spawnAtLocation
-
spawnAtLocation
-
isAlive
public boolean isAlive() -
isInWall
public boolean isInWall() -
interact
-
shearOffAllLeashConnections
-
dropAllLeashConnections
-
attemptToShearEquipment
private boolean attemptToShearEquipment(Player player, InteractionHand hand, ItemStack heldItem, Mob target) -
canCollideWith
-
canBeCollidedWith
-
rideTick
public void rideTick() -
positionRider
-
positionRider
-
onPassengerTurned
-
getVehicleAttachmentPoint
-
getPassengerRidingPosition
-
getPassengerAttachmentPoint
protected Vec3 getPassengerAttachmentPoint(Entity passenger, EntityDimensions dimensions, float scale) -
getDefaultPassengerAttachmentPoint
protected static Vec3 getDefaultPassengerAttachmentPoint(Entity vehicle, Entity passenger, EntityAttachments attachments) -
startRiding
-
showVehicleHealth
public boolean showVehicleHealth() -
startRiding
-
canRide
-
ejectPassengers
public void ejectPassengers() -
removeVehicle
public void removeVehicle() -
stopRiding
public void stopRiding() -
addPassenger
-
removePassenger
-
canAddPassenger
-
couldAcceptPassenger
Deprecated.Forge: Userider sensitive version -
isInterpolating
public final boolean isInterpolating() -
moveOrInterpolateTo
-
moveOrInterpolateTo
public final void moveOrInterpolateTo(float yRot, float xRot) -
moveOrInterpolateTo
-
moveOrInterpolateTo
-
getInterpolation
-
lerpHeadTo
public void lerpHeadTo(float yRot, int steps) -
getPickRadius
public float getPickRadius() -
getLookAngle
-
getHeadLookAngle
-
getHandHoldingItemAngle
-
getRotationVector
-
getForward
-
setAsInsidePortal
-
handlePortal
protected void handlePortal() -
getDimensionChangingDelay
public int getDimensionChangingDelay() -
lerpMotion
-
handleDamageEvent
-
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
-
isOnRails
public boolean isOnRails() -
updateDynamicGameEventListener
public void updateDynamicGameEventListener(BiConsumer<DynamicGameEventListener<?>, ServerLevel> action) -
getTeam
-
isAlliedTo
-
considersEntityAsAlly
-
isAlliedTo
-
setInvisible
public void setInvisible(boolean invisible) -
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
-
onAboveBubbleColumn
-
handleOnAboveBubbleColumn
-
sendBubbleColumnParticles
-
onInsideBubbleColumn
public void onInsideBubbleColumn(boolean dragDown) -
handleOnInsideBubbleColumn
-
killedEntity
-
checkFallDistanceAccumulation
public void checkFallDistanceAccumulation() -
resetFallDistance
public void resetFallDistance() -
moveTowardsClosestSpace
protected void moveTowardsClosestSpace(double x, double y, double z) -
makeStuckInBlock
-
removeAction
-
getName
-
getTypeName
-
is
-
getYHeadRot
public float getYHeadRot() -
setYHeadRot
public void setYHeadRot(float yHeadRot) -
setYBodyRot
public void setYBodyRot(float yBodyRot) -
isAttackable
public boolean isAttackable() -
skipAttackInteraction
-
toString
-
isInvulnerableToBase
-
isInvulnerable
public boolean isInvulnerable() -
setInvulnerable
public void setInvulnerable(boolean invulnerable) -
copyPosition
-
restoreFrom
-
teleport
-
teleportSameDimension
-
teleportCrossDimension
private @Nullable Entity teleportCrossDimension(ServerLevel oldLevel, ServerLevel newLevel, TeleportTransition transition) -
teleportSpectators
-
calculatePassengerTransition
private TeleportTransition calculatePassengerTransition(TeleportTransition transition, Entity passenger) -
sendTeleportTransitionToRidingPlayers
-
teleportSetPosition
-
teleportSetPosition
public void teleportSetPosition(PositionMoveRotation currentValues, PositionMoveRotation destination, Set<Relative> relatives) -
forceSetRotation
public void forceSetRotation(float yRot, boolean relativeY, float xRot, boolean relativeX) -
placePortalTicket
-
removeAfterChangingDimensions
protected void removeAfterChangingDimensions() -
getRelativePortalPosition
-
canUsePortal
public boolean canUsePortal(boolean ignorePassenger) -
canTeleport
-
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
-
displayFireAnimation
public boolean displayFireAnimation() -
setUUID
-
getUUID
- Specified by:
getUUIDin interfaceUniquelyIdentifyable
-
getStringUUID
-
getScoreboardName
- Specified by:
getScoreboardNamein interfaceScoreHolder
-
isPushedByFluid
Deprecated. -
getViewScale
public static double getViewScale() -
setViewScale
public static void setViewScale(double viewScale) -
getDisplayName
- Specified by:
getDisplayNamein interfaceNameable- Specified by:
getDisplayNamein interfaceScoreHolder
-
setCustomName
-
getCustomName
- Specified by:
getCustomNamein interfaceNameable
-
hasCustomName
public boolean hasCustomName()- Specified by:
hasCustomNamein interfaceNameable
-
setCustomNameVisible
public void setCustomNameVisible(boolean visible) -
isCustomNameVisible
public boolean isCustomNameVisible() -
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
- Specified by:
onSyncedDataUpdatedin interfaceSyncedDataHolder
-
onSyncedDataUpdated
- Specified by:
onSyncedDataUpdatedin interfaceSyncedDataHolder
-
fixupDimensions
Deprecated. -
refreshDimensions
public void refreshDimensions() -
fudgePositionAfterSizeChange
-
getDirection
-
getMotionDirection
-
createHoverEvent
-
broadcastToPlayer
-
getBoundingBox
- Specified by:
getBoundingBoxin interfaceEntityAccess
-
setBoundingBox
-
getEyeHeight
-
getEyeHeight
public final float getEyeHeight() -
getSlot
- Specified by:
getSlotin interfaceSlotProvider
-
ignoreExplosion
-
startSeenByPlayer
-
stopSeenByPlayer
-
rotate
-
mirror
-
deflection
-
getControllingPassenger
-
hasControllingPassenger
public final boolean hasControllingPassenger() -
getPassengers
-
getFirstPassenger
-
hasPassenger
-
hasPassenger
-
getIndirectPassengersStream
-
getSelfAndPassengers
- Specified by:
getSelfAndPassengersin interfaceEntityAccess
-
getPassengersAndSelf
- Specified by:
getPassengersAndSelfin interfaceEntityAccess
-
getIndirectPassengers
-
countPlayerPassengers
public int countPlayerPassengers() -
hasExactlyOnePlayerPassenger
public boolean hasExactlyOnePlayerPassenger() -
getRootVehicle
-
isPassengerOfSameVehicle
-
hasIndirectPassenger
-
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
-
getVehicle
-
getControlledVehicle
-
getPistonPushReaction
-
getSoundSource
-
getFireImmuneTicks
protected int getFireImmuneTicks() -
createCommandSourceStackForNameResolution
-
lookAt
-
getPreciseBodyRotation
public float getPreciseBodyRotation(float partial) -
touchingUnloadedChunk
public boolean touchingUnloadedChunk() -
getFluidHeight
-
getFluidJumpThreshold
public double getFluidJumpThreshold() -
getBbWidth
public final float getBbWidth() -
getBbHeight
public final float getBbHeight() -
getAddEntityPacket
-
getDimensions
-
getAttachments
-
position
-
trackingPosition
-
blockPosition
- Specified by:
blockPositionin interfaceEntityAccess
-
getInBlockState
-
chunkPosition
-
getDeltaMovement
-
setDeltaMovement
-
addDeltaMovement
-
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
-
supportQuadLeashAsHolder
public boolean supportQuadLeashAsHolder() -
notifyLeashHolder
-
notifyLeasheeRemoved
-
getRopeHoldPosition
-
recreateFromPacket
-
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:
getVisualRotationYInDegreesin interfaceItemOwner
-
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
-
isRemoved
public final boolean isRemoved()- Specified by:
isRemovedin interfaceUniquelyIdentifyable
-
getRemovalReason
-
setRemoved
- Specified by:
setRemovedin interfaceEntityAccess
-
unsetRemoved
protected void unsetRemoved() -
setLevelCallback
- Specified by:
setLevelCallbackin interfaceEntityAccess
-
shouldBeSaved
public boolean shouldBeSaved()- Specified by:
shouldBeSavedin interfaceEntityAccess
-
isAlwaysTicking
public boolean isAlwaysTicking()- Specified by:
isAlwaysTickingin interfaceEntityAccess
-
mayInteract
-
captureDrops
- Specified by:
captureDropsin interfaceIEntityExtension
-
captureDrops
- Specified by:
captureDropsin interfaceIEntityExtension
-
getPersistentData
Description copied from interface:IEntityExtensionReturns 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:
getPersistentDatain interfaceIEntityExtension- Returns:
- A NBTTagCompound
-
canTrample
Description copied from interface:IEntityExtension- Specified by:
canTramplein interfaceIEntityExtension- Parameters:
pos- The block posfallDistance- The fall distance- Returns:
trueif this entity can trample,falseotherwise
-
isAddedToLevel
public final boolean isAddedToLevel()Description copied from interface:IEntityExtensionGets 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:
isAddedToLevelin interfaceIEntityExtension- Returns:
- True if this entity is being tracked by a world
-
onAddedToLevel
public void onAddedToLevel()Description copied from interface:IEntityExtensionCalled after the entity has been added to the world's ticking list.- Specified by:
onAddedToLevelin interfaceIEntityExtension
-
onRemovedFromLevel
public void onRemovedFromLevel()Description copied from interface:IEntityExtensionCalled after the entity has been removed to the world's ticking list.- Specified by:
onRemovedFromLevelin interfaceIEntityExtension
-
revive
public void revive()Description copied from interface:IEntityExtensionRevives 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:
revivein interfaceIEntityExtension
-
setData
Description copied from interface:IAttachmentHolderSets the data attachment of the given type.- Specified by:
setDatain interfaceIAttachmentHolder- Overrides:
setDatain classAttachmentHolder- Returns:
- the previous value for that attachment type, if any, or
nullif there was none
-
syncData
Description copied from interface:IAttachmentHolderSyncs 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:
syncDatain interfaceIAttachmentHolder- See Also:
-
getCapability
public final <T, C extends @Nullable Object> @Nullable T getCapability(EntityCapability<T, C> capability, C context) -
getCapability
-
isFlyingVehicle
public boolean isFlyingVehicle() -
level
-
setLevel
-
damageSources
-
registryAccess
-
lerpPositionAndRotationStep
protected void lerpPositionAndRotationStep(int stepsToTarget, double targetX, double targetY, double targetZ, double targetYRot, double targetXRot) -
getRandom
-
getKnownMovement
-
getKnownSpeed
-
getWeaponItem
-
getLootTable
-
applyImplicitComponents
-
applyComponentsFromItemStack
-
get
- Specified by:
getin interfaceDataComponentGetter
-
castComponentValue
@Contract("_,!null->!null;_,_->_") protected static <T> @Nullable T castComponentValue(DataComponentType<T> type, @Nullable Object value) -
setComponent
-
applyImplicitComponent
-
applyImplicitComponentIfPresent
protected <T> boolean applyImplicitComponentIfPresent(DataComponentGetter components, DataComponentType<T> type) -
problemPath
-
registerDebugValues
- Specified by:
registerDebugValuesin interfaceDebugValueSource
-
getFluidInteractionBox
-
modifyPassengerFluidInteractionBox
-
rider sensitive version