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 interface
static enum
static enum
Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
AttachmentHolder.AsField
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
private AABB
private BlockPos
boolean
static final int
protected int
private Collection
<ItemEntity> Neo: Short-lived holder of dropped item entities.private ChunkPos
static final int
private float
private 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 float
static final float
static final float
static final double
static final double
private Vec3
private EntityDimensions
protected static final AtomicInteger
protected final SynchedEntityData
private float
float
protected boolean
protected static final int
protected static final int
private static final int
protected static final int
private static final int
private static final int
private static final int
Deprecated.Deprecated.float
protected it.unimi.dsi.fastutil.objects.Object2DoubleMap
<FluidType> private FluidType
static final int
private boolean
boolean
private boolean
boolean
boolean
private int
static final String
private BlockState
private static final AABB
private boolean
int
private boolean
Neo: Internal use for keeping track of entities that are tracked by a world, to allow guarantees that entity position changes will force a chunk load, avoiding potential issues with entity desyncing and bad chunk data.boolean
private int
private static final double
private static final double
private Level
private EntityInLevelCallback
private static final org.slf4j.Logger
static final int
boolean
float
private float
boolean
boolean
private boolean
private boolean
private final VecDeltaCodec
private com.google.common.collect.ImmutableList
<Entity> static final String
private CompoundTag
private final double[]
private long
private int
private Vec3
protected final RandomSource
private int
private Entity.RemovalReason
protected String
protected Vec3
int
static final int
private final EntityType
<?> Deprecated.protected UUID
static final String
private Entity
boolean
boolean
private static double
float
float
protected boolean
boolean
boolean
protected boolean
private static final double
double
double
private float
float
double
double
private float
float
double
double
Fields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEY
Fields inherited from interface net.minecraft.commands.CommandSource
NULL
Fields inherited from interface net.minecraft.world.scores.ScoreHolder
WILDCARD, WILDCARD_NAME
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
absMoveTo
(double x, double y, double z) void
absMoveTo
(double x, double y, double z, float yRot, float xRot) Sets position and rotation, clamping and wrapping params to valid values.void
absRotateTo
(float yRot, float xRot) boolean
boolean
protected abstract void
addAdditionalSaveData
(CompoundTag compound) void
addDeltaMovement
(Vec3 addend) protected void
addPassenger
(Entity passenger) boolean
adjustSpawnLocation
(ServerLevel level, BlockPos pos) void
animateHurt
(float yaw) protected void
private double
applyPistonMovementRestriction
(Direction.Axis axis, double distance) void
awardKillScore
(Entity killed, int scoreValue, DamageSource source) void
baseTick()
boolean
broadcastToPlayer
(ServerPlayer player) protected final Vec3
calculateUpVector
(float xRot, float yRot) final Vec3
calculateViewVector
(float xRot, float yRot) Calculates the view vector using the X and Y rotation of an entity.protected boolean
canAddPassenger
(Entity passenger) boolean
boolean
boolean
canChangeDimensions
(Level oldLevel, Level newLevel) boolean
canCollideWith
(Entity entity) boolean
boolean
protected boolean
boolean
boolean
boolean
canTrample
(BlockState state, BlockPos pos, float fallDistance) boolean
canUsePortal
(boolean allowPassengers) captureDrops
(Collection<ItemEntity> value) boolean
causeFallDamage
(float fallDistance, float multiplier, DamageSource source) changeDimension
(DimensionTransition transition) void
void
protected void
checkFallDamage
(double y, boolean onGround, BlockState state, BlockPos pos) protected void
void
protected void
checkSupportingBlock
(boolean onGround, Vec3 movement) void
boolean
closerThan
(Entity entity, double distance) boolean
closerThan
(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 Vec3
Given a motion vector, return an updated vector that takes into account restrictions such as collisions (from all directions) and step-up from stepHeightstatic Vec3
collideBoundingBox
(Entity entity, Vec3 vec, AABB collisionBox, Level level, List<VoxelShape> potentialHits) private static Vec3
collideWithShapes
(Vec3 deltaMovement, AABB entityBB, List<VoxelShape> shapes) void
copyPosition
(Entity entity) Sets this entity's location and angles to the location and angles of the passed in entity.protected boolean
Deprecated.int
protected HoverEvent
boolean
protected abstract void
deflection
(Projectile projectile) final void
discard()
boolean
void
dismountTo
(double x, double y, double z) boolean
float
distanceTo
(Entity entity) Returns the distance to the entity.double
distanceToSqr
(double x, double y, double z) Gets the squared distance to the position.double
distanceToSqr
(Entity entity) Returns the squared distance to the entity.double
distanceToSqr
(Vec3 vec) protected void
void
boolean
void
void
fillCrashReportCategory
(CrashReportCategory category) boolean
protected void
Deprecated.boolean
fudgePositionAfterSizeChange
(EntityDimensions dimensions) void
void
getAddEntityPacket
(ServerEntity entity) int
final EntityAttachments
final float
final float
float
getBlockExplosionResistance
(Explosion explosion, BlockGetter level, BlockPos pos, BlockState blockState, FluidState fluidState, float explosionPower) Explosion resistance of a block relative to this entityprotected float
protected float
protected BlockState
Deprecated.final int
final int
final int
final AABB
final <T,
C extends @Nullable Object>
TgetCapability
(EntityCapability<T, C> capability, C context) final <T> T
getCapability
(EntityCapability<T, @Nullable Void> capability) protected static Vec3
getCollisionHorizontalEscapeVector
(double vehicleWidth, double passengerWidth, float yRot) protected double
protected static Vec3
getDefaultPassengerAttachmentPoint
(Entity vehicle, Entity passenger, EntityAttachments attachments) int
getDimensions
(Pose pose) getDismountLocationForPassenger
(LivingEntity passenger) final String
final float
final float
getEyeHeight
(Pose pose) final FluidType
Returns the fluid that is on the entity's eyes.final Vec3
final Vec3
getEyePosition
(float partialTicks) double
getEyeY()
protected int
double
getFluidHeight
(TagKey<Fluid> fluidTag) Deprecated.double
final double
getFluidTypeHeight
(FluidType type) Returns the height of the fluid type in relation to the bounding box of the entity.final double
getHandHoldingItemAngle
(Item item) int
getId()
private static Vec3
getInputVector
(Vec3 relative, float motionScaler, float facing) protected Vec3
getLeashOffset
(float partialTick) float
Deprecated.getLightProbePosition
(float partialTicks) int
int
Returns the fluid type which is the highest on the bounding box of the entity.protected Entity.MovementEmission
getName()
getOnPos()
protected BlockPos
getOnPos
(float yOffset) Deprecated.protected Vec3
getPassengerAttachmentPoint
(Entity entity, EntityDimensions dimensions, float partialTick) getPassengerRidingPosition
(Entity entity) float
protected int
Returns a NBTTagCompound that can be used to store custom data for this entity.float
int
getPose()
final Vec3
getPosition
(float partialTicks) float
getPreciseBodyRotation
(float partialTick) protected BlockPos
double
getRandomX
(double scale) double
double
getRandomZ
(double scale) getRelativePortalPosition
(Direction.Axis axis, BlockUtil.FoundRectangle portal) int
getRopeHoldPosition
(float partialTicks) protected boolean
getSharedFlag
(int flag) Returnstrue
if the flag is active for the entity.getSlot
(int slot) protected SoundEvent
protected SoundEvent
protected SoundEvent
getTags()
getTeam()
int
int
int
EntityType
<?> getType()
protected Component
final Vec3
getUpVector
(float partialTicks) getUUID()
getVehicleAttachmentPoint
(Entity entity) static double
final Vec3
getViewVector
(float partialTicks) Gets the interpolated look vector.float
getViewXRot
(float partialTicks) Returns the current X rotation of the entity.float
getViewYRot
(float partialTick) Returns the current Y rotation of the entity.float
final double
getX()
double
getX
(double scale) float
getXRot()
final double
getY()
double
getY
(double scale) float
float
getYRot()
final double
getZ()
double
getZ
(double scale) void
handleDamageEvent
(DamageSource damageSource) void
handleEntityEvent
(byte id) Handles an entity event received from aClientboundEntityEventPacket
.protected void
final boolean
boolean
boolean
final boolean
int
hashCode()
boolean
hasIndirectPassenger
(Entity p_entity) boolean
hasPassenger
(Predicate<Entity> predicate) boolean
hasPassenger
(Entity entity) boolean
hasPermissions
(int level) boolean
boolean
hurt
(DamageSource source, float amount) Called when the entity is attacked.final void
igniteForSeconds
(float seconds) void
igniteForTicks
(int ticks) boolean
ignoreExplosion
(Explosion explosion) interact
(Player player, InteractionHand hand) interactAt
(Player player, Vec3 vec, InteractionHand hand) Applies the given player interaction to this Entity.boolean
Returnstrue
if Entity argument is equal to this Entityfinal boolean
Gets whether this entity has been added to a world (for tracking).boolean
isAlive()
boolean
isAlliedTo
(Entity entity) Returns whether this Entity is on the same team as the given Entity.boolean
isAlliedTo
(Team team) Returns whether this Entity is on the given scoreboard team.boolean
boolean
boolean
isColliding
(BlockPos pos, BlockState state) boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
isEyeInFluid
(TagKey<Fluid> fluidTag) Deprecated.protected boolean
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.private boolean
Determines if the entity has no collision with a block or a liquid within the specified bounding box.boolean
boolean
protected boolean
isHorizontalCollisionMinor
(Vec3 deltaMovement) boolean
private boolean
final boolean
Returns whether the entity is in a fluid.final boolean
isInFluidType
(BiPredicate<FluidType, Double> predicate, boolean forAllTypes) Returns whether the fluid type the entity is currently in matches the specified condition.boolean
isInLava()
boolean
private boolean
isInRain()
boolean
boolean
isInvisibleTo
(Player player) Only used by renderer in EntityLivingBase subclasses.boolean
boolean
isInvulnerableTo
(DamageSource source) Returns whether this Entity is invulnerable to the given DamageSource.boolean
isInWall()
boolean
boolean
boolean
boolean
boolean
boolean
isOnFire()
boolean
boolean
boolean
boolean
isPassengerOfSameVehicle
(Entity entity) boolean
boolean
boolean
Deprecated.final boolean
boolean
boolean
isSilent()
boolean
boolean
private boolean
isStateClimbable
(BlockState state) boolean
boolean
isSupportedBy
(BlockPos pos) boolean
boolean
boolean
boolean
boolean
boolean
void
kill()
boolean
killedEntity
(ServerLevel level, LivingEntity entity) void
lavaHurt()
void
lerpHeadTo
(float yaw, int pitch) void
lerpMotion
(double x, double y, double z) Updates the entity motion clientside, called by packets from the serverprotected void
lerpPositionAndRotationStep
(int steps, double targetX, double targetY, double targetZ, double targetYRot, double targetXRot) double
float
double
float
double
void
lerpTo
(double x, double y, double z, float yRot, float xRot, int steps) level()
protected Vec3
limitPistonMovement
(Vec3 pos) void
load
(CompoundTag compound) Reads the entity from NBT (calls an abstract helper method to read specialized data)void
lookAt
(EntityAnchorArgument.Anchor anchor, Vec3 target) protected AABB
void
makeStuckInBlock
(BlockState state, Vec3 motionMultiplier) protected void
markHurt()
float
protected Vec3
maybeBackOffFromEdge
(Vec3 vec, MoverType mover) boolean
mayInteract
(Level level, BlockPos pos) float
Transforms the entity's current yaw with the given Mirror and returns it.void
void
moveRelative
(float amount, Vec3 relative) void
moveTo
(double x, double y, double z) void
moveTo
(double x, double y, double z, float yRot, float xRot) Sets the location and rotation of the entity in the world.void
void
void
protected void
moveTowardsClosestSpace
(double x, double y, double z) protected ListTag
newDoubleList
(double... numbers) creates a NBT list from the array of doubles passed to this functionprotected ListTag
newFloatList
(float... numbers) Returns a new NBTTagList filled with the specified floatsprotected float
nextStep()
void
onAboveBubbleCol
(boolean downwards) void
Called after the entity has been added to the world's ticking list.protected void
void
void
onExplosionHit
(Entity entity) protected void
onFlap()
boolean
onGround()
protected void
onInsideBlock
(BlockState state) void
onInsideBubbleColumn
(boolean downwards) boolean
void
onPassengerTurned
(Entity entityToUpdate) Applies this entity's orientation to another entity.void
Called after the entity has been removed to the world's ticking list.void
onSyncedDataUpdated
(List<SynchedEntityData.DataValue<?>> dataValues) void
pick
(double hitDistance, float partialTicks, boolean hitFluids) void
private void
protected void
playCombinationStepSounds
(BlockState primaryState, BlockState secondaryState, BlockPos primaryPos, BlockPos secondaryPos) protected void
void
playerTouch
(Player player) Called by a player entity when they collide with an entityprotected void
playMuffledStepSound
(BlockState state, BlockPos pos) void
playSound
(SoundEvent sound) void
playSound
(SoundEvent sound, float volume, float pitch) protected void
playStepSound
(BlockPos pos, BlockState state) protected void
playSwimSound
(float volume) position()
final void
positionRider
(Entity passenger) protected void
positionRider
(Entity passenger, Entity.MoveFunction callback) protected void
protected void
void
push
(double x, double y, double z) Adds to the current velocity of the entity, and setsinvalid reference
#isAirBorne
void
Applies a velocity to the entities, to push them away from each other.void
protected abstract void
readAdditionalSaveData
(CompoundTag compound) (abstract) Protected helper method to read subclass entity data from NBT.protected void
void
void
void
remove
(Entity.RemovalReason reason) private static Component
removeAction
(Component name) protected void
protected void
removePassenger
(Entity passenger) boolean
void
protected boolean
void
void
restoreFrom
(Entity entity) Prepares this entity in new dimension by copying NBT data from entity in old dimensionvoid
revive()
Revives an entity that has been removed from a world.void
rideTick()
float
Transforms the entity's current yaw with the given Rotation and returns it.boolean
save
(CompoundTag compound) Writes this entity to NBT, unless it has been removed or it is a passenger.boolean
saveAsPassenger
(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.void
sendSystemMessage
(Component component) void
setAirSupply
(int air) void
setAsInsidePortal
(Portal portal, BlockPos pos) final void
setBoundingBox
(AABB bb) void
setCustomName
(Component name) void
setCustomNameVisible
(boolean alwaysRenderNameTag) final <T> T
setData
(AttachmentType<T> type, T data) Sets the data attachment of the given type.void
setDeltaMovement
(double x, double y, double z) void
setDeltaMovement
(Vec3 deltaMovement) protected final void
setFluidTypeHeight
(FluidType type, double height) final void
setGlowingTag
(boolean hasGlowingTag) void
setId
(int id) void
setInvisible
(boolean invisible) void
setInvulnerable
(boolean isInvulnerable) Sets whether this Entity is invulnerable.void
setIsInPowderSnow
(boolean isInPowderSnow) protected void
void
setLevelCallback
(EntityInLevelCallback levelCallback) void
setNoGravity
(boolean noGravity) final void
void
setOnGround
(boolean onGround) void
setOnGroundWithMovement
(boolean onGround, Vec3 movement) void
void
setPortalCooldown
(int portalCooldown) void
setPos
(double x, double y, double z) Sets the x,y,z of the entity from the given parameters.final void
void
final void
setPosRaw
(double x, double y, double z) Directly updates theinvalid reference
#posX
invalid reference
posY
invalid reference
posZ
void
setRemainingFireTicks
(int remainingFireTicks) final void
setRemoved
(Entity.RemovalReason removalReason) protected void
setRot
(float yRot, float xRot) Sets the rotation of the entity.protected void
setSharedFlag
(int flag, boolean set) Enable or disable an entity flag, seeinvalid reference
#getEntityFlag
void
setSharedFlagOnFire
(boolean isOnFire) void
setShiftKeyDown
(boolean keyDown) void
setSilent
(boolean isSilent) When set to true the entity will not play sounds.void
setSprinting
(boolean sprinting) Set sprinting switch for Entity.void
setSwimming
(boolean swimming) void
setTicksFrozen
(int ticksFrozen) void
static void
setViewScale
(double renderDistWeight) void
setXRot
(float xRot) Sets the rotation of this entity around the x-axis (the pitch) in degrees.void
setYBodyRot
(float yBodyRot) Set the body Y rotation of the entity.void
setYHeadRot
(float yHeadRot) Sets the head's Y rotation of the entity.void
setYRot
(float yRot) Sets the rotation of this entity around the y-axis (the yaw) in degrees.boolean
boolean
shouldBlockExplode
(Explosion explosion, BlockGetter level, BlockPos pos, BlockState blockState, float explosionPower) boolean
private boolean
boolean
shouldRender
(double x, double y, double z) boolean
shouldRenderAtSqrDistance
(double distance) Checks if the entity is in range to render.boolean
boolean
boolean
skipAttackInteraction
(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 void
boolean
startRiding
(Entity vehicle) boolean
startRiding
(Entity vehicle, boolean force) void
startSeenByPlayer
(ServerPlayer serverPlayer) Add the given player to the list of players tracking this entity.void
void
stopSeenByPlayer
(ServerPlayer serverPlayer) Removes the given player from the list of players tracking this entity.void
syncPacketPositionCodec
(double x, double y, double z) private void
void
teleportRelative
(double dx, double dy, double dz) void
teleportTo
(double x, double y, double z) Sets the position of the entity and updates the 'last' variablesboolean
teleportTo
(ServerLevel level, double x, double y, double z, Set<RelativeMovement> relativeMovements, float yRot, float xRot) void
thunderHit
(ServerLevel level, LightningBolt lightning) void
tick()
toString()
boolean
protected void
void
turn
(double yRot, double xRot) final void
unRide()
protected void
void
updateDynamicGameEventListener
(BiConsumer<DynamicGameEventListener<?>, ServerLevel> listenerConsumer) void
boolean
updateFluidHeightAndDoFluidPushing
(TagKey<Fluid> fluidTag, double motionScale) Deprecated.private void
protected boolean
(package private) void
void
private boolean
vibrationAndSoundEffectsFromBlock
(BlockPos pos, BlockState state, boolean playStepSound, boolean broadcastGameEvent, Vec3 entityPos) private void
walkingStepSound
(BlockPos pos, BlockState state) protected void
Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, removeData, serializeAttachments
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.commands.CommandSource
alwaysAccepts
Methods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData
Methods 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, shouldRiderSit
Methods 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:
getId
in 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 setsinvalid 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,invalid reference
#writeUnlessPassenger
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, useinvalid 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 usinginvalid reference
AnvilChunkLoader#readWorldEntity
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
Returnstrue
if Entity argument is equal to this Entity -
getYHeadRot
public float getYHeadRot() -
setYHeadRot
public void setYHeadRot(float yHeadRot) Sets the head's Y rotation of the entity. -
setYBodyRot
public void setYBodyRot(float yBodyRot) Set the body Y rotation of the entity. -
isAttackable
public boolean isAttackable() -
skipAttackInteraction
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:
getUUID
in interfaceEntityAccess
-
getStringUUID
-
getScoreboardName
- Specified by:
getScoreboardName
in interfaceScoreHolder
-
isPushedByFluid
Deprecated. -
getViewScale
public static double getViewScale() -
setViewScale
public static void setViewScale(double renderDistWeight) -
getDisplayName
- Specified by:
getDisplayName
in interfaceNameable
- Specified by:
getDisplayName
in interfaceScoreHolder
-
setCustomName
-
getCustomName
- Specified by:
getCustomName
in interfaceNameable
-
hasCustomName
public boolean hasCustomName()- Specified by:
hasCustomName
in 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:
onSyncedDataUpdated
in interfaceSyncedDataHolder
-
onSyncedDataUpdated
- Specified by:
onSyncedDataUpdated
in interfaceSyncedDataHolder
-
fixupDimensions
Deprecated. -
refreshDimensions
public void refreshDimensions() -
fudgePositionAfterSizeChange
-
getDirection
-
getMotionDirection
-
createHoverEvent
-
broadcastToPlayer
-
getBoundingBox
- Specified by:
getBoundingBox
in interfaceEntityAccess
-
getBoundingBoxForCulling
-
setBoundingBox
-
getEyeHeight
-
getEyeHeight
public final float getEyeHeight() -
getLeashOffset
-
getLeashOffset
-
getSlot
-
sendSystemMessage
- Specified by:
sendSystemMessage
in 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. Seeinvalid 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:
getSelfAndPassengers
in interfaceEntityAccess
-
getPassengersAndSelf
- Specified by:
getPassengersAndSelf
in 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:
acceptsSuccess
in interfaceCommandSource
-
acceptsFailure
public boolean acceptsFailure()- Specified by:
acceptsFailure
in interfaceCommandSource
-
shouldInformAdmins
public boolean shouldInformAdmins()- Specified by:
shouldInformAdmins
in 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:
blockPosition
in 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 theinvalid reference
#posX
invalid reference
posY
invalid reference
posZ
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:
setRemoved
in interfaceEntityAccess
-
unsetRemoved
protected void unsetRemoved() -
setLevelCallback
- Specified by:
setLevelCallback
in interfaceEntityAccess
-
shouldBeSaved
public boolean shouldBeSaved()- Specified by:
shouldBeSaved
in interfaceEntityAccess
-
isAlwaysTicking
public boolean isAlwaysTicking()- Specified by:
isAlwaysTicking
in interfaceEntityAccess
-
mayInteract
-
captureDrops
- Specified by:
captureDrops
in interfaceIEntityExtension
-
captureDrops
- Specified by:
captureDrops
in interfaceIEntityExtension
-
getPersistentData
Description copied from interface:IEntityExtension
Returns a NBTTagCompound that can be used to store custom data for this entity. It will be written, and read from disc, so it persists over world saves.- Specified by:
getPersistentData
in interfaceIEntityExtension
- Returns:
- A NBTTagCompound
-
canTrample
Description copied from interface:IEntityExtension
- Specified by:
canTrample
in interfaceIEntityExtension
- Parameters:
pos
- The block posfallDistance
- The fall distance- Returns:
true
if this entity can trample,false
otherwise
-
isAddedToLevel
public final boolean isAddedToLevel()Description copied from interface:IEntityExtension
Gets whether this entity has been added to a world (for tracking). Specifically between the times when an entity is added to a world and the entity being removed from the world's tracked lists.- Specified by:
isAddedToLevel
in interfaceIEntityExtension
- Returns:
- True if this entity is being tracked by a world
-
onAddedToLevel
public void onAddedToLevel()Description copied from interface:IEntityExtension
Called after the entity has been added to the world's ticking list.- Specified by:
onAddedToLevel
in interfaceIEntityExtension
-
onRemovedFromLevel
public void onRemovedFromLevel()Description copied from interface:IEntityExtension
Called after the entity has been removed to the world's ticking list.- Specified by:
onRemovedFromLevel
in interfaceIEntityExtension
-
revive
public void revive()Description copied from interface:IEntityExtension
Revives an entity that has been removed from a world. Used as replacement for entity.removed = true. Having it as a function allows the entity to react to being revived.- Specified by:
revive
in interfaceIEntityExtension
-
setFluidTypeHeight
-
getFluidTypeHeight
Description copied from interface:IEntityExtension
Returns the height of the fluid type in relation to the bounding box of the entity. If the entity is not in the fluid type, then0
is returned.- Specified by:
getFluidTypeHeight
in interfaceIEntityExtension
- Parameters:
type
- the type of the fluid- Returns:
- the height of the fluid compared to the entity
-
isInFluidType
Description copied from interface:IEntityExtension
Returns whether the fluid type the entity is currently in matches the specified condition.- Specified by:
isInFluidType
in interfaceIEntityExtension
- Parameters:
predicate
- a test taking in the fluid type and its heightforAllTypes
-true
if all fluid types should match the condition instead of at least one- Returns:
true
if a fluid type meets the condition,false
otherwise
-
isInFluidType
public final boolean isInFluidType()Description copied from interface:IEntityExtension
Returns whether the entity is in a fluid.- Specified by:
isInFluidType
in interfaceIEntityExtension
- Returns:
true
if the entity is in a fluid,false
otherwise
-
getEyeInFluidType
Description copied from interface:IEntityExtension
Returns the fluid that is on the entity's eyes.- Specified by:
getEyeInFluidType
in interfaceIEntityExtension
- Returns:
- the fluid that is on the entity's eyes
-
getMaxHeightFluidType
Description copied from interface:IEntityExtension
Returns the fluid type which is the highest on the bounding box of the entity.- Specified by:
getMaxHeightFluidType
in interfaceIEntityExtension
- Returns:
- the fluid type which is the highest on the bounding box of the entity
-
setData
Description copied from interface:IAttachmentHolder
Sets the data attachment of the given type.- Specified by:
setData
in interfaceIAttachmentHolder
- Overrides:
setData
in classAttachmentHolder
- Returns:
- the previous value for that attachment type, if any, or
null
if there was none
-
getCapability
@Nullable public final <T,C extends @Nullable Object> T getCapability(EntityCapability<T, C> capability, C context) -
getCapability
-
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