Interface Entity

All Superinterfaces:
CommandSource, HoverEventSource<HoverEvent.ShowEntity>, Sound.Emitter, Sound.Source.Provider
All Known Subinterfaces:
Damageable, LivingEntity, Player

  • Method Details

    • entityId

      int entityId()
    • uuid

      UUID uuid()
    • displayName

      Component displayName()
    • type

      EntityType type()
    • world

      World world()
    • location

      Location location()
      Description copied from interface: CommandSource
      Gets the location that this command is being executed at.
      Specified by:
      location in interface CommandSource
      Returns:
      a cloned location instance.
    • chunk

      default ChunkPos chunk()
    • isRemoved

      boolean isRemoved()
    • remove

      void remove()
    • teleport

      boolean teleport(Location location)
      Teleports this entity to the given location within its current world.
      Parameters:
      location - the destination position and orientation
      Returns:
      true if the teleport happened, false if it was refused (for example because the entity has been removed)
      Since:
      0.1.0
    • teleport

      boolean teleport(World world, Location location)
      Teleports this entity to the given location, moving it to world when that differs from its current world.

      Cross-world teleports relocate the entity between worlds and, for players, trigger the client-side dimension change. The call is refused, returning false, when the entity is removed or the destination world cannot host it.

      Parameters:
      world - the destination world
      location - the destination position and orientation
      Returns:
      true if the teleport happened, false if it was refused
      Since:
      0.1.0
    • teleport

      default boolean teleport(double x, double y, double z)
      Parameters:
      x - the destination x coordinate
      y - the destination y coordinate
      z - the destination z coordinate
      Returns:
      true if the teleport happened, false if it was refused
      Since:
      0.1.0
    • teleport

      default boolean teleport(Entity target)
      Parameters:
      target - the entity to teleport to
      Returns:
      true if the teleport happened, false if it was refused
      Since:
      0.1.0