public abstract class BaseEntity extends Object implements Entity, Metadatable
| Modifier and Type | Field and Description |
|---|---|
protected float |
absorption |
protected int |
age |
List<Block> |
blocksAround |
protected AxisAlignedBB |
boundingBox |
Chunk |
chunk |
boolean |
closed |
List<Block> |
collisionBlockStates |
protected SyncedEntityData |
data |
int |
deadTicks |
protected it.unimi.dsi.fastutil.shorts.Short2ObjectMap<Effect> |
effects |
protected float |
entityCollisionReduction |
float |
fallDistance |
boolean |
fireProof |
int |
fireTicks |
boolean |
firstMove |
protected Set<Player> |
hasSpawned |
protected float |
health |
float |
highestPosition |
boolean |
inBlock |
int |
inPortalTicks |
boolean |
invulnerable |
boolean |
isCollided |
boolean |
isCollidedHorizontally |
boolean |
isCollidedVertically |
protected boolean |
isPlayer |
protected boolean |
isStatic |
boolean |
justCreated |
boolean |
keepMovement |
protected EntityDamageEvent |
lastDamageCause |
protected com.nukkitx.math.vector.Vector3f |
lastMotion |
protected float |
lastPitch |
protected com.nukkitx.math.vector.Vector3f |
lastPosition |
int |
lastUpdate |
protected float |
lastYaw |
protected Level |
level |
int |
maxFireTicks |
protected com.nukkitx.math.vector.Vector3f |
motion |
boolean |
motionChanged |
int |
noDamageTicks |
boolean |
onGround |
protected List<Entity> |
passengers |
protected float |
pitch |
protected float |
pitchDelta |
protected com.nukkitx.math.vector.Vector3f |
position |
boolean |
positionChanged |
float |
scale |
protected Server |
server |
com.nukkitx.nbt.NbtMap |
tag |
int |
ticksLived |
protected Timing |
timing |
protected Entity |
vehicle |
protected float |
yaw |
protected float |
yawDelta |
protected float |
ySize |
| Constructor and Description |
|---|
BaseEntity(EntityType<?> type,
Location location) |
| Modifier and Type | Method and Description |
|---|---|
void |
addEffect(Effect effect) |
void |
addMotion(com.nukkitx.math.vector.Vector3f motion) |
void |
addMovement(double x,
double y,
double z,
double yaw,
double pitch,
double headYaw) |
boolean |
attack(EntityDamageEvent source) |
boolean |
attack(float damage) |
protected void |
broadcastLinkPacket(Entity vehicle,
com.nukkitx.protocol.bedrock.data.entity.EntityLinkData.Type type) |
boolean |
canBeMovedByCurrents()
Returns whether this entity can be moved by currents in liquids.
|
boolean |
canClimb() |
boolean |
canClimbWalls() |
boolean |
canCollide() |
boolean |
canCollideWith(Entity entity) |
boolean |
canPassThrough() |
boolean |
canTriggerPressurePlate()
Whether the entity can active pressure plates.
|
boolean |
canTriggerWalking() |
protected void |
checkBlockCollision() |
protected void |
checkChunks() |
protected void |
checkGroundState(double movX,
double movY,
double movZ,
double dx,
double dy,
double dz) |
protected boolean |
checkObstruction(float x,
float y,
float z) |
protected boolean |
checkObstruction(com.nukkitx.math.vector.Vector3f pos) |
void |
close() |
protected com.nukkitx.protocol.bedrock.BedrockPacket |
createAddEntityPacket() |
void |
despawnFrom(Player player) |
void |
despawnFromAll() |
boolean |
dismount(Entity vehicle) |
boolean |
entityBaseTick() |
boolean |
entityBaseTick(int tickDiff) |
void |
extinguish() |
void |
fall(float fallDistance) |
boolean |
fastMove(float dx,
float dy,
float dz) |
float |
getAbsorption() |
short |
getAir() |
protected float |
getBaseOffset() |
List<Block> |
getBlocksAround() |
AxisAlignedBB |
getBoundingBox() |
CardinalDirection |
getCardinalDirection() |
List<Block> |
getCollisionBlocks() |
SyncedEntityData |
getData() |
Direction |
getDirection() |
com.nukkitx.math.vector.Vector2f |
getDirectionPlane() |
com.nukkitx.math.vector.Vector3f |
getDirectionVector() |
float |
getDrag() |
Effect |
getEffect(int effectId) |
it.unimi.dsi.fastutil.shorts.Short2ObjectMap<Effect> |
getEffects() |
float |
getEyeHeight() |
int |
getFireTicks() |
float |
getGravity() |
float |
getHealth() |
float |
getHeight() |
float |
getHighestPosition() |
Direction |
getHorizontalDirection() |
EntityDamageEvent |
getLastDamageCause() |
float |
getLength() |
Level |
getLevel() |
Location |
getLocation() |
int |
getMaxHealth() |
List<MetadataValue> |
getMetadata(String metadataKey) |
com.nukkitx.math.vector.Vector3f |
getMotion() |
com.nukkitx.math.vector.Vector3f |
getMountedOffset(Entity entity) |
String |
getName() |
String |
getNameTag() |
int |
getNoDamageTicks() |
Entity |
getOwner() |
Entity |
getPassenger() |
List<Entity> |
getPassengers() |
float |
getPitch() |
com.nukkitx.math.vector.Vector3f |
getPosition() |
long |
getRuntimeId() |
float |
getScale() |
String |
getScoreTag() |
com.nukkitx.math.vector.Vector3f |
getSeatPosition() |
Server |
getServer() |
protected float |
getStepHeight() |
com.nukkitx.nbt.NbtMap |
getTag() |
EntityType<?> |
getType() |
long |
getUniqueId() |
Entity |
getVehicle() |
Set<Player> |
getViewers() |
float |
getWidth() |
float |
getX() |
float |
getY() |
float |
getYaw() |
float |
getZ() |
void |
handleLavaMovement() |
boolean |
hasControllingPassenger() |
boolean |
hasEffect(int effectId) |
boolean |
hasMetadata(String metadataKey) |
boolean |
hasNameTag() |
void |
heal(EntityRegainHealthEvent source) |
void |
heal(float amount) |
protected void |
init(Location location) |
protected void |
initEntity() |
boolean |
isAlive() |
boolean |
isClosed() |
boolean |
isControlling(Entity entity) |
boolean |
isImmobile() |
boolean |
isInsideOfFire() |
boolean |
isInsideOfSolid() |
boolean |
isInsideOfWater() |
boolean |
isInvulnerable() |
boolean |
isNameTagAlwaysVisible() |
boolean |
isNameTagVisible() |
boolean |
isOnGround() |
boolean |
isPassenger(Entity entity) |
void |
kill() |
void |
loadAdditionalData(com.nukkitx.nbt.NbtMap tag) |
boolean |
mount(Entity vehicle,
com.nukkitx.protocol.bedrock.data.entity.EntityLinkData.Type mode)
Mount or dismounts an Entity from a/into vehicle
|
boolean |
move(float dx,
float dy,
float dz) |
boolean |
move(com.nukkitx.math.vector.Vector3f d) |
void |
onCollideWithPlayer(Human entityPlayer) |
void |
onDismount(Entity passenger) |
void |
onEntityCollision(Entity entity) |
boolean |
onInteract(Player player,
Item item) |
boolean |
onInteract(Player player,
Item item,
com.nukkitx.math.vector.Vector3f clickedPos) |
void |
onMount(Entity passenger) |
void |
onStruckByLightning(LightningBolt lightningBolt) |
boolean |
onUpdate(int currentTick) |
void |
recalculateBoundingBox() |
protected void |
recalculateEffectColor() |
void |
removeAllEffects() |
void |
removeEffect(int effectId) |
void |
removeMetadata(String metadataKey,
Plugin owningPlugin) |
void |
resetFallDistance() |
void |
respawnToAll() |
void |
saveAdditionalData(com.nukkitx.nbt.NbtMapBuilder tag) |
void |
scheduleUpdate() |
void |
sendData(Player player) |
void |
sendData(Player player,
com.nukkitx.protocol.bedrock.data.entity.EntityData... data) |
void |
sendFlags(Player player) |
void |
sendPotionEffects(Player player) |
void |
setAbsorption(float absorption) |
void |
setAir(short air) |
void |
setCanClimb() |
void |
setCanClimb(boolean value) |
void |
setCanClimbWalls() |
void |
setCanClimbWalls(boolean value) |
void |
setFallDistance(float fallDistance) |
void |
setHealth(float health) |
void |
setHighestPosition(float highestPosition) |
void |
setImmobile() |
void |
setImmobile(boolean value) |
void |
setInvulnerable(boolean invulnerable) |
void |
setLastDamageCause(EntityDamageEvent type) |
void |
setMaxHealth(int maxHealth) |
void |
setMetadata(String metadataKey,
MetadataValue newMetadataValue) |
boolean |
setMotion(com.nukkitx.math.vector.Vector3f motion) |
void |
setNameTag(String name) |
void |
setNameTagAlwaysVisible() |
void |
setNameTagAlwaysVisible(boolean value) |
void |
setNameTagVisible() |
void |
setNameTagVisible(boolean value) |
void |
setNoDamageTicks(int noDamageTicks) |
void |
setOnFire(int seconds) |
void |
setOnGround(boolean onGround) |
void |
setOwner(Entity entity) |
boolean |
setPosition(com.nukkitx.math.vector.Vector3f pos) |
boolean |
setPositionAndRotation(com.nukkitx.math.vector.Vector3f pos,
float yaw,
float pitch) |
void |
setRotation(float yaw,
float pitch) |
void |
setScale(float scale) |
void |
setScoreTag(String score) |
void |
setSeatPosition(com.nukkitx.math.vector.Vector3f pos) |
void |
spawnTo(Player player) |
void |
spawnToAll() |
protected boolean |
switchLevel(Level targetLevel) |
boolean |
teleport(Location location) |
boolean |
teleport(Location location,
PlayerTeleportEvent.TeleportCause cause) |
boolean |
teleport(com.nukkitx.math.vector.Vector3f pos) |
boolean |
teleport(com.nukkitx.math.vector.Vector3f pos,
PlayerTeleportEvent.TeleportCause cause) |
String |
toString() |
protected void |
updateFallState(boolean onGround) |
void |
updateMovement() |
protected void |
updatePassengerPosition(Entity passenger) |
void |
updatePassengers() |
protected final it.unimi.dsi.fastutil.shorts.Short2ObjectMap<Effect> effects
protected final SyncedEntityData data
public Chunk chunk
public com.nukkitx.nbt.NbtMap tag
public float highestPosition
public boolean firstMove
protected com.nukkitx.math.vector.Vector3f position
protected com.nukkitx.math.vector.Vector3f lastPosition
protected com.nukkitx.math.vector.Vector3f motion
protected com.nukkitx.math.vector.Vector3f lastMotion
protected float yaw
protected float pitch
protected float lastYaw
protected float lastPitch
protected float pitchDelta
protected float yawDelta
protected float entityCollisionReduction
public boolean onGround
public boolean inBlock
public boolean positionChanged
public boolean motionChanged
public int deadTicks
public boolean keepMovement
public float fallDistance
public int ticksLived
public int lastUpdate
public int maxFireTicks
public int fireTicks
public int inPortalTicks
public float scale
protected AxisAlignedBB boundingBox
public boolean isCollided
public boolean isCollidedHorizontally
public boolean isCollidedVertically
public int noDamageTicks
public boolean justCreated
public boolean fireProof
public boolean invulnerable
protected Level level
public boolean closed
protected Entity vehicle
protected EntityDamageEvent lastDamageCause
protected int age
protected float health
protected float absorption
protected float ySize
protected boolean isStatic
protected Server server
protected Timing timing
protected boolean isPlayer
public BaseEntity(EntityType<?> type, Location location)
public float getEyeHeight()
getEyeHeight in interface Entityprotected float getStepHeight()
public boolean canCollide()
canCollide in interface Entitypublic float getGravity()
getGravity in interface Entityprotected float getBaseOffset()
protected void initEntity()
public EntityType<?> getType()
public void loadAdditionalData(com.nukkitx.nbt.NbtMap tag)
loadAdditionalData in interface Entitypublic void saveAdditionalData(com.nukkitx.nbt.NbtMapBuilder tag)
saveAdditionalData in interface Entitypublic SyncedEntityData getData()
public boolean hasNameTag()
hasNameTag in interface Entitypublic String getNameTag()
getNameTag in interface Entitypublic void setNameTag(String name)
setNameTag in interface Entitypublic boolean isNameTagVisible()
isNameTagVisible in interface Entitypublic void setNameTagVisible(boolean value)
public void setNameTagVisible()
public boolean isNameTagAlwaysVisible()
public void setNameTagAlwaysVisible(boolean value)
public void setNameTagAlwaysVisible()
public String getScoreTag()
public void setScoreTag(String score)
public boolean isImmobile()
public void setImmobile(boolean value)
public void setImmobile()
public boolean canClimb()
public void setCanClimb()
public void setCanClimb(boolean value)
public boolean canClimbWalls()
public void setCanClimbWalls()
public void setCanClimbWalls(boolean value)
public short getAir()
public void setAir(short air)
public boolean isInvulnerable()
public void setInvulnerable(boolean invulnerable)
public List<Entity> getPassengers()
getPassengers in interface Entitypublic Entity getPassenger()
public boolean isPassenger(Entity entity)
isPassenger in interface Entitypublic boolean isControlling(Entity entity)
isControlling in interface Entitypublic boolean hasControllingPassenger()
hasControllingPassenger in interface Entitypublic Entity getVehicle()
getVehicle in interface Entitypublic it.unimi.dsi.fastutil.shorts.Short2ObjectMap<Effect> getEffects()
getEffects in interface Entitypublic void removeAllEffects()
removeAllEffects in interface Entitypublic void removeEffect(int effectId)
removeEffect in interface Entitypublic void recalculateBoundingBox()
protected void recalculateEffectColor()
protected final void init(Location location)
protected com.nukkitx.protocol.bedrock.BedrockPacket createAddEntityPacket()
public Set<Player> getViewers()
getViewers in interface Entitypublic void sendPotionEffects(Player player)
public void sendData(Player player)
public void sendData(Player player, com.nukkitx.protocol.bedrock.data.entity.EntityData... data)
public void sendFlags(Player player)
public void despawnFrom(Player player)
despawnFrom in interface Entitypublic boolean attack(EntityDamageEvent source)
public void heal(EntityRegainHealthEvent source)
public EntityDamageEvent getLastDamageCause()
getLastDamageCause in interface Entitypublic void setLastDamageCause(EntityDamageEvent type)
public int getMaxHealth()
getMaxHealth in interface Entitypublic void setMaxHealth(int maxHealth)
setMaxHealth in interface Entitypublic boolean canCollideWith(Entity entity)
canCollideWith in interface Entityprotected boolean checkObstruction(com.nukkitx.math.vector.Vector3f pos)
protected boolean checkObstruction(float x,
float y,
float z)
public boolean entityBaseTick()
public boolean entityBaseTick(int tickDiff)
public void updateMovement()
public void addMovement(double x,
double y,
double z,
double yaw,
double pitch,
double headYaw)
public void addMotion(com.nukkitx.math.vector.Vector3f motion)
public com.nukkitx.math.vector.Vector3f getDirectionVector()
getDirectionVector in interface Entitypublic com.nukkitx.math.vector.Vector2f getDirectionPlane()
getDirectionPlane in interface Entitypublic Direction getHorizontalDirection()
getHorizontalDirection in interface Entitypublic CardinalDirection getCardinalDirection()
public boolean mount(Entity vehicle, com.nukkitx.protocol.bedrock.data.entity.EntityLinkData.Type mode)
public void onDismount(Entity passenger)
onDismount in interface Entityprotected void broadcastLinkPacket(Entity vehicle, com.nukkitx.protocol.bedrock.data.entity.EntityLinkData.Type type)
public void updatePassengers()
protected void updatePassengerPosition(Entity passenger)
public com.nukkitx.math.vector.Vector3f getSeatPosition()
getSeatPosition in interface Entitypublic void setSeatPosition(com.nukkitx.math.vector.Vector3f pos)
setSeatPosition in interface Entitypublic com.nukkitx.math.vector.Vector3f getMountedOffset(Entity entity)
public final void scheduleUpdate()
public int getNoDamageTicks()
getNoDamageTicks in interface Entitypublic void setNoDamageTicks(int noDamageTicks)
setNoDamageTicks in interface Entitypublic int getFireTicks()
getFireTicks in interface Entitypublic float getAbsorption()
getAbsorption in interface Entitypublic void setAbsorption(float absorption)
setAbsorption in interface Entitypublic Direction getDirection()
getDirection in interface Entitypublic void extinguish()
extinguish in interface Entitypublic boolean canTriggerWalking()
public float getHighestPosition()
getHighestPosition in interface Entitypublic void setHighestPosition(float highestPosition)
setHighestPosition in interface Entitypublic void setFallDistance(float fallDistance)
public void resetFallDistance()
resetFallDistance in interface Entityprotected void updateFallState(boolean onGround)
public AxisAlignedBB getBoundingBox()
getBoundingBox in interface Entitypublic void handleLavaMovement()
public void onCollideWithPlayer(Human entityPlayer)
public void onEntityCollision(Entity entity)
onEntityCollision in interface Entitypublic void onStruckByLightning(LightningBolt lightningBolt)
onStruckByLightning in interface Entitypublic boolean onInteract(Player player, Item item, com.nukkitx.math.vector.Vector3f clickedPos)
onInteract in interface Entityprotected boolean switchLevel(Level targetLevel)
public com.nukkitx.math.vector.Vector3f getPosition()
getPosition in interface Entitypublic Location getLocation()
getLocation in interface Entitypublic boolean isInsideOfWater()
public boolean isInsideOfSolid()
public boolean isInsideOfFire()
public boolean fastMove(float dx,
float dy,
float dz)
public boolean move(com.nukkitx.math.vector.Vector3f d)
public boolean move(float dx,
float dy,
float dz)
protected void checkGroundState(double movX,
double movY,
double movZ,
double dx,
double dy,
double dz)
public boolean canBeMovedByCurrents()
canBeMovedByCurrents in interface Entityprotected void checkBlockCollision()
public boolean setPositionAndRotation(com.nukkitx.math.vector.Vector3f pos,
float yaw,
float pitch)
setPositionAndRotation in interface Entitypublic void setRotation(float yaw,
float pitch)
setRotation in interface Entitypublic boolean canTriggerPressurePlate()
EntityBats only.canTriggerPressurePlate in interface Entitypublic boolean canPassThrough()
canPassThrough in interface Entityprotected void checkChunks()
public boolean setPosition(com.nukkitx.math.vector.Vector3f pos)
setPosition in interface Entitypublic com.nukkitx.math.vector.Vector3f getMotion()
public boolean setMotion(com.nukkitx.math.vector.Vector3f motion)
public boolean isOnGround()
isOnGround in interface Entitypublic void setOnGround(boolean onGround)
setOnGround in interface Entitypublic boolean teleport(com.nukkitx.math.vector.Vector3f pos)
public boolean teleport(com.nukkitx.math.vector.Vector3f pos,
PlayerTeleportEvent.TeleportCause cause)
public boolean teleport(Location location, PlayerTeleportEvent.TeleportCause cause)
public long getUniqueId()
getUniqueId in interface Entitypublic long getRuntimeId()
getRuntimeId in interface Entitypublic void respawnToAll()
public void spawnToAll()
spawnToAll in interface Entitypublic void despawnFromAll()
despawnFromAll in interface Entitypublic void setMetadata(String metadataKey, MetadataValue newMetadataValue)
setMetadata in interface Metadatablepublic List<MetadataValue> getMetadata(String metadataKey)
getMetadata in interface Metadatablepublic boolean hasMetadata(String metadataKey)
hasMetadata in interface Metadatablepublic void removeMetadata(String metadataKey, Plugin owningPlugin)
removeMetadata in interface MetadatableCopyright © 2020. All rights reserved.