public abstract class Entity extends CapabilityProvider<Entity> implements INameable, ICommandSource, IForgeEntity
修飾子とタイプ | クラスと説明 |
---|---|
static interface |
Entity.IMoveCallback |
修飾子とタイプ | フィールドと説明 |
---|---|
boolean |
addedToChunk |
protected java.lang.String |
cachedUniqueIdString |
int |
chunkCoordX |
int |
chunkCoordY |
int |
chunkCoordZ |
boolean |
collided |
boolean |
collidedHorizontally |
boolean |
collidedVertically |
protected EntityDataManager |
dataManager |
DimensionType |
dimension |
float |
distanceWalkedModified |
float |
distanceWalkedOnStepModified |
float |
entityCollisionReduction |
protected java.util.UUID |
entityUniqueID |
protected boolean |
eyesInWater |
float |
fallDistance |
protected boolean |
firstUpdate |
protected static DataParameter<java.lang.Byte> |
FLAGS |
boolean |
forceSpawn |
protected boolean |
glowing |
int |
hurtResistantTime |
boolean |
ignoreFrustumCheck |
protected boolean |
inLava |
protected boolean |
inPortal |
protected boolean |
inWater |
boolean |
isAirBorne |
protected BlockPos |
lastPortalPos
The position of the last portal the entity was in
|
protected Vec3d |
lastPortalVec
A horizontal vector related to the position of the last portal the entity was in
|
double |
lastTickPosX |
double |
lastTickPosY |
double |
lastTickPosZ |
protected static org.apache.logging.log4j.Logger |
LOGGER |
protected Vec3d |
motionMultiplier |
boolean |
noClip |
boolean |
onGround |
protected int |
portalCounter |
protected static DataParameter<Pose> |
POSE |
float |
prevDistanceWalkedModified |
boolean |
preventEntitySpawning |
double |
prevPosX |
double |
prevPosY |
double |
prevPosZ |
float |
prevRotationPitch |
float |
prevRotationYaw |
protected java.util.Random |
rand |
boolean |
removed
非推奨です。
|
protected int |
rideCooldown |
float |
rotationPitch |
float |
rotationYaw |
long |
serverPosX |
long |
serverPosY |
long |
serverPosZ |
float |
stepHeight |
protected double |
submergedHeight |
protected Direction |
teleportDirection
A direction related to the position of the last portal the entity was in
|
int |
ticksExisted |
int |
timeUntilPortal |
boolean |
velocityChanged |
World |
world |
DUMMY
コンストラクタと説明 |
---|
Entity(EntityType<?> entityTypeIn,
World worldIn) |
修飾子とタイプ | メソッドと説明 |
---|---|
protected void |
addPassenger(Entity passenger) |
boolean |
addTag(java.lang.String tag) |
void |
addTrackingPlayer(ServerPlayerEntity player)
Add the given player to the list of players tracking this entity.
|
void |
addVelocity(double x,
double y,
double z)
Adds to the current velocity of the entity, and sets
isAirBorne to true. |
boolean |
allowLogging() |
protected void |
applyEnchantments(LivingEntity entityLivingBaseIn,
Entity entityIn) |
void |
applyEntityCollision(Entity entityIn)
Applies a velocity to the entities, to push them away from eachother.
|
void |
applyOrientationToEntity(Entity entityToUpdate)
Applies this entity's orientation (pitch/yaw) to another entity.
|
ActionResultType |
applyPlayerInteraction(PlayerEntity player,
Vec3d vec,
Hand hand)
Applies the given player interaction to this Entity.
|
boolean |
areEyesInFluid(Tag<Fluid> tagIn) |
boolean |
areEyesInFluid(Tag<Fluid> p_213290_1_,
boolean checkChunkLoaded) |
boolean |
attackEntityFrom(DamageSource source,
float amount)
Called when the entity is attacked.
|
void |
awardKillScore(Entity p_191956_1_,
int p_191956_2_,
DamageSource p_191956_3_) |
void |
baseTick()
Gets called every tick from main Entity class
|
protected Vec3d |
calculateUpVector(float p_213320_1_,
float p_213320_2_) |
boolean |
canBeAttackedWithItem()
Returns true if it's possible to attack this entity with an item.
|
boolean |
canBeCollidedWith()
Returns true if other Entities should be prevented from moving through this Entity.
|
boolean |
canBePushed()
Returns true if this entity should push and be pushed by other entities when colliding.
|
protected boolean |
canBeRidden(Entity entityIn) |
boolean |
canBeRiddenInWater()
非推奨です。
|
boolean |
canExplosionDestroyBlock(Explosion explosionIn,
IBlockReader worldIn,
BlockPos pos,
BlockState blockStateIn,
float p_174816_5_) |
protected boolean |
canFitPassenger(Entity passenger) |
boolean |
canPassengerSteer() |
boolean |
canRenderOnFire()
Return whether this entity should be rendered as on fire.
|
boolean |
canSwim() |
boolean |
canTrample(BlockState state,
BlockPos pos,
float fallDistance)
Checks if this
Entity can trample a Block . |
protected boolean |
canTriggerWalking() |
boolean |
canUpdate() |
void |
canUpdate(boolean value) |
java.util.Collection<ItemEntity> |
captureDrops() |
java.util.Collection<ItemEntity> |
captureDrops(java.util.Collection<ItemEntity> value) |
Entity |
changeDimension(DimensionType destination) |
Entity |
changeDimension(DimensionType destination,
ITeleporter teleporter) |
void |
checkDespawn()
Makes the entity despawn if requirements are reached
|
static Vec3d |
collideBoundingBox(Vec3d p_223310_0_,
AxisAlignedBB p_223310_1_,
ReuseableStream<VoxelShape> p_223310_2_) |
static Vec3d |
collideBoundingBoxHeuristically(Entity p_223307_0_,
Vec3d p_223307_1_,
AxisAlignedBB p_223307_2_,
World p_223307_3_,
ISelectionContext p_223307_4_,
ReuseableStream<VoxelShape> p_223307_5_) |
void |
copyDataFromOld(Entity entityIn)
Prepares this entity in new dimension by copying NBT data from entity in old dimension
|
void |
copyLocationAndAnglesFrom(Entity entityIn)
Sets this entity's location and angles to the location and angles of the passed in entity.
|
protected void |
createRunningParticles() |
abstract IPacket<?> |
createSpawnPacket() |
protected void |
dealFireDamage(int amount)
Will deal the specified amount of fire damage to the entity if the entity isn't immune to fire damage.
|
protected void |
decrementTimeUntilPortal()
Decrements the counter for the remaining time until the entity may use a portal again.
|
void |
detach() |
protected float |
determineNextStepDistance() |
protected void |
doBlockCollisions() |
boolean |
doesEntityNotTriggerPressurePlate()
Return whether this entity should NOT trigger a pressure plate or a tripwire.
|
protected void |
doWaterSplashEffect()
|
ItemEntity |
entityDropItem(IItemProvider itemIn) |
ItemEntity |
entityDropItem(IItemProvider itemIn,
int offset) |
ItemEntity |
entityDropItem(ItemStack stack) |
ItemEntity |
entityDropItem(ItemStack stack,
float offsetY)
Drops an item at the position of the entity.
|
boolean |
equals(java.lang.Object p_equals_1_) |
void |
extinguish()
Removes fire from entity.
|
void |
fillCrashReport(CrashReportCategory category) |
void |
forceSetPosition(double x,
double y,
double z)
|
protected ITextComponent |
func_225513_by_() |
protected Vec3d |
func_225514_a_(Vec3d p_225514_1_,
MoverType p_225514_2_) |
void |
func_226265_a_(Entity.IMoveCallback p_226265_1_) |
void |
func_226266_a_(Entity p_226266_1_,
Entity.IMoveCallback p_226266_2_) |
java.util.stream.Stream<Entity> |
func_226276_cg_() |
Direction |
getAdjustedHorizontalFacing()
Gets the horizontal facing direction of this Entity, adjusted to take specially-treated entity types into account.
|
int |
getAir() |
static Vec3d |
getAllowedMovement(Vec3d vec,
AxisAlignedBB collisionBox,
IWorldReader worldIn,
ISelectionContext selectionContext,
ReuseableStream<VoxelShape> potentialHits) |
boolean |
getAlwaysRenderNameTagForRender() |
java.lang.Iterable<ItemStack> |
getArmorInventoryList() |
AxisAlignedBB |
getBoundingBox() |
protected AxisAlignedBB |
getBoundingBox(Pose p_213321_1_) |
float |
getBrightness()
Gets how bright this entity is.
|
java.lang.String |
getCachedUniqueIdString() |
float |
getCollisionBorderSize() |
AxisAlignedBB |
getCollisionBoundingBox()
Returns the solid collision bounding box for this entity.
|
AxisAlignedBB |
getCollisionBox(Entity entityIn)
Returns a boundingBox used to collide the entity with other entities and blocks.
|
CommandSource |
getCommandSource() |
Entity |
getControllingPassenger()
For vehicles, the first passenger is generally considered the controller and "drives" the vehicle.
|
ITextComponent |
getCustomName() |
EntityDataManager |
getDataManager() |
ITextComponent |
getDisplayName() |
float |
getDistance(Entity entityIn)
Returns the distance to the entity.
|
double |
getDistanceSq(double x,
double y,
double z)
Gets the squared distance to the position.
|
double |
getDistanceSq(Entity entityIn)
Returns the squared distance to the entity.
|
double |
getDistanceSq(Vec3d p_195048_1_) |
int |
getEntityId() |
java.lang.String |
getEntityString()
Returns the string that identifies this Entity's class
|
World |
getEntityWorld()
Get the world, if available.
|
java.lang.Iterable<ItemStack> |
getEquipmentAndArmor() |
float |
getExplosionResistance(Explosion explosionIn,
IBlockReader worldIn,
BlockPos pos,
BlockState blockStateIn,
IFluidState p_180428_5_,
float p_180428_6_)
Explosion resistance of a block relative to this entity
|
float |
getEyeHeight() |
float |
getEyeHeight(Pose p_213307_1_) |
protected float |
getEyeHeight(Pose poseIn,
EntitySize sizeIn) |
Vec3d |
getEyePosition(float partialTicks) |
protected int |
getFireImmuneTicks() |
int |
getFireTimer() |
protected boolean |
getFlag(int flag)
Returns true if the flag is active for the entity.
|
Vec3d |
getForward() |
float |
getHeight() |
java.lang.Iterable<ItemStack> |
getHeldEquipment() |
protected SoundEvent |
getHighspeedSplashSound() |
Direction |
getHorizontalFacing()
Gets the horizontal facing direction of this Entity.
|
protected HoverEvent |
getHoverEvent() |
protected float |
getJumpFactor() |
Vec3d |
getLastPortalVec() |
Vec3d |
getLook(float partialTicks)
interpolated look vector
|
Vec3d |
getLookVec()
returns a (normalized) vector of where this entity is looking
|
Entity |
getLowestRidingEntity() |
int |
getMaxAir() |
int |
getMaxFallHeight()
The maximum height from where the entity is alowed to jump (used in pathfinder)
|
int |
getMaxInPortalTime()
Return the amount of time this entity should stay in a portal before being transported.
|
float |
getMirroredYaw(Mirror transformMirror)
Transforms the entity's current yaw with the given Mirror and returns it.
|
Vec3d |
getMotion() |
double |
getMountedYOffset()
Returns the Y offset from the entity's position for any entity riding this one.
|
ITextComponent |
getName() |
protected BlockPos |
getOnPosition() |
java.util.List<Entity> |
getPassengers() |
protected int |
getPermissionLevel() |
CompoundNBT |
getPersistentData()
Returns a NBTTagCompound that can be used to store custom data for this entity.
|
float |
getPitch(float partialTicks)
Gets the current pitch of the entity.
|
Vec2f |
getPitchYaw()
returns the Entity's pitch and yaw as a Vec2f
|
int |
getPortalCooldown()
Return the amount of cooldown before this entity can use a portal again.
|
Pose |
getPose() |
BlockPos |
getPosition()
Get the position in the world.
|
protected BlockPos |
getPositionUnderneath() |
Vec3d |
getPositionVec() |
Vec3d |
getPositionVector()
Get the position vector.
|
double |
getPosX() |
double |
getPosXRandom(double p_226282_1_) |
double |
getPosXWidth(double p_226275_1_) |
double |
getPosY() |
double |
getPosYEye() |
double |
getPosYHeight(double p_226283_1_) |
double |
getPosYRandom() |
double |
getPosZ() |
double |
getPosZRandom(double p_226287_1_) |
double |
getPosZWidth(double p_226285_1_) |
PushReaction |
getPushReaction() |
java.util.Collection<Entity> |
getRecursivePassengers()
Recursively collects the passengers of this entity.
|
AxisAlignedBB |
getRenderBoundingBox()
Gets the bounding box of this Entity, adjusted to take auxiliary entities into account (e.g. the tile contained by
a minecart, such as a command block).
|
static double |
getRenderDistanceWeight() |
Entity |
getRidingEntity()
Get entity this is riding
|
float |
getRotatedYaw(Rotation transformRotation)
Transforms the entity's current yaw with the given Rotation and returns it.
|
float |
getRotationYawHead() |
java.lang.String |
getScoreboardName()
Returns a String to use as this entity's name in the scoreboard/entity selector systems
|
MinecraftServer |
getServer()
Get the Minecraft server instance
|
EntitySize |
getSize(Pose poseIn) |
SoundCategory |
getSoundCategory() |
protected float |
getSpeedFactor() |
protected SoundEvent |
getSplashSound() |
double |
getSubmergedHeight() |
protected SoundEvent |
getSwimSound() |
java.util.Set<java.lang.String> |
getTags() |
Team |
getTeam() |
int |
getTeamColor() |
Direction |
getTeleportDirection() |
EntityType<?> |
getType() |
java.util.UUID |
getUniqueID()
Returns the UUID of this entity.
|
Vec3d |
getUpVector(float partialTicks) |
protected Vec3d |
getVectorForRotation(float pitch,
float yaw)
Creates a Vec3 using the pitch and yaw of the entities rotation.
|
float |
getWidth() |
float |
getYaw(float partialTicks)
Gets the current yaw of the entity
|
double |
getYOffset()
Returns the Y Offset of this entity.
|
boolean |
handleFluidAcceleration(Tag<Fluid> p_210500_1_) |
protected Vec3d |
handlePistonMovement(Vec3d pos) |
void |
handleStatusUpdate(byte id)
|
boolean |
handleWaterMovement()
Returns if this entity is in water and will end up adding the waters velocity to the entity
|
boolean |
hasCustomName() |
int |
hashCode() |
boolean |
hasNoGravity() |
boolean |
hasPermissionLevel(int p_211513_1_) |
boolean |
hitByEntity(Entity entityIn)
Called when a player attacks an entity.
|
static double |
horizontalMag(Vec3d vec) |
boolean |
ignoreItemEntityData()
Checks if players can use this entity to access operator (permission level 2) commands either directly or
indirectly, such as give or setblock.
|
boolean |
isActualySwimming() |
boolean |
isAddedToWorld()
Gets whether this entity has been added to a world (for tracking).
|
boolean |
isAlive()
Returns true if the entity has not been
removed . |
boolean |
isBeingRidden()
If at least 1 entity is riding this one
|
boolean |
isBurning()
Returns true if the entity is on fire.
|
boolean |
isCrouching() |
boolean |
isCustomNameVisible() |
boolean |
isDescending() |
boolean |
isDiscrete() |
boolean |
isEntityEqual(Entity entityIn)
Returns true if Entity argument is equal to this Entity
|
boolean |
isEntityInsideOpaqueBlock()
Checks if this entity is inside of an opaque block
|
boolean |
isGlowing() |
boolean |
isImmuneToExplosions() |
boolean |
isImmuneToFire() |
boolean |
isInLava() |
boolean |
isInRangeToRender3d(double x,
double y,
double z) |
boolean |
isInRangeToRenderDist(double distance)
Checks if the entity is in range to render.
|
boolean |
isInvisible() |
boolean |
isInvisibleToPlayer(PlayerEntity player)
Only used by renderer in EntityLivingBase subclasses.
|
boolean |
isInvulnerable() |
boolean |
isInvulnerableTo(DamageSource source)
Returns whether this Entity is invulnerable to the given DamageSource.
|
boolean |
isInWater()
Checks if this entity is inside water (if inWater field is true as a result of handleWaterMovement() returning
true)
|
boolean |
isInWaterOrBubbleColumn() |
boolean |
isInWaterRainOrBubbleColumn() |
boolean |
isLiving() |
boolean |
isNonBoss()
Returns false if this Entity is a boss, true otherwise.
|
boolean |
isOffsetPositionInLiquid(double x,
double y,
double z)
Checks if the offset position from the entity's current position is inside of a liquid.
|
boolean |
isOnePlayerRiding() |
boolean |
isOnSameTeam(Entity entityIn)
Returns whether this Entity is on the same team as the given Entity.
|
boolean |
isOnScoreboardTeam(Team teamIn)
Returns whether this Entity is on the given scoreboard team.
|
boolean |
isPassenger() |
boolean |
isPassenger(java.lang.Class<? extends Entity> p_205708_1_) |
boolean |
isPassenger(Entity entityIn) |
protected boolean |
isPoseClear(Pose p_213298_1_) |
boolean |
isPushedByWater() |
boolean |
isRidingOrBeingRiddenBy(Entity entityIn) |
boolean |
isRidingSameEntity(Entity entityIn) |
boolean |
isShiftKeyDown() |
boolean |
isSilent() |
boolean |
isSpectatedByPlayer(ServerPlayerEntity player) |
boolean |
isSpectator()
Returns true if the player is in spectator mode.
|
boolean |
isSprinting()
Get if the Entity is sprinting.
|
boolean |
isSteppingCarefully() |
boolean |
isSuppressingBounce() |
boolean |
isSwimming() |
boolean |
isVisuallySwimming() |
boolean |
isWet()
Checks if this entity is either in water or on an open air block in rain (used in wolves).
|
void |
lookAt(EntityAnchorArgument.Type p_200602_1_,
Vec3d p_200602_2_) |
protected boolean |
makeFlySound() |
protected void |
markVelocityChanged()
Marks this entity's velocity as changed, so that it can be re-synced with the client later
|
void |
move(MoverType typeIn,
Vec3d pos) |
void |
moveForced(double p_225653_1_,
double p_225653_3_,
double p_225653_5_) |
void |
moveRelative(float p_213309_1_,
Vec3d relative) |
void |
moveToBlockPosAndAngles(BlockPos pos,
float rotationYawIn,
float rotationPitchIn) |
protected ListNBT |
newDoubleNBTList(double... numbers)
creates a NBT list from the array of doubles passed to this function
|
protected ListNBT |
newFloatNBTList(float... numbers)
Returns a new NBTTagList filled with the specified floats
|
void |
notifyDataManagerChange(DataParameter<?> key) |
void |
onAddedToWorld()
Called after the entity has been added to the world's
ticking list.
|
void |
onCollideWithPlayer(PlayerEntity entityIn)
Called by a player entity when they collide with an entity
|
void |
onEnterBubbleColumn(boolean downwards) |
void |
onEnterBubbleColumnWithAirAbove(boolean downwards) |
protected void |
onInsideBlock(BlockState p_191955_1_) |
void |
onKillCommand()
Called by the /kill command.
|
void |
onKillEntity(LivingEntity entityLivingIn)
This method gets called when the entity kills another one.
|
boolean |
onLivingFall(float distance,
float damageMultiplier) |
void |
onRemovedFromWorld()
Called after the entity has been removed to the world's
ticking list.
|
void |
onStruckByLightning(LightningBoltEntity lightningBolt)
Called when a lightning bolt hits the entity.
|
protected void |
outOfWorld()
sets the dead flag.
|
void |
performHurtAnimation()
Setups the entity to do the hurt animation.
|
RayTraceResult |
pick(double p_213324_1_,
float p_213324_3_,
boolean p_213324_4_) |
protected float |
playFlySound(float volume) |
void |
playSound(SoundEvent soundIn,
float volume,
float pitch) |
protected void |
playStepSound(BlockPos pos,
BlockState blockIn) |
protected void |
playSwimSound(float volume) |
protected void |
preparePlayerToSpawn()
Keeps moving the entity up so it isn't colliding with blocks and other requirements for this entity to be spawned
(only actually used on players though its also on Entity)
|
boolean |
processInitialInteract(PlayerEntity player,
Hand hand) |
protected void |
pushOutOfBlocks(double x,
double y,
double z) |
void |
read(CompoundNBT compound)
Reads the entity from NBT (calls an abstract helper method to read specialized data)
|
protected abstract void |
readAdditional(CompoundNBT compound)
(abstract) Protected helper method to read subclass entity data from NBT.
|
void |
recalculateSize() |
protected void |
recenterBoundingBox()
Recomputes this entity's bounding box so that it is positioned at this entity's X/Y/Z.
|
protected abstract void |
registerData() |
void |
remove()
Queues the entity for removal from the world on the next tick.
|
void |
remove(boolean keepData) |
protected void |
removePassenger(Entity passenger) |
void |
removePassengers()
Dismounts all entities riding this entity from this entity.
|
boolean |
removeTag(java.lang.String tag) |
void |
removeTrackingPlayer(ServerPlayerEntity player)
Removes the given player from the list of players tracking this entity.
|
boolean |
replaceItemInInventory(int inventorySlot,
ItemStack itemStackIn) |
void |
resetPositionToBB()
Resets the entity's position to the center (planar) and bottom (vertical) points of its bounding box.
|
void |
revive()
Revives an entity that has been removed from a world.
|
void |
rotateTowards(double yaw,
double pitch) |
void |
sendMessage(ITextComponent component)
Send a chat message to the CommandSender
|
void |
setAir(int air) |
void |
setBoundingBox(AxisAlignedBB bb) |
void |
setCustomName(ITextComponent name) |
void |
setCustomNameVisible(boolean alwaysRenderNameTag) |
void |
setEntityId(int id) |
void |
setFire(int seconds)
Sets entity to burn for x amount of seconds, cannot lower amount of existing fire.
|
void |
setFireTimer(int p_223308_1_) |
protected void |
setFlag(int flag,
boolean set)
Enable or disable a entity flag, see getEntityFlag to read the know flags.
|
void |
setGlowing(boolean glowingIn) |
void |
setHeadRotation(float yaw,
int pitch) |
void |
setInLava() |
void |
setInvisible(boolean invisible) |
void |
setInvulnerable(boolean isInvulnerable)
Sets whether this Entity is invulnerable.
|
void |
setItemStackToSlot(EquipmentSlotType slotIn,
ItemStack stack) |
void |
setLocationAndAngles(double x,
double y,
double z,
float yaw,
float pitch)
Sets the location and Yaw/Pitch of an entity in the world
|
void |
setMotion(double x,
double y,
double z) |
void |
setMotion(Vec3d motionIn) |
void |
setMotionMultiplier(BlockState p_213295_1_,
Vec3d p_213295_2_) |
void |
setNoGravity(boolean noGravity) |
protected void |
setOnFireFromLava()
Called whenever the entity is walking inside of lava.
|
void |
setPacketCoordinates(double p_213312_1_,
double p_213312_3_,
double p_213312_5_) |
void |
setPortal(BlockPos pos)
Marks the entity as being inside a portal, activating teleportation logic in onEntityUpdate() in the following
tick(s).
|
protected void |
setPose(Pose poseIn) |
void |
setPosition(double x,
double y,
double z)
Sets the x,y,z of the entity from the given parameters.
|
void |
setPositionAndRotation(double x,
double y,
double z,
float yaw,
float pitch)
Sets position and rotation, clamping and wrapping params to valid values.
|
void |
setPositionAndRotationDirect(double x,
double y,
double z,
float yaw,
float pitch,
int posRotationIncrements,
boolean teleport)
Sets a target for the client to interpolate towards over the next few ticks
|
void |
setPositionAndUpdate(double x,
double y,
double z)
Sets the position of the entity and updates the 'last' variables
|
boolean |
setPositionNonDirty() |
void |
setRawPosition(double x,
double y,
double z)
Directly updates the
posX , posY , and posZ fields, without performing any collision
checks, updating the bounding box position, or sending any packets. |
static void |
setRenderDistanceWeight(double renderDistWeight) |
void |
setRenderYawOffset(float offset)
Set the render yaw offset
|
protected void |
setRotation(float yaw,
float pitch)
Sets the rotation of the entity.
|
void |
setRotationYawHead(float rotation)
Sets the head's yaw rotation of the entity.
|
void |
setSilent(boolean isSilent)
When set to true the entity will not play sounds.
|
void |
setSneaking(boolean keyDownIn) |
void |
setSprinting(boolean sprinting)
Set sprinting switch for Entity.
|
void |
setSwimming(boolean p_204711_1_) |
void |
setUniqueId(java.util.UUID uniqueIdIn) |
void |
setVelocity(double x,
double y,
double z)
Updates the entity motion clientside, called by packets from the server
|
void |
setWorld(World worldIn)
Sets the reference to the World object.
|
boolean |
shouldReceiveErrors() |
boolean |
shouldReceiveFeedback() |
protected boolean |
shouldSetPosAfterLoading() |
void |
spawnRunningParticles()
Attempts to create sprinting particles if the entity is sprinting and not in water.
|
boolean |
startRiding(Entity entityIn) |
boolean |
startRiding(Entity entityIn,
boolean force) |
void |
stopRiding()
Dismounts this entity from the entity it is riding.
|
void |
teleportKeepLoaded(double p_223102_1_,
double p_223102_3_,
double p_223102_5_)
Teleports the entity, forcing the destination to stay loaded for a short time
|
void |
tick()
Called to update the entity's position/logic.
|
java.lang.String |
toString() |
protected void |
updateFallState(double y,
boolean onGroundIn,
BlockState state,
BlockPos pos) |
void |
updatePassenger(Entity passenger) |
protected void |
updatePortal() |
void |
updateRidden()
Handles updating while riding another entity
|
void |
updateSwimming() |
protected abstract void |
writeAdditional(CompoundNBT compound) |
boolean |
writeUnlessPassenger(CompoundNBT compound)
Writes this entity to NBT, unless it has been removed or it is a passenger.
|
boolean |
writeUnlessRemoved(CompoundNBT compound)
Writes this entity to NBT, unless it has been removed.
|
CompoundNBT |
writeWithoutTypeId(CompoundNBT compound)
Writes this entity, including passengers, to NBT, regardless as to whether or not it is removed or a passenger.
|
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, getCapabilities, getCapability, invalidateCaps, reviveCaps, serializeCaps
canBeRiddenInWater, canRiderInteract, deserializeNBT, getClassification, getEntity, getPickedResult, serializeNBT, shouldRiderSit
getCapability, getCapability
protected static final org.apache.logging.log4j.Logger LOGGER
public boolean preventEntitySpawning
protected int rideCooldown
public boolean forceSpawn
public World world
public double prevPosX
public double prevPosY
public double prevPosZ
public float rotationYaw
public float rotationPitch
public float prevRotationYaw
public float prevRotationPitch
public boolean onGround
public boolean collidedHorizontally
public boolean collidedVertically
public boolean collided
public boolean velocityChanged
protected Vec3d motionMultiplier
@Deprecated public boolean removed
public float prevDistanceWalkedModified
public float distanceWalkedModified
public float distanceWalkedOnStepModified
public float fallDistance
public double lastTickPosX
public double lastTickPosY
public double lastTickPosZ
public float stepHeight
public boolean noClip
public float entityCollisionReduction
protected final java.util.Random rand
public int ticksExisted
protected boolean inWater
protected double submergedHeight
protected boolean eyesInWater
protected boolean inLava
public int hurtResistantTime
protected boolean firstUpdate
protected final EntityDataManager dataManager
protected static final DataParameter<java.lang.Byte> FLAGS
protected static final DataParameter<Pose> POSE
public boolean addedToChunk
public int chunkCoordX
public int chunkCoordY
public int chunkCoordZ
public long serverPosX
public long serverPosY
public long serverPosZ
public boolean ignoreFrustumCheck
public boolean isAirBorne
public int timeUntilPortal
protected boolean inPortal
protected int portalCounter
public DimensionType dimension
protected BlockPos lastPortalPos
protected Vec3d lastPortalVec
protected Direction teleportDirection
protected java.util.UUID entityUniqueID
protected java.lang.String cachedUniqueIdString
protected boolean glowing
public Entity(EntityType<?> entityTypeIn, World worldIn)
public int getTeamColor()
public boolean isSpectator()
public final void detach()
public void setPacketCoordinates(double p_213312_1_, double p_213312_3_, double p_213312_5_)
public EntityType<?> getType()
public int getEntityId()
public void setEntityId(int id)
public java.util.Set<java.lang.String> getTags()
public boolean addTag(java.lang.String tag)
public boolean removeTag(java.lang.String tag)
public void onKillCommand()
protected abstract void registerData()
public EntityDataManager getDataManager()
public boolean equals(java.lang.Object p_equals_1_)
equals
クラス内 java.lang.Object
public int hashCode()
hashCode
クラス内 java.lang.Object
protected void preparePlayerToSpawn()
public void remove()
public void remove(boolean keepData)
protected void setPose(Pose poseIn)
public Pose getPose()
protected void setRotation(float yaw, float pitch)
public void setPosition(double x, double y, double z)
protected void recenterBoundingBox()
public void rotateTowards(double yaw, double pitch)
public void tick()
public void baseTick()
protected void decrementTimeUntilPortal()
public int getMaxInPortalTime()
protected void setOnFireFromLava()
public void setFire(int seconds)
public void setFireTimer(int p_223308_1_)
public int getFireTimer()
public void extinguish()
protected void outOfWorld()
public boolean isOffsetPositionInLiquid(double x, double y, double z)
protected BlockPos getOnPosition()
protected float getJumpFactor()
protected float getSpeedFactor()
protected BlockPos getPositionUnderneath()
public static double horizontalMag(Vec3d vec)
public static Vec3d collideBoundingBoxHeuristically(@Nullable Entity p_223307_0_, Vec3d p_223307_1_, AxisAlignedBB p_223307_2_, World p_223307_3_, ISelectionContext p_223307_4_, ReuseableStream<VoxelShape> p_223307_5_)
public static Vec3d collideBoundingBox(Vec3d p_223310_0_, AxisAlignedBB p_223310_1_, ReuseableStream<VoxelShape> p_223310_2_)
public static Vec3d getAllowedMovement(Vec3d vec, AxisAlignedBB collisionBox, IWorldReader worldIn, ISelectionContext selectionContext, ReuseableStream<VoxelShape> potentialHits)
protected float determineNextStepDistance()
public void resetPositionToBB()
protected SoundEvent getSwimSound()
protected SoundEvent getSplashSound()
protected SoundEvent getHighspeedSplashSound()
protected void doBlockCollisions()
protected void onInsideBlock(BlockState p_191955_1_)
protected void playStepSound(BlockPos pos, BlockState blockIn)
protected void playSwimSound(float volume)
protected float playFlySound(float volume)
protected boolean makeFlySound()
public void playSound(SoundEvent soundIn, float volume, float pitch)
public boolean isSilent()
public void setSilent(boolean isSilent)
public boolean hasNoGravity()
public void setNoGravity(boolean noGravity)
protected boolean canTriggerWalking()
protected void updateFallState(double y, boolean onGroundIn, BlockState state, BlockPos pos)
@Nullable public AxisAlignedBB getCollisionBoundingBox()
#width
and #height
.getEntityBoundingBox
protected void dealFireDamage(int amount)
public final boolean isImmuneToFire()
public boolean onLivingFall(float distance, float damageMultiplier)
public boolean isInWater()
public boolean isWet()
public boolean isInWaterRainOrBubbleColumn()
public boolean isInWaterOrBubbleColumn()
public boolean canSwim()
public void updateSwimming()
public boolean handleWaterMovement()
protected void doWaterSplashEffect()
public void spawnRunningParticles()
protected void createRunningParticles()
public void setInLava()
public boolean isInLava()
public void moveRelative(float p_213309_1_, Vec3d relative)
public float getBrightness()
public void setWorld(World worldIn)
public void setPositionAndRotation(double x, double y, double z, float yaw, float pitch)
public void moveToBlockPosAndAngles(BlockPos pos, float rotationYawIn, float rotationPitchIn)
public void setLocationAndAngles(double x, double y, double z, float yaw, float pitch)
public void forceSetPosition(double x, double y, double z)
setRawPosition(double, double, double)
, but also sets prevPosX
/Y/Z and lastTickPosX
/Y/Z. setLocationAndAngles(double, double, double, float, float)
does the same thing, except it also updates the bounding box.public float getDistance(Entity entityIn)
public double getDistanceSq(double x, double y, double z)
public double getDistanceSq(Entity entityIn)
public double getDistanceSq(Vec3d p_195048_1_)
public void onCollideWithPlayer(PlayerEntity entityIn)
public void applyEntityCollision(Entity entityIn)
public void addVelocity(double x, double y, double z)
isAirBorne
to true.protected void markVelocityChanged()
public boolean attackEntityFrom(DamageSource source, float amount)
public final Vec3d getLook(float partialTicks)
public float getPitch(float partialTicks)
public float getYaw(float partialTicks)
protected final Vec3d getVectorForRotation(float pitch, float yaw)
public final Vec3d getUpVector(float partialTicks)
protected final Vec3d calculateUpVector(float p_213320_1_, float p_213320_2_)
public final Vec3d getEyePosition(float partialTicks)
public RayTraceResult pick(double p_213324_1_, float p_213324_3_, boolean p_213324_4_)
public boolean canBeCollidedWith()
public boolean canBePushed()
public void awardKillScore(Entity p_191956_1_, int p_191956_2_, DamageSource p_191956_3_)
public boolean isInRangeToRender3d(double x, double y, double z)
public boolean isInRangeToRenderDist(double distance)
public boolean writeUnlessRemoved(CompoundNBT compound)
writeUnlessPassenger(net.minecraft.nbt.CompoundNBT)
or writeWithoutTypeId(net.minecraft.nbt.CompoundNBT)
should be used instead of this method.public boolean writeUnlessPassenger(CompoundNBT compound)
writeWithoutTypeId(net.minecraft.nbt.CompoundNBT)
.public CompoundNBT writeWithoutTypeId(CompoundNBT compound)
AnvilChunkLoader#readWorldEntity
. Use writeUnlessPassenger(net.minecraft.nbt.CompoundNBT)
for that purpose.public void read(CompoundNBT compound)
protected boolean shouldSetPosAfterLoading()
@Nullable public final java.lang.String getEntityString()
protected abstract void readAdditional(CompoundNBT compound)
protected abstract void writeAdditional(CompoundNBT compound)
protected ListNBT newDoubleNBTList(double... numbers)
protected ListNBT newFloatNBTList(float... numbers)
@Nullable public ItemEntity entityDropItem(IItemProvider itemIn)
@Nullable public ItemEntity entityDropItem(IItemProvider itemIn, int offset)
@Nullable public ItemEntity entityDropItem(ItemStack stack)
@Nullable public ItemEntity entityDropItem(ItemStack stack, float offsetY)
public boolean isAlive()
removed
.public boolean isEntityInsideOpaqueBlock()
public boolean processInitialInteract(PlayerEntity player, Hand hand)
@Nullable public AxisAlignedBB getCollisionBox(Entity entityIn)
public void updateRidden()
public void updatePassenger(Entity passenger)
public void func_226266_a_(Entity p_226266_1_, Entity.IMoveCallback p_226266_2_)
public void applyOrientationToEntity(Entity entityToUpdate)
public double getYOffset()
public double getMountedYOffset()
public boolean startRiding(Entity entityIn)
public boolean isLiving()
public boolean startRiding(Entity entityIn, boolean force)
protected boolean canBeRidden(Entity entityIn)
protected boolean isPoseClear(Pose p_213298_1_)
public void removePassengers()
public void stopRiding()
protected void addPassenger(Entity passenger)
protected void removePassenger(Entity passenger)
protected boolean canFitPassenger(Entity passenger)
public void setPositionAndRotationDirect(double x, double y, double z, float yaw, float pitch, int posRotationIncrements, boolean teleport)
public void setHeadRotation(float yaw, int pitch)
public float getCollisionBorderSize()
public Vec3d getLookVec()
public Vec2f getPitchYaw()
public Vec3d getForward()
public void setPortal(BlockPos pos)
protected void updatePortal()
public int getPortalCooldown()
public void setVelocity(double x, double y, double z)
public void handleStatusUpdate(byte id)
public void performHurtAnimation()
public java.lang.Iterable<ItemStack> getHeldEquipment()
public java.lang.Iterable<ItemStack> getArmorInventoryList()
public java.lang.Iterable<ItemStack> getEquipmentAndArmor()
public void setItemStackToSlot(EquipmentSlotType slotIn, ItemStack stack)
public boolean isBurning()
public boolean isPassenger()
public boolean isBeingRidden()
@Deprecated public boolean canBeRiddenInWater()
public void setSneaking(boolean keyDownIn)
public boolean isShiftKeyDown()
public boolean isSteppingCarefully()
public boolean isSuppressingBounce()
public boolean isDiscrete()
public boolean isDescending()
public boolean isCrouching()
public boolean isSprinting()
public void setSprinting(boolean sprinting)
public boolean isSwimming()
public boolean isActualySwimming()
public boolean isVisuallySwimming()
public void setSwimming(boolean p_204711_1_)
public boolean isGlowing()
public void setGlowing(boolean glowingIn)
public boolean isInvisible()
public boolean isInvisibleToPlayer(PlayerEntity player)
@Nullable public Team getTeam()
public boolean isOnSameTeam(Entity entityIn)
public boolean isOnScoreboardTeam(Team teamIn)
public void setInvisible(boolean invisible)
protected boolean getFlag(int flag)
protected void setFlag(int flag, boolean set)
public int getMaxAir()
public int getAir()
public void setAir(int air)
public void onStruckByLightning(LightningBoltEntity lightningBolt)
public void onEnterBubbleColumnWithAirAbove(boolean downwards)
public void onEnterBubbleColumn(boolean downwards)
public void onKillEntity(LivingEntity entityLivingIn)
protected void pushOutOfBlocks(double x, double y, double z)
public void setMotionMultiplier(BlockState p_213295_1_, Vec3d p_213295_2_)
public ITextComponent getName()
protected ITextComponent func_225513_by_()
public boolean isEntityEqual(Entity entityIn)
public float getRotationYawHead()
public void setRotationYawHead(float rotation)
public void setRenderYawOffset(float offset)
public boolean canBeAttackedWithItem()
public boolean hitByEntity(Entity entityIn)
public java.lang.String toString()
toString
クラス内 java.lang.Object
public boolean isInvulnerableTo(DamageSource source)
public boolean isInvulnerable()
public void setInvulnerable(boolean isInvulnerable)
public void copyLocationAndAnglesFrom(Entity entityIn)
public void copyDataFromOld(Entity entityIn)
@Nullable public Entity changeDimension(DimensionType destination)
@Nullable public Entity changeDimension(DimensionType destination, ITeleporter teleporter)
public boolean isNonBoss()
public float getExplosionResistance(Explosion explosionIn, IBlockReader worldIn, BlockPos pos, BlockState blockStateIn, IFluidState p_180428_5_, float p_180428_6_)
public boolean canExplosionDestroyBlock(Explosion explosionIn, IBlockReader worldIn, BlockPos pos, BlockState blockStateIn, float p_174816_5_)
public int getMaxFallHeight()
public Vec3d getLastPortalVec()
public Direction getTeleportDirection()
public boolean doesEntityNotTriggerPressurePlate()
public void fillCrashReport(CrashReportCategory category)
public boolean canRenderOnFire()
public void setUniqueId(java.util.UUID uniqueIdIn)
public java.util.UUID getUniqueID()
public java.lang.String getCachedUniqueIdString()
public java.lang.String getScoreboardName()
public boolean isPushedByWater()
public static double getRenderDistanceWeight()
public static void setRenderDistanceWeight(double renderDistWeight)
public ITextComponent getDisplayName()
getDisplayName
インタフェース内 INameable
public void setCustomName(@Nullable ITextComponent name)
@Nullable public ITextComponent getCustomName()
getCustomName
インタフェース内 INameable
public boolean hasCustomName()
hasCustomName
インタフェース内 INameable
public void setCustomNameVisible(boolean alwaysRenderNameTag)
public boolean isCustomNameVisible()
public final void teleportKeepLoaded(double p_223102_1_, double p_223102_3_, double p_223102_5_)
public void setPositionAndUpdate(double x, double y, double z)
public boolean getAlwaysRenderNameTagForRender()
public void notifyDataManagerChange(DataParameter<?> key)
public void recalculateSize()
public Direction getHorizontalFacing()
public Direction getAdjustedHorizontalFacing()
protected HoverEvent getHoverEvent()
public boolean isSpectatedByPlayer(ServerPlayerEntity player)
public AxisAlignedBB getBoundingBox()
public AxisAlignedBB getRenderBoundingBox()
protected AxisAlignedBB getBoundingBox(Pose p_213321_1_)
public void setBoundingBox(AxisAlignedBB bb)
protected float getEyeHeight(Pose poseIn, EntitySize sizeIn)
public float getEyeHeight(Pose p_213307_1_)
public final float getEyeHeight()
public boolean replaceItemInInventory(int inventorySlot, ItemStack itemStackIn)
public void sendMessage(ITextComponent component)
sendMessage
インタフェース内 ICommandSource
public BlockPos getPosition()
null
is not allowed! If you are not an entity in the world, return
the coordinates 0, 0, 0public Vec3d getPositionVector()
null
is not allowed! If you are not an entity in the world, return 0.0D,
0.0D, 0.0Dpublic World getEntityWorld()
null
is not allowed! If you are not an entity in the world, return the
overworld@Nullable public MinecraftServer getServer()
public ActionResultType applyPlayerInteraction(PlayerEntity player, Vec3d vec, Hand hand)
public boolean isImmuneToExplosions()
protected void applyEnchantments(LivingEntity entityLivingBaseIn, Entity entityIn)
public void addTrackingPlayer(ServerPlayerEntity player)
public void removeTrackingPlayer(ServerPlayerEntity player)
addTrackingPlayer(net.minecraft.entity.player.ServerPlayerEntity)
for
more information on tracking.public float getRotatedYaw(Rotation transformRotation)
public float getMirroredYaw(Mirror transformMirror)
public boolean ignoreItemEntityData()
TileEntity.onlyOpsCanSetNbt()
.For example, command block minecarts
and mob spawner minecarts
(spawning command
block minecarts or drops) are considered accessible.
public boolean setPositionNonDirty()
@Nullable public Entity getControllingPassenger()
public java.util.List<Entity> getPassengers()
public boolean isPassenger(Entity entityIn)
public boolean isPassenger(java.lang.Class<? extends Entity> p_205708_1_)
public java.util.Collection<Entity> getRecursivePassengers()
public java.util.stream.Stream<Entity> func_226276_cg_()
public boolean isOnePlayerRiding()
public Entity getLowestRidingEntity()
public boolean isRidingSameEntity(Entity entityIn)
public boolean isRidingOrBeingRiddenBy(Entity entityIn)
public void func_226265_a_(Entity.IMoveCallback p_226265_1_)
public boolean canPassengerSteer()
@Nullable public Entity getRidingEntity()
public PushReaction getPushReaction()
public SoundCategory getSoundCategory()
protected int getFireImmuneTicks()
public CommandSource getCommandSource()
protected int getPermissionLevel()
public boolean hasPermissionLevel(int p_211513_1_)
public boolean shouldReceiveFeedback()
shouldReceiveFeedback
インタフェース内 ICommandSource
public boolean shouldReceiveErrors()
shouldReceiveErrors
インタフェース内 ICommandSource
public boolean allowLogging()
allowLogging
インタフェース内 ICommandSource
public void lookAt(EntityAnchorArgument.Type p_200602_1_, Vec3d p_200602_2_)
public double getSubmergedHeight()
public final float getWidth()
public final float getHeight()
public abstract IPacket<?> createSpawnPacket()
public EntitySize getSize(Pose poseIn)
public Vec3d getPositionVec()
public Vec3d getMotion()
public void setMotion(Vec3d motionIn)
public void setMotion(double x, double y, double z)
public final double getPosX()
public double getPosXWidth(double p_226275_1_)
public double getPosXRandom(double p_226282_1_)
public final double getPosY()
public double getPosYHeight(double p_226283_1_)
public double getPosYRandom()
public double getPosYEye()
public final double getPosZ()
public double getPosZWidth(double p_226285_1_)
public double getPosZRandom(double p_226287_1_)
public void setRawPosition(double x, double y, double z)
posX
, posY
, and posZ
fields, without performing any collision
checks, updating the bounding box position, or sending any packets. In general, this is not what you want and
setPosition(double, double, double)
is better, as that handles the bounding box.public void checkDespawn()
public void moveForced(double p_225653_1_, double p_225653_3_, double p_225653_5_)
public void canUpdate(boolean value)
canUpdate
インタフェース内 IForgeEntity
public boolean canUpdate()
canUpdate
インタフェース内 IForgeEntity
public java.util.Collection<ItemEntity> captureDrops()
captureDrops
インタフェース内 IForgeEntity
public java.util.Collection<ItemEntity> captureDrops(java.util.Collection<ItemEntity> value)
captureDrops
インタフェース内 IForgeEntity
public CompoundNBT getPersistentData()
IForgeEntity
getPersistentData
インタフェース内 IForgeEntity
public boolean canTrample(BlockState state, BlockPos pos, float fallDistance)
IForgeEntity
Entity
can trample a Block
.canTrample
インタフェース内 IForgeEntity
pos
- The block posfallDistance
- The fall distancetrue
if this entity can trample, false
otherwisepublic final boolean isAddedToWorld()
IForgeEntity
World#onEntityAdded(Entity)
and
World#onEntityRemoved(Entity)
.isAddedToWorld
インタフェース内 IForgeEntity
public void onAddedToWorld()
IForgeEntity
onAddedToWorld
インタフェース内 IForgeEntity
public void onRemovedFromWorld()
IForgeEntity
onRemovedFromWorld
インタフェース内 IForgeEntity
public void revive()
IForgeEntity
revive
インタフェース内 IForgeEntity