Class Entity

java.lang.Object
fr.hytale.loader.api.Entity
Direct Known Subclasses:
Player

public class Entity extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    protected final com.hypixel.hytale.server.core.entity.Entity
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Entity(com.hypixel.hytale.server.core.entity.Entity nativeEntity)
    Creates a new Entity wrapper.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    int
    Gets the network ID of the entity.
    Gets the entity's current location.
    com.hypixel.hytale.server.core.entity.Entity
    Gets the native Hytale entity.
    Gets the UUID of the entity.
    Gets the World this entity is currently in.
    int
     
    boolean
    Checks if the entity has been removed or is valid.
    void
    Removes the entity from the world.
    void
    teleport(double x, double y, double z)
    Teleports the entity to coordinates.
    void
    teleport(Location location)
    Teleports the entity to a location.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • 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

      public UUID getUUID()
      Gets the UUID of the entity.
      Returns:
      The UUID, or null if invalid
    • getWorld

      public World 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

      public Location getLocation()
      Gets the entity's current location.
      Returns:
      The location, or null if unavailable
    • teleport

      public void teleport(Location location)
      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 coordinate
      y - The Y coordinate
      z - The Z coordinate
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object