Class Entity
java.lang.Object
fr.hytale.loader.api.Entity
- Direct Known Subclasses:
Player
Represents an entity in the Hytale world.
This class wraps a native Hytale entity and provides common methods for interaction, such as location management and removal.
- Since:
- 1.0.5
- Version:
- 1.0.6
- Author:
- HytaleLoader
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.hypixel.hytale.server.core.entity.Entity -
Constructor Summary
ConstructorsConstructorDescriptionEntity(com.hypixel.hytale.server.core.entity.Entity nativeEntity) Creates a new Entity wrapper. -
Method Summary
Modifier and TypeMethodDescriptionbooleanintgetID()Gets the network ID of the entity.Gets the entity's current location.com.hypixel.hytale.server.core.entity.EntityGets the native Hytale entity.getUUID()Gets the UUID of the entity.getWorld()Gets the World this entity is currently in.inthashCode()booleanisValid()Checks if the entity has been removed or is valid.voidremove()Removes the entity from the world.voidteleport(double x, double y, double z) Teleports the entity to coordinates.voidTeleports the entity to a location.
-
Field Details
-
nativeEntity
protected final com.hypixel.hytale.server.core.entity.Entity nativeEntity
-
-
Constructor Details
-
Entity
public Entity(com.hypixel.hytale.server.core.entity.Entity nativeEntity) Creates a new Entity wrapper.- Parameters:
nativeEntity- The native Hytale entity
-
-
Method Details
-
getNativeEntity
public com.hypixel.hytale.server.core.entity.Entity getNativeEntity()Gets the native Hytale entity.- Returns:
- The native entity
-
getID
public int getID()Gets the network ID of the entity.- Returns:
- The network ID, or -1 if invalid
-
getUUID
-
getWorld
Gets the World this entity is currently in.- Returns:
- The world, or null if removed/unloaded
-
remove
public void remove()Removes the entity from the world. -
isValid
public boolean isValid()Checks if the entity has been removed or is valid.- Returns:
- True if valid, false if removed
-
getLocation
Gets the entity's current location.- Returns:
- The location, or null if unavailable
-
teleport
Teleports the entity to a location.- Parameters:
location- The target location
-
teleport
public void teleport(double x, double y, double z) Teleports the entity to coordinates.- Parameters:
x- The X coordinatey- The Y coordinatez- The Z coordinate
-
equals
-
hashCode
-