Package net.minecraft.world.entity
Class Entity
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.entity.Entity
- All Implemented Interfaces:
CommandSource,SyncedDataHolder,EntityAccess,Nameable,ScoreHolder,IAttachmentHolder,IEntityExtension,INBTSerializable<CompoundTag>
- Direct Known Subclasses:
AreaEffectCloud,BlockAttachedEntity,Display,EndCrystal,EvokerFangs,ExperienceOrb,EyeOfEnder,FallingBlockEntity,Interaction,ItemEntity,LightningBolt,LivingEntity,Marker,OminousItemSpawner,PartEntity,PrimedTnt,Projectile,VehicleEntity
public abstract class Entity
extends AttachmentHolder
implements SyncedDataHolder, Nameable, EntityAccess, CommandSource, ScoreHolder, IEntityExtension
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic enumstatic enumNested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
AttachmentHolder.AsField -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intprivate AABBprivate BlockPosbooleanstatic final intprotected intprivate Collection<ItemEntity> Neo: Short-lived holder of dropped item entities.private ChunkPosstatic final intprivate floatprivate 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 floatfloatprotected booleanprotected static final intprotected static final intprivate static final intprotected static final intprivate static final intprivate static final intprivate static final intDeprecated.Deprecated.floatprotected it.unimi.dsi.fastutil.objects.Object2DoubleMap<FluidType> private FluidTypestatic final intprivate booleanbooleanprivate booleanbooleanbooleanprivate intstatic final Stringprivate BlockStateprivate static final AABBprivate 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 static final doubleprivate static final doubleprivate Levelprivate EntityInLevelCallbackprivate static final org.slf4j.Loggerstatic final intbooleanfloatprivate floatbooleanbooleanprivate booleanprivate booleanprivate final VecDeltaCodecprivate com.google.common.collect.ImmutableList<Entity> static final Stringprivate CompoundTagprivate final double[]private longprivate intprivate Vec3protected final RandomSourceprivate intprivate Entity.RemovalReasonprotected Stringprotected Vec3intstatic final intprivate final EntityType<?> Deprecated.protected UUIDstatic final Stringprivate Entitybooleanbooleanprivate static doublefloatfloatprotected booleanbooleanbooleanprotected booleanprivate static final doubledoubledoubleprivate floatfloatdoubledoubleprivate floatfloatdoubledoubleFields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEYFields inherited from interface net.minecraft.commands.CommandSource
NULLFields inherited from interface net.minecraft.world.scores.ScoreHolder
WILDCARD, WILDCARD_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidabsMoveTo(double x, double y, double z) voidabsMoveTo(double x, double y, double z, float yRot, float xRot) Sets position and rotation, clamping and wrapping params to valid values.voidabsRotateTo(float yRot, float xRot) booleanbooleanprotected abstract voidaddAdditionalSaveData(CompoundTag compound) voidaddDeltaMovement(Vec3 addend) protected voidaddPassenger(Entity passenger) booleanadjustSpawnLocation(ServerLevel level, BlockPos pos) voidanimateHurt(float yaw) protected voidprivate doubleapplyPistonMovementRestriction(Direction.Axis axis, double distance) voidawardKillScore(Entity killed, int scoreValue, DamageSource source) voidbaseTick()booleanbroadcastToPlayer(ServerPlayer player) protected final Vec3calculateUpVector(float xRot, float yRot) final Vec3calculateViewVector(float xRot, float yRot) Calculates the view vector using the X and Y rotation of an entity.protected booleancanAddPassenger(Entity passenger) booleanbooleanbooleancanChangeDimensions(Level oldLevel, Level newLevel) booleancanCollideWith(Entity entity) booleanbooleanprotected booleanbooleanbooleanbooleancanTrample(BlockState state, BlockPos pos, float fallDistance) booleancanUsePortal(boolean allowPassengers) captureDrops(Collection<ItemEntity> value) booleancauseFallDamage(float fallDistance, float multiplier, DamageSource source) changeDimension(DimensionTransition transition) voidvoidprotected voidcheckFallDamage(double y, boolean onGround, BlockState state, BlockPos pos) protected voidvoidprotected voidcheckSupportingBlock(boolean onGround, Vec3 movement) voidbooleancloserThan(Entity entity, double distance) booleancloserThan(Entity entity, double horizontalDistance, double verticalDistance) private static float[]collectCandidateStepUpHeights(AABB box, List<VoxelShape> colliders, float deltaY, float maxUpStep) private static List<VoxelShape> collectColliders(Entity entity, Level level, List<VoxelShape> collisions, AABB boundingBox) private Vec3Given a motion vector, return an updated vector that takes into account restrictions such as collisions (from all directions) and step-up from stepHeightstatic Vec3collideBoundingBox(Entity entity, Vec3 vec, AABB collisionBox, Level level, List<VoxelShape> potentialHits) private static Vec3collideWithShapes(Vec3 deltaMovement, AABB entityBB, List<VoxelShape> shapes) voidcopyPosition(Entity entity) Sets this entity's location and angles to the location and angles of the passed in entity.protected booleanDeprecated.intprotected HoverEventbooleanprotected abstract voiddeflection(Projectile projectile) final voiddiscard()booleanvoiddismountTo(double x, double y, double z) booleanfloatdistanceTo(Entity entity) Returns the distance to the entity.doubledistanceToSqr(double x, double y, double z) Gets the squared distance to the position.doubledistanceToSqr(Entity entity) Returns the squared distance to the entity.doubledistanceToSqr(Vec3 vec) protected voidvoidbooleanvoidvoidfillCrashReportCategory(CrashReportCategory category) booleanprotected voidDeprecated.booleanfudgePositionAfterSizeChange(EntityDimensions dimensions) voidvoidgetAddEntityPacket(ServerEntity entity) intfinal EntityAttachmentsfinal floatfinal floatfloatgetBlockExplosionResistance(Explosion explosion, BlockGetter level, BlockPos pos, BlockState blockState, FluidState fluidState, float explosionPower) Explosion resistance of a block relative to this entityprotected floatprotected floatprotected BlockStateDeprecated.final intfinal intfinal intfinal AABBfinal <T,C extends @Nullable Object>
TgetCapability(EntityCapability<T, C> capability, C context) final <T> TgetCapability(EntityCapability<T, @Nullable Void> capability) protected static Vec3getCollisionHorizontalEscapeVector(double vehicleWidth, double passengerWidth, float yRot) protected doubleprotected static Vec3getDefaultPassengerAttachmentPoint(Entity vehicle, Entity passenger, EntityAttachments attachments) intgetDimensions(Pose pose) getDismountLocationForPassenger(LivingEntity passenger) final Stringfinal floatfinal floatgetEyeHeight(Pose pose) final FluidTypeReturns the fluid that is on the entity's eyes.final Vec3final Vec3getEyePosition(float partialTicks) doublegetEyeY()protected intdoublegetFluidHeight(TagKey<Fluid> fluidTag) Deprecated.doublefinal doublegetFluidTypeHeight(FluidType type) Returns the height of the fluid type in relation to the bounding box of the entity.final doublegetHandHoldingItemAngle(Item item) intgetId()private static Vec3getInputVector(Vec3 relative, float motionScaler, float facing) protected Vec3getLeashOffset(float partialTick) floatDeprecated.getLightProbePosition(float partialTicks) intintReturns the fluid type which is the highest on the bounding box of the entity.protected Entity.MovementEmissiongetName()getOnPos()protected BlockPosgetOnPos(float yOffset) Deprecated.protected Vec3getPassengerAttachmentPoint(Entity entity, EntityDimensions dimensions, float partialTick) getPassengerRidingPosition(Entity entity) floatprotected intReturns a NBTTagCompound that can be used to store custom data for this entity.floatintgetPose()final Vec3getPosition(float partialTicks) floatgetPreciseBodyRotation(float partialTick) protected BlockPosdoublegetRandomX(double scale) doubledoublegetRandomZ(double scale) getRelativePortalPosition(Direction.Axis axis, BlockUtil.FoundRectangle portal) intgetRopeHoldPosition(float partialTicks) protected booleangetSharedFlag(int flag) Returnstrueif the flag is active for the entity.getSlot(int slot) protected SoundEventprotected SoundEventprotected SoundEventgetTags()getTeam()intintintEntityType<?> getType()protected Componentfinal Vec3getUpVector(float partialTicks) getUUID()getVehicleAttachmentPoint(Entity entity) static doublefinal Vec3getViewVector(float partialTicks) Gets the interpolated look vector.floatgetViewXRot(float partialTicks) Returns the current X rotation of the entity.floatgetViewYRot(float partialTick) Returns the current Y rotation of the entity.floatfinal doublegetX()doublegetX(double scale) floatgetXRot()final doublegetY()doublegetY(double scale) floatfloatgetYRot()final doublegetZ()doublegetZ(double scale) voidhandleDamageEvent(DamageSource damageSource) voidhandleEntityEvent(byte id) Handles an entity event received from aClientboundEntityEventPacket.protected voidfinal booleanbooleanbooleanfinal booleaninthashCode()booleanhasIndirectPassenger(Entity p_entity) booleanhasPassenger(Predicate<Entity> predicate) booleanhasPassenger(Entity entity) booleanhasPermissions(int level) booleanbooleanhurt(DamageSource source, float amount) Called when the entity is attacked.final voidigniteForSeconds(float seconds) voidigniteForTicks(int ticks) booleanignoreExplosion(Explosion explosion) interact(Player player, InteractionHand hand) interactAt(Player player, Vec3 vec, InteractionHand hand) Applies the given player interaction to this Entity.booleanReturnstrueif Entity argument is equal to this Entityfinal booleanGets whether this entity has been added to a world (for tracking).booleanisAlive()booleanisAlliedTo(Entity entity) Returns whether this Entity is on the same team as the given Entity.booleanisAlliedTo(Team team) Returns whether this Entity is on the given scoreboard team.booleanbooleanbooleanisColliding(BlockPos pos, BlockState state) booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanisEyeInFluid(TagKey<Fluid> fluidTag) Deprecated.protected booleanbooleanisFree(double x, double y, double z) Checks if the offset position from the entity's current position has a collision with a block or a liquid.private booleanDetermines if the entity has no collision with a block or a liquid within the specified bounding box.booleanbooleanprotected booleanisHorizontalCollisionMinor(Vec3 deltaMovement) booleanprivate booleanfinal booleanReturns whether the entity is in a fluid.final booleanisInFluidType(BiPredicate<FluidType, Double> predicate, boolean forAllTypes) Returns whether the fluid type the entity is currently in matches the specified condition.booleanisInLava()booleanprivate booleanisInRain()booleanbooleanisInvisibleTo(Player player) Only used by renderer in EntityLivingBase subclasses.booleanbooleanisInvulnerableTo(DamageSource source) Returns whether this Entity is invulnerable to the given DamageSource.booleanisInWall()booleanbooleanbooleanbooleanbooleanbooleanisOnFire()booleanbooleanbooleanbooleanisPassengerOfSameVehicle(Entity entity) booleanbooleanbooleanDeprecated.final booleanbooleanbooleanisSilent()booleanbooleanprivate booleanisStateClimbable(BlockState state) booleanbooleanisSupportedBy(BlockPos pos) booleanbooleanbooleanbooleanbooleanbooleanvoidkill()booleankilledEntity(ServerLevel level, LivingEntity entity) voidlavaHurt()voidlerpHeadTo(float yaw, int pitch) voidlerpMotion(double x, double y, double z) Updates the entity motion clientside, called by packets from the serverprotected voidlerpPositionAndRotationStep(int steps, double targetX, double targetY, double targetZ, double targetYRot, double targetXRot) doublefloatdoublefloatdoublevoidlerpTo(double x, double y, double z, float yRot, float xRot, int steps) level()protected Vec3limitPistonMovement(Vec3 pos) voidload(CompoundTag compound) Reads the entity from NBT (calls an abstract helper method to read specialized data)voidlookAt(EntityAnchorArgument.Anchor anchor, Vec3 target) protected AABBvoidmakeStuckInBlock(BlockState state, Vec3 motionMultiplier) protected voidmarkHurt()floatprotected Vec3maybeBackOffFromEdge(Vec3 vec, MoverType mover) booleanmayInteract(Level level, BlockPos pos) floatTransforms the entity's current yaw with the given Mirror and returns it.voidvoidmoveRelative(float amount, Vec3 relative) voidmoveTo(double x, double y, double z) voidmoveTo(double x, double y, double z, float yRot, float xRot) Sets the location and rotation of the entity in the world.voidvoidvoidprotected voidmoveTowardsClosestSpace(double x, double y, double z) protected ListTagnewDoubleList(double... numbers) creates a NBT list from the array of doubles passed to this functionprotected ListTagnewFloatList(float... numbers) Returns a new NBTTagList filled with the specified floatsprotected floatnextStep()voidonAboveBubbleCol(boolean downwards) voidCalled after the entity has been added to the world's ticking list.protected voidvoidvoidonExplosionHit(Entity entity) protected voidonFlap()booleanonGround()protected voidonInsideBlock(BlockState state) voidonInsideBubbleColumn(boolean downwards) booleanvoidonPassengerTurned(Entity entityToUpdate) Applies this entity's orientation to another entity.voidCalled after the entity has been removed to the world's ticking list.voidonSyncedDataUpdated(List<SynchedEntityData.DataValue<?>> dataValues) voidpick(double hitDistance, float partialTicks, boolean hitFluids) voidprivate voidprotected voidplayCombinationStepSounds(BlockState primaryState, BlockState secondaryState, BlockPos primaryPos, BlockPos secondaryPos) protected voidvoidplayerTouch(Player player) Called by a player entity when they collide with an entityprotected voidplayMuffledStepSound(BlockState state, BlockPos pos) voidplaySound(SoundEvent sound) voidplaySound(SoundEvent sound, float volume, float pitch) protected voidplayStepSound(BlockPos pos, BlockState state) protected voidplaySwimSound(float volume) position()final voidpositionRider(Entity passenger) protected voidpositionRider(Entity passenger, Entity.MoveFunction callback) protected voidprotected voidvoidpush(double x, double y, double z) Adds to the current velocity of the entity, and setsto true.invalid reference
#isAirBornevoidApplies a velocity to the entities, to push them away from each other.voidprotected abstract voidreadAdditionalSaveData(CompoundTag compound) (abstract) Protected helper method to read subclass entity data from NBT.protected voidvoidvoidvoidremove(Entity.RemovalReason reason) private static ComponentremoveAction(Component name) protected voidprotected voidremovePassenger(Entity passenger) booleanvoidprotected booleanvoidvoidrestoreFrom(Entity entity) Prepares this entity in new dimension by copying NBT data from entity in old dimensionvoidrevive()Revives an entity that has been removed from a world.voidrideTick()floatTransforms the entity's current yaw with the given Rotation and returns it.booleansave(CompoundTag compound) Writes this entity to NBT, unless it has been removed or it is a passenger.booleansaveAsPassenger(CompoundTag compound) Writes this entity to NBT, unless it has been removed.saveWithoutId(CompoundTag compound) Writes this entity, including passengers, to NBT, regardless as to whether it is removed or a passenger.voidsendSystemMessage(Component component) voidsetAirSupply(int air) voidsetAsInsidePortal(Portal portal, BlockPos pos) final voidsetBoundingBox(AABB bb) voidsetCustomName(Component name) voidsetCustomNameVisible(boolean alwaysRenderNameTag) final <T> TsetData(AttachmentType<T> type, T data) Sets the data attachment of the given type.voidsetDeltaMovement(double x, double y, double z) voidsetDeltaMovement(Vec3 deltaMovement) protected final voidsetFluidTypeHeight(FluidType type, double height) final voidsetGlowingTag(boolean hasGlowingTag) voidsetId(int id) voidsetInvisible(boolean invisible) voidsetInvulnerable(boolean isInvulnerable) Sets whether this Entity is invulnerable.voidsetIsInPowderSnow(boolean isInPowderSnow) protected voidvoidsetLevelCallback(EntityInLevelCallback levelCallback) voidsetNoGravity(boolean noGravity) final voidvoidsetOnGround(boolean onGround) voidsetOnGroundWithMovement(boolean onGround, Vec3 movement) voidvoidsetPortalCooldown(int portalCooldown) voidsetPos(double x, double y, double z) Sets the x,y,z of the entity from the given parameters.final voidvoidfinal voidsetPosRaw(double x, double y, double z) Directly updates the,invalid reference
#posX, andinvalid reference
posYfields, without performing any collision checks, updating the bounding box position, or sending any packets.invalid reference
posZvoidsetRemainingFireTicks(int remainingFireTicks) final voidsetRemoved(Entity.RemovalReason removalReason) protected voidsetRot(float yRot, float xRot) Sets the rotation of the entity.protected voidsetSharedFlag(int flag, boolean set) Enable or disable an entity flag, seeto read the known flags.invalid reference
#getEntityFlagvoidsetSharedFlagOnFire(boolean isOnFire) voidsetShiftKeyDown(boolean keyDown) voidsetSilent(boolean isSilent) When set to true the entity will not play sounds.voidsetSprinting(boolean sprinting) Set sprinting switch for Entity.voidsetSwimming(boolean swimming) voidsetTicksFrozen(int ticksFrozen) voidstatic voidsetViewScale(double renderDistWeight) voidsetXRot(float xRot) Sets the rotation of this entity around the x-axis (the pitch) in degrees.voidsetYBodyRot(float yBodyRot) Set the body Y rotation of the entity.voidsetYHeadRot(float yHeadRot) Sets the head's Y rotation of the entity.voidsetYRot(float yRot) Sets the rotation of this entity around the y-axis (the yaw) in degrees.booleanbooleanshouldBlockExplode(Explosion explosion, BlockGetter level, BlockPos pos, BlockState blockState, float explosionPower) booleanprivate booleanbooleanshouldRender(double x, double y, double z) booleanshouldRenderAtSqrDistance(double distance) Checks if the entity is in range to render.booleanbooleanbooleanskipAttackInteraction(Entity entity) Called when a player attacks an entity.spawnAtLocation(ItemStack stack) spawnAtLocation(ItemStack stack, float offsetY) Drops an item at the position of the entity.spawnAtLocation(ItemLike item) spawnAtLocation(ItemLike item, int offsetY) protected voidbooleanstartRiding(Entity vehicle) booleanstartRiding(Entity vehicle, boolean force) voidstartSeenByPlayer(ServerPlayer serverPlayer) Add the given player to the list of players tracking this entity.voidvoidstopSeenByPlayer(ServerPlayer serverPlayer) Removes the given player from the list of players tracking this entity.voidsyncPacketPositionCodec(double x, double y, double z) private voidvoidteleportRelative(double dx, double dy, double dz) voidteleportTo(double x, double y, double z) Sets the position of the entity and updates the 'last' variablesbooleanteleportTo(ServerLevel level, double x, double y, double z, Set<RelativeMovement> relativeMovements, float yRot, float xRot) voidthunderHit(ServerLevel level, LightningBolt lightning) voidtick()toString()booleanprotected voidvoidturn(double yRot, double xRot) final voidunRide()protected voidvoidupdateDynamicGameEventListener(BiConsumer<DynamicGameEventListener<?>, ServerLevel> listenerConsumer) voidbooleanupdateFluidHeightAndDoFluidPushing(TagKey<Fluid> fluidTag, double motionScale) Deprecated.private voidprotected boolean(package private) voidvoidprivate booleanvibrationAndSoundEffectsFromBlock(BlockPos pos, BlockState state, boolean playStepSound, boolean broadcastGameEvent, Vec3 entityPos) private voidwalkingStepSound(BlockPos pos, BlockState state) protected voidMethods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, removeData, serializeAttachmentsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.commands.CommandSource
alwaysAcceptsMethods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setDataMethods inherited from interface net.neoforged.neoforge.common.extensions.IEntityExtension
canBeRiddenUnderFluidType, canFluidExtinguish, canHydrateInFluidType, canRiderInteract, canStartSwimming, canSwimInFluidType, copyAttachmentsFrom, deserializeNBT, getClassification, getFluidFallDistanceModifier, getFluidMotionScale, getParts, getPickedResult, getSoundFromFluidType, hasCustomOutlineRendering, isEyeInFluidType, isInFluidType, isInFluidType, isInFluidType, isMultipartEntity, isPushedByFluid, sendPairingData, serializeNBT, shouldRiderSitMethods inherited from interface net.minecraft.world.scores.ScoreHolder
getFeedbackDisplayName
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
ID_TAG
- See Also:
-
PASSENGERS_TAG
- 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:
-
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:
-
UUID_TAG
- See Also:
-
viewScale
private static double viewScale -
type
Deprecated. -
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:
-
walkDistO
public float walkDistO -
walkDist
public float walkDist -
moveDist
public float moveDist -
flyDist
public float flyDist -
fallDistance
public float fallDistance -
nextStep
private float nextStep -
xOld
public double xOld -
yOld
public double yOld -
zOld
public double zOld -
noPhysics
public boolean noPhysics -
random
-
tickCount
public int tickCount -
remainingFireTicks
private int remainingFireTicks -
wasTouchingWater
protected boolean wasTouchingWater -
fluidHeight
Deprecated. -
wasEyeInWater
protected boolean wasEyeInWater -
fluidOnEyes
Deprecated. -
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
-
noCulling
public boolean noCulling -
hasImpulse
public boolean hasImpulse -
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 -
wasOnFire
public boolean wasOnFire -
mainSupportingBlockPos
-
onGroundNoBlocks
private boolean onGroundNoBlocks -
crystalSoundIntensity
private float crystalSoundIntensity -
lastCrystalSoundPlayTick
private int lastCrystalSoundPlayTick -
hasVisualFire
private boolean hasVisualFire -
inBlockState
-
captureDrops
Neo: Short-lived holder of dropped item entities. Used mainly for Neo hooks and event logic.When not null, records all item entities from
spawnAtLocation(ItemStack, float)andServerPlayer.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. -
forgeFluidTypeHeight
-
forgeFluidTypeOnEyes
-
-
Constructor Details
-
Entity
-
-
Method Details
-
isColliding
-
getTeamColor
public int getTeamColor() -
isSpectator
public boolean isSpectator() -
unRide
public final void unRide() -
syncPacketPositionCodec
public void syncPacketPositionCodec(double x, double y, double z) -
getPositionCodec
-
getType
-
getId
public int getId()- Specified by:
getIdin interfaceEntityAccess
-
setId
public void setId(int id) -
getTags
-
addTag
-
removeTag
-
kill
public void kill() -
discard
public final void discard() -
defineSynchedData
-
getEntityData
-
equals
-
hashCode
public int hashCode() -
remove
-
onClientRemoval
public void onClientRemoval() -
setPose
-
getPose
-
hasPose
-
closerThan
-
closerThan
-
setRot
protected void setRot(float yRot, float xRot) Sets the rotation of the entity. -
setPos
-
setPos
public void setPos(double x, double y, double z) Sets the x,y,z of the entity from the given parameters. Also seems to set up a bounding box. -
makeBoundingBox
-
reapplyPosition
protected void reapplyPosition() -
turn
public void turn(double yRot, double xRot) -
tick
public void tick() -
baseTick
public void baseTick() -
checkBelowWorld
public void checkBelowWorld() -
setPortalCooldown
public void setPortalCooldown() -
setPortalCooldown
public void setPortalCooldown(int portalCooldown) -
getPortalCooldown
public int getPortalCooldown() -
isOnPortalCooldown
public boolean isOnPortalCooldown() -
processPortalCooldown
protected void processPortalCooldown() -
lavaHurt
public void lavaHurt() -
igniteForSeconds
public final void igniteForSeconds(float seconds) -
igniteForTicks
public void igniteForTicks(int ticks) -
setRemainingFireTicks
public void setRemainingFireTicks(int remainingFireTicks) -
getRemainingFireTicks
public int getRemainingFireTicks() -
clearFire
public void clearFire() -
onBelowWorld
protected void onBelowWorld() -
isFree
public boolean isFree(double x, double y, double z) Checks if the offset position from the entity's current position has a collision with a block or a liquid. -
isFree
Determines if the entity has no collision with a block or a liquid within the specified bounding box. -
setOnGround
public void setOnGround(boolean onGround) -
setOnGroundWithMovement
-
isSupportedBy
-
checkSupportingBlock
-
onGround
public boolean onGround() -
move
-
isStateClimbable
-
vibrationAndSoundEffectsFromBlock
private boolean vibrationAndSoundEffectsFromBlock(BlockPos pos, BlockState state, boolean playStepSound, boolean broadcastGameEvent, Vec3 entityPos) -
isHorizontalCollisionMinor
-
tryCheckInsideBlocks
protected void tryCheckInsideBlocks() -
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
-
collide
Given a motion vector, return an updated vector that takes into account restrictions such as collisions (from all directions) and step-up from stepHeight -
collectCandidateStepUpHeights
private static float[] collectCandidateStepUpHeights(AABB box, List<VoxelShape> colliders, float deltaY, float maxUpStep) -
collideBoundingBox
-
collectColliders
private static List<VoxelShape> collectColliders(@Nullable Entity entity, Level level, List<VoxelShape> collisions, AABB boundingBox) -
collideWithShapes
-
nextStep
protected float nextStep() -
getSwimSound
-
getSwimSplashSound
-
getSwimHighSpeedSplashSound
-
checkInsideBlocks
protected void checkInsideBlocks() -
onInsideBlock
-
adjustSpawnLocation
-
gameEvent
-
gameEvent
-
walkingStepSound
-
waterSwimSound
protected void waterSwimSound() -
getPrimaryStepSoundBlockPos
-
playCombinationStepSounds
protected void playCombinationStepSounds(BlockState primaryState, BlockState secondaryState, 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 isSilent) When set to true the entity will not play sounds. -
isNoGravity
public boolean isNoGravity() -
setNoGravity
public void setNoGravity(boolean noGravity) -
getDefaultGravity
protected double getDefaultGravity() -
getGravity
public final double getGravity() -
applyGravity
protected void applyGravity() -
getMovementEmission
-
dampensVibrations
public boolean dampensVibrations() -
checkFallDamage
-
fireImmune
public boolean fireImmune() -
causeFallDamage
-
isInWater
public boolean isInWater() -
isInRain
private boolean isInRain() -
isInBubbleColumn
private boolean isInBubbleColumn() -
isInWaterOrRain
public boolean isInWaterOrRain() -
isInWaterRainOrBubble
public boolean isInWaterRainOrBubble() -
isInWaterOrBubble
public boolean isInWaterOrBubble() -
isInLiquid
public boolean isInLiquid() -
isUnderWater
public boolean isUnderWater() -
updateSwimming
public void updateSwimming() -
updateInWaterStateAndDoFluidPushing
protected boolean updateInWaterStateAndDoFluidPushing() -
updateInWaterStateAndDoWaterCurrentPushing
void updateInWaterStateAndDoWaterCurrentPushing() -
updateFluidOnEyes
private void updateFluidOnEyes() -
doWaterSplashEffect
protected void doWaterSplashEffect() -
getBlockStateOnLegacy
Deprecated. -
getBlockStateOn
-
canSpawnSprintParticle
public boolean canSpawnSprintParticle() -
spawnSprintParticle
protected void spawnSprintParticle() -
isEyeInFluid
Deprecated. -
isInLava
public boolean isInLava() -
moveRelative
-
getInputVector
-
getLightLevelDependentMagicValue
Deprecated. -
absMoveTo
public void absMoveTo(double x, double y, double z, float yRot, float xRot) Sets position and rotation, clamping and wrapping params to valid values. Used by network code. -
absRotateTo
public void absRotateTo(float yRot, float xRot) -
absMoveTo
public void absMoveTo(double x, double y, double z) -
moveTo
-
moveTo
public void moveTo(double x, double y, double z) -
moveTo
-
moveTo
-
moveTo
public void moveTo(double x, double y, double z, float yRot, float xRot) Sets the location and rotation of the entity in the world. -
setOldPosAndRot
public final void setOldPosAndRot() -
distanceTo
Returns the distance to the entity. -
distanceToSqr
public double distanceToSqr(double x, double y, double z) Gets the squared distance to the position. -
distanceToSqr
Returns the squared distance to the entity. -
distanceToSqr
-
playerTouch
Called by a player entity when they collide with an entity -
push
Applies a velocity to the entities, to push them away from each other. -
push
-
push
public void push(double x, double y, double z) Adds to the current velocity of the entity, and setsto true.invalid reference
#isAirBorne -
markHurt
protected void markHurt() -
hurt
Called when the entity is attacked. -
getViewVector
Gets the interpolated look vector. -
getNearestViewDirection
-
getViewXRot
public float getViewXRot(float partialTicks) Returns the current X rotation of the entity. -
getViewYRot
public float getViewYRot(float partialTick) Returns the current Y rotation of the entity. -
calculateViewVector
Calculates the view vector using the X and Y rotation of an entity. -
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 x, double y, double z) -
shouldRenderAtSqrDistance
public boolean shouldRenderAtSqrDistance(double distance) Checks if the entity is in range to render. -
saveAsPassenger
Writes this entity to NBT, unless it has been removed. Also writes this entity's passengers, and the entity type ID (so the produced NBT is sufficient to recreate the entity). Generally,orinvalid reference
#writeUnlessPassengershould be used instead of this method.invalid reference
#writeWithoutTypeId- Returns:
- True if the entity was written (and the passed compound should be saved)" false if the entity was not written.
-
save
Writes this entity to NBT, unless it has been removed or it is a passenger. Also writes this entity's passengers, and the entity type ID (so the produced NBT is sufficient to recreate the entity). To always write the entity, use.invalid reference
#writeWithoutTypeId- Returns:
- True if the entity was written (and the passed compound should be saved)" false if the entity was not written.
-
saveWithoutId
Writes this entity, including passengers, to NBT, regardless as to whether it is removed or a passenger. Does not include the entity's type ID, so the NBT is insufficient to recreate the entity using. Useinvalid reference
AnvilChunkLoader#readWorldEntityfor that purpose.invalid reference
#writeUnlessPassenger -
load
Reads the entity from NBT (calls an abstract helper method to read specialized data) -
repositionEntityAfterLoad
protected boolean repositionEntityAfterLoad() -
getEncodeId
-
readAdditionalSaveData
(abstract) Protected helper method to read subclass entity data from NBT. -
addAdditionalSaveData
-
newDoubleList
creates a NBT list from the array of doubles passed to this function -
newFloatList
Returns a new NBTTagList filled with the specified floats -
spawnAtLocation
-
spawnAtLocation
-
spawnAtLocation
-
spawnAtLocation
Drops an item at the position of the entity. -
isAlive
public boolean isAlive() -
isInWall
public boolean isInWall() -
interact
-
canCollideWith
-
canBeCollidedWith
public boolean canBeCollidedWith() -
rideTick
public void rideTick() -
positionRider
-
positionRider
-
onPassengerTurned
Applies this entity's orientation to another entity. Used to update passenger orientation. -
getVehicleAttachmentPoint
-
getPassengerRidingPosition
-
getPassengerAttachmentPoint
protected Vec3 getPassengerAttachmentPoint(Entity entity, EntityDimensions dimensions, float partialTick) -
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 -
lerpTo
public void lerpTo(double x, double y, double z, float yRot, float xRot, int steps) -
lerpTargetX
public double lerpTargetX() -
lerpTargetY
public double lerpTargetY() -
lerpTargetZ
public double lerpTargetZ() -
lerpTargetXRot
public float lerpTargetXRot() -
lerpTargetYRot
public float lerpTargetYRot() -
lerpHeadTo
public void lerpHeadTo(float yaw, int pitch) -
getPickRadius
public float getPickRadius() -
getLookAngle
-
getHandHoldingItemAngle
-
getRotationVector
-
getForward
-
setAsInsidePortal
-
handlePortal
protected void handlePortal() -
getDimensionChangingDelay
public int getDimensionChangingDelay() -
lerpMotion
public void lerpMotion(double x, double y, double z) Updates the entity motion clientside, called by packets from the server -
handleDamageEvent
-
handleEntityEvent
public void handleEntityEvent(byte id) Handles an entity event received from aClientboundEntityEventPacket. -
animateHurt
public void animateHurt(float yaw) -
isOnFire
public boolean isOnFire() -
isPassenger
public boolean isPassenger() -
isVehicle
public boolean isVehicle() -
dismountsUnderwater
public boolean dismountsUnderwater() -
canControlVehicle
public boolean canControlVehicle() -
setShiftKeyDown
public void setShiftKeyDown(boolean keyDown) -
isShiftKeyDown
public boolean isShiftKeyDown() -
isSteppingCarefully
public boolean isSteppingCarefully() -
isSuppressingBounce
public boolean isSuppressingBounce() -
isDiscrete
public boolean isDiscrete() -
isDescending
public boolean isDescending() -
isCrouching
public boolean isCrouching() -
isSprinting
public boolean isSprinting() -
setSprinting
public void setSprinting(boolean sprinting) Set sprinting switch for Entity. -
isSwimming
public boolean isSwimming() -
isVisuallySwimming
public boolean isVisuallySwimming() -
isVisuallyCrawling
public boolean isVisuallyCrawling() -
setSwimming
public void setSwimming(boolean swimming) -
hasGlowingTag
public final boolean hasGlowingTag() -
setGlowingTag
public final void setGlowingTag(boolean hasGlowingTag) -
isCurrentlyGlowing
public boolean isCurrentlyGlowing() -
isInvisible
public boolean isInvisible() -
isInvisibleTo
Only used by renderer in EntityLivingBase subclasses. Determines if an entity is visible or not to a specific player, if the entity is normally invisible. For EntityLivingBase subclasses, returning false when invisible will render the entity semi-transparent. -
isOnRails
public boolean isOnRails() -
updateDynamicGameEventListener
public void updateDynamicGameEventListener(BiConsumer<DynamicGameEventListener<?>, ServerLevel> listenerConsumer) -
getTeam
-
isAlliedTo
Returns whether this Entity is on the same team as the given Entity. -
isAlliedTo
Returns whether this Entity is on the given scoreboard team. -
setInvisible
public void setInvisible(boolean invisible) -
getMaxAirSupply
public int getMaxAirSupply() -
getAirSupply
public int getAirSupply() -
setAirSupply
public void setAirSupply(int air) -
getTicksFrozen
public int getTicksFrozen() -
setTicksFrozen
public void setTicksFrozen(int ticksFrozen) -
getPercentFrozen
public float getPercentFrozen() -
isFullyFrozen
public boolean isFullyFrozen() -
getTicksRequiredToFreeze
public int getTicksRequiredToFreeze() -
thunderHit
-
onAboveBubbleCol
public void onAboveBubbleCol(boolean downwards) -
onInsideBubbleColumn
public void onInsideBubbleColumn(boolean downwards) -
killedEntity
-
checkSlowFallDistance
public void checkSlowFallDistance() -
resetFallDistance
public void resetFallDistance() -
moveTowardsClosestSpace
protected void moveTowardsClosestSpace(double x, double y, double z) -
makeStuckInBlock
-
removeAction
-
getName
-
getTypeName
-
is
Returnstrueif Entity argument is equal to this Entity -
getYHeadRot
public float getYHeadRot() -
setYHeadRot
public void setYHeadRot(float yHeadRot) Sets the head's Y rotation of the entity. -
setYBodyRot
public void setYBodyRot(float yBodyRot) Set the body Y rotation of the entity. -
isAttackable
public boolean isAttackable() -
skipAttackInteraction
Called when a player attacks an entity. If this returns true the attack will not happen. -
toString
-
isInvulnerableTo
Returns whether this Entity is invulnerable to the given DamageSource. -
isInvulnerable
public boolean isInvulnerable() -
setInvulnerable
public void setInvulnerable(boolean isInvulnerable) Sets whether this Entity is invulnerable. -
copyPosition
Sets this entity's location and angles to the location and angles of the passed in entity. -
restoreFrom
Prepares this entity in new dimension by copying NBT data from entity in old dimension -
changeDimension
-
placePortalTicket
-
removeAfterChangingDimensions
protected void removeAfterChangingDimensions() -
getRelativePortalPosition
-
canUsePortal
public boolean canUsePortal(boolean allowPassengers) -
canChangeDimensions
-
getBlockExplosionResistance
public float getBlockExplosionResistance(Explosion explosion, BlockGetter level, BlockPos pos, BlockState blockState, FluidState fluidState, float explosionPower) Explosion resistance of a block relative to this entity -
shouldBlockExplode
public boolean shouldBlockExplode(Explosion explosion, BlockGetter level, BlockPos pos, BlockState blockState, float explosionPower) -
getMaxFallDistance
public int getMaxFallDistance() -
isIgnoringBlockTriggers
public boolean isIgnoringBlockTriggers() -
fillCrashReportCategory
-
displayFireAnimation
public boolean displayFireAnimation() -
setUUID
-
getUUID
- Specified by:
getUUIDin interfaceEntityAccess
-
getStringUUID
-
getScoreboardName
- Specified by:
getScoreboardNamein interfaceScoreHolder
-
isPushedByFluid
Deprecated. -
getViewScale
public static double getViewScale() -
setViewScale
public static void setViewScale(double renderDistWeight) -
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 alwaysRenderNameTag) -
isCustomNameVisible
public boolean isCustomNameVisible() -
teleportTo
public boolean teleportTo(ServerLevel level, double x, double y, double z, Set<RelativeMovement> relativeMovements, float yRot, float xRot) -
dismountTo
public void dismountTo(double x, double y, double z) -
teleportTo
public void teleportTo(double x, double y, double z) Sets the position of the entity and updates the 'last' variables -
teleportPassengers
private void teleportPassengers() -
teleportRelative
public void teleportRelative(double dx, double dy, double dz) -
shouldShowName
public boolean shouldShowName() -
onSyncedDataUpdated
- 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
-
getBoundingBoxForCulling
-
setBoundingBox
-
getEyeHeight
-
getEyeHeight
public final float getEyeHeight() -
getLeashOffset
-
getLeashOffset
-
getSlot
-
sendSystemMessage
- Specified by:
sendSystemMessagein interfaceCommandSource
-
getCommandSenderWorld
-
getServer
-
interactAt
Applies the given player interaction to this Entity. -
ignoreExplosion
-
startSeenByPlayer
Add the given player to the list of players tracking this entity. For instance, a player may track a boss in order to view its associated boss bar. -
stopSeenByPlayer
Removes the given player from the list of players tracking this entity. Seefor more information on tracking.invalid reference
Entity#addTrackingPlayer -
rotate
Transforms the entity's current yaw with the given Rotation and returns it. This does not have a side-effect. -
mirror
Transforms the entity's current yaw with the given Mirror and returns it. This does not have a side-effect. -
onlyOpCanSetNbt
public boolean onlyOpCanSetNbt() -
deflection
-
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
-
isControlledByLocalInstance
public boolean isControlledByLocalInstance() -
isEffectiveAi
public boolean isEffectiveAi() -
getCollisionHorizontalEscapeVector
protected static Vec3 getCollisionHorizontalEscapeVector(double vehicleWidth, double passengerWidth, float yRot) -
getDismountLocationForPassenger
-
getVehicle
-
getControlledVehicle
-
getPistonPushReaction
-
getSoundSource
-
getFireImmuneTicks
protected int getFireImmuneTicks() -
createCommandSourceStack
-
getPermissionLevel
protected int getPermissionLevel() -
hasPermissions
public boolean hasPermissions(int level) -
acceptsSuccess
public boolean acceptsSuccess()- Specified by:
acceptsSuccessin interfaceCommandSource
-
acceptsFailure
public boolean acceptsFailure()- Specified by:
acceptsFailurein interfaceCommandSource
-
shouldInformAdmins
public boolean shouldInformAdmins()- Specified by:
shouldInformAdminsin interfaceCommandSource
-
lookAt
-
getPreciseBodyRotation
public float getPreciseBodyRotation(float partialTick) -
updateFluidHeightAndDoFluidPushing
@Deprecated public boolean updateFluidHeightAndDoFluidPushing(TagKey<Fluid> fluidTag, double motionScale) Deprecated. -
updateFluidHeightAndDoFluidPushing
public void updateFluidHeightAndDoFluidPushing() -
touchingUnloadedChunk
public boolean touchingUnloadedChunk() -
getFluidHeight
Deprecated. -
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 x, double y, double z) -
getBlockX
public final int getBlockX() -
getX
public final double getX() -
getX
public double getX(double scale) -
getRandomX
public double getRandomX(double scale) -
getBlockY
public final int getBlockY() -
getY
public final double getY() -
getY
public double getY(double scale) -
getRandomY
public double getRandomY() -
getEyeY
public double getEyeY() -
getBlockZ
public final int getBlockZ() -
getZ
public final double getZ() -
getZ
public double getZ(double scale) -
getRandomZ
public double getRandomZ(double scale) -
setPosRaw
public final void setPosRaw(double x, double y, double z) Directly updates the,invalid reference
#posX, andinvalid reference
posYfields, without performing any collision checks, updating the bounding box position, or sending any packets. In general, this is not what you want andinvalid reference
posZis better, as that handles the bounding box.invalid reference
#setPosition -
checkDespawn
public void checkDespawn() -
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() -
setYRot
public void setYRot(float yRot) Sets the rotation of this entity around the y-axis (the yaw) in degrees. -
getXRot
public float getXRot() -
setXRot
public void setXRot(float xRot) Sets the rotation of this entity around the x-axis (the pitch) in degrees. -
canSprint
public boolean canSprint() -
maxUpStep
public float maxUpStep() -
onExplosionHit
-
isRemoved
public final boolean isRemoved() -
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
-
setFluidTypeHeight
-
getFluidTypeHeight
Description copied from interface:IEntityExtensionReturns the height of the fluid type in relation to the bounding box of the entity. If the entity is not in the fluid type, then0is returned.- Specified by:
getFluidTypeHeightin interfaceIEntityExtension- Parameters:
type- the type of the fluid- Returns:
- the height of the fluid compared to the entity
-
isInFluidType
Description copied from interface:IEntityExtensionReturns whether the fluid type the entity is currently in matches the specified condition.- Specified by:
isInFluidTypein interfaceIEntityExtension- Parameters:
predicate- a test taking in the fluid type and its heightforAllTypes-trueif all fluid types should match the condition instead of at least one- Returns:
trueif a fluid type meets the condition,falseotherwise
-
isInFluidType
public final boolean isInFluidType()Description copied from interface:IEntityExtensionReturns whether the entity is in a fluid.- Specified by:
isInFluidTypein interfaceIEntityExtension- Returns:
trueif the entity is in a fluid,falseotherwise
-
getEyeInFluidType
Description copied from interface:IEntityExtensionReturns the fluid that is on the entity's eyes.- Specified by:
getEyeInFluidTypein interfaceIEntityExtension- Returns:
- the fluid that is on the entity's eyes
-
getMaxHeightFluidType
Description copied from interface:IEntityExtensionReturns the fluid type which is the highest on the bounding box of the entity.- Specified by:
getMaxHeightFluidTypein interfaceIEntityExtension- Returns:
- the fluid type which is the highest on the bounding box of the entity
-
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
-
getCapability
@Nullable public final <T,C extends @Nullable Object> T getCapability(EntityCapability<T, C> capability, C context) -
getCapability
-
level
-
setLevel
-
damageSources
-
registryAccess
-
lerpPositionAndRotationStep
protected void lerpPositionAndRotationStep(int steps, double targetX, double targetY, double targetZ, double targetYRot, double targetXRot) -
getRandom
-
getKnownMovement
-
getWeaponItem
-
rider sensitive version