public class BaseEntity extends Object implements Entity
| Modifier and Type | Field and Description |
|---|---|
protected com.nukkitx.protocol.bedrock.data.EntityFlags |
metadataFlags |
| Constructor and Description |
|---|
BaseEntity(EntityType entityType,
com.flowpowered.math.vector.Vector3f position,
NukkitLevel level,
NukkitServer server) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkIfAlive() |
com.nukkitx.protocol.bedrock.BedrockPacket |
createAddEntityPacket() |
<C extends EntityComponent> |
get(Class<C> clazz) |
BoundingBox |
getBoundingBox() |
long |
getEntityId() |
protected boolean |
getFlag(com.nukkitx.protocol.bedrock.data.EntityFlag flag) |
com.flowpowered.math.vector.Vector3f |
getGamePosition() |
float |
getHeight() |
float |
getLength() |
NukkitLevel |
getLevel() |
protected com.nukkitx.protocol.bedrock.data.MetadataDictionary |
getMetadata() |
protected com.nukkitx.protocol.bedrock.data.MetadataDictionary |
getMetadataFlags() |
com.flowpowered.math.vector.Vector3f |
getMotion() |
float |
getOffset() |
com.flowpowered.math.vector.Vector3f |
getPosition() |
Rotation |
getRotation() |
NukkitServer |
getServer() |
long |
getTickCreated() |
long |
getTicksLived() |
Optional<Entity> |
getVehicle() |
float |
getWidth() |
boolean |
isAffectedByGravity() |
boolean |
isAlive() |
boolean |
isCustomNameVisible() |
boolean |
isInsideVehicle() |
boolean |
isInvulnerable() |
boolean |
isMovementStale() |
boolean |
isOnGround() |
boolean |
isRemoved() |
boolean |
isSneaking() |
protected boolean |
isTeleported() |
boolean |
leaveVehicle() |
void |
onAttributeUpdate(com.nukkitx.protocol.bedrock.data.Attribute attribute) |
boolean |
onItemPickup(ItemStack item) |
protected void |
onMetadataUpdate(com.nukkitx.protocol.bedrock.data.MetadataDictionary metadata) |
Set<Class<? extends EntityComponent>> |
providedComponents() |
<C extends EntityComponent> |
provides(Class<C> clazz) |
void |
push(com.flowpowered.math.vector.Vector3f motion) |
protected <C extends EntityComponent> |
registerComponent(Class<C> clazz,
C component) |
void |
remove() |
void |
resetStaleMovement() |
protected void |
save() |
void |
setAffectedByGravity(boolean affectedByGravity) |
void |
setCustomNameVisible(boolean flag) |
protected void |
setEntityId(long entityId) |
protected void |
setFlag(com.nukkitx.protocol.bedrock.data.EntityFlag flag,
boolean value) |
void |
setInvulnerable(boolean flag) |
void |
setMotion(com.flowpowered.math.vector.Vector3f motion) |
void |
setPosition(com.flowpowered.math.vector.Vector3f position) |
void |
setPositionFromSystem(com.flowpowered.math.vector.Vector3f position) |
void |
setRotation(Rotation rotation) |
void |
setSneaking(boolean sneaking) |
void |
setTickCreated(long tickCreated) |
void |
setTicksLived(long ticks) |
boolean |
teleport(Entity destination) |
boolean |
teleport(com.flowpowered.math.vector.Vector3f position) |
boolean |
teleport(com.flowpowered.math.vector.Vector3f location,
Level level) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitensureAndGet, getDirectionVectorprotected final com.nukkitx.protocol.bedrock.data.EntityFlags metadataFlags
public BaseEntity(EntityType entityType, com.flowpowered.math.vector.Vector3f position, NukkitLevel level, NukkitServer server)
public com.nukkitx.protocol.bedrock.BedrockPacket createAddEntityPacket()
@Nonnull public Rotation getRotation()
getRotation in interface Entity@Nonnull public com.flowpowered.math.vector.Vector3f getMotion()
@Nonnull public com.flowpowered.math.vector.Vector3f getPosition()
getPosition in interface Entitypublic void setPosition(@Nonnull com.flowpowered.math.vector.Vector3f position)
setPosition in interface Entitypublic void setPositionFromSystem(@Nonnull com.flowpowered.math.vector.Vector3f position)
setPositionFromSystem in interface Entity@Nonnull public com.flowpowered.math.vector.Vector3f getGamePosition()
getGamePosition in interface Entity@Nonnull public BoundingBox getBoundingBox()
getBoundingBox in interface Entitypublic void setMotion(com.flowpowered.math.vector.Vector3f motion)
public float getLength()
public boolean isOnGround()
isOnGround in interface Entitypublic NukkitLevel getLevel()
public boolean teleport(com.flowpowered.math.vector.Vector3f position)
public boolean teleport(com.flowpowered.math.vector.Vector3f location,
Level level)
public long getEntityId()
getEntityId in interface Entitypublic boolean isRemoved()
public final void checkIfAlive()
@Nonnull public NukkitServer getServer()
public void push(@Nonnull com.flowpowered.math.vector.Vector3f motion)
public long getTickCreated()
getTickCreated in interface Entitypublic void setTickCreated(long tickCreated)
setTickCreated in interface Entitypublic long getTicksLived()
getTicksLived in interface Entitypublic void setTicksLived(long ticks)
setTicksLived in interface Entitypublic boolean isInsideVehicle()
isInsideVehicle in interface Entitypublic boolean leaveVehicle()
leaveVehicle in interface Entitypublic Optional<Entity> getVehicle()
getVehicle in interface Entitypublic boolean isCustomNameVisible()
isCustomNameVisible in interface Entitypublic void setCustomNameVisible(boolean flag)
setCustomNameVisible in interface Entitypublic boolean isInvulnerable()
isInvulnerable in interface Entitypublic void setInvulnerable(boolean flag)
setInvulnerable in interface Entitypublic boolean isSneaking()
isSneaking in interface Entitypublic void setSneaking(boolean sneaking)
setSneaking in interface Entitypublic boolean isAffectedByGravity()
isAffectedByGravity in interface Entitypublic void setAffectedByGravity(boolean affectedByGravity)
setAffectedByGravity in interface Entity@Nonnull public Set<Class<? extends EntityComponent>> providedComponents()
providedComponents in interface Entitypublic <C extends EntityComponent> boolean provides(@Nonnull Class<C> clazz)
protected <C extends EntityComponent> void registerComponent(Class<C> clazz, C component)
public <C extends EntityComponent> Optional<C> get(@Nonnull Class<C> clazz)
protected void setFlag(com.nukkitx.protocol.bedrock.data.EntityFlag flag,
boolean value)
protected com.nukkitx.protocol.bedrock.data.MetadataDictionary getMetadataFlags()
protected com.nukkitx.protocol.bedrock.data.MetadataDictionary getMetadata()
protected void onMetadataUpdate(com.nukkitx.protocol.bedrock.data.MetadataDictionary metadata)
protected boolean getFlag(com.nukkitx.protocol.bedrock.data.EntityFlag flag)
protected void setEntityId(long entityId)
protected boolean isTeleported()
public void onAttributeUpdate(com.nukkitx.protocol.bedrock.data.Attribute attribute)
public boolean isMovementStale()
public void resetStaleMovement()
public boolean onItemPickup(ItemStack item)
protected void save()
Copyright © 2017–2019 NukkitX. All rights reserved.