Interface IFriends


public interface IFriends
Interface for interacting with the friends list in the game.

This interface provides methods to query and filter friends by various criteria such as name, world, and online status. It allows checking if specific players are added as friends and retrieving friend information.

See Also:
  • Friend
  • Method Summary

    Modifier and Type
    Method
    Description
    default List<net.runelite.api.Friend>
    getAll(int... worlds)
    Gets all friends currently on any of the specified worlds.
    default List<net.runelite.api.Friend>
    getAll(String... names)
    Gets all friends with any of the specified names.
    List<net.runelite.api.Friend>
    getAll(Predicate<net.runelite.api.Friend> filter)
    Gets all friends that match the specified filter predicate.
    default net.runelite.api.Friend
    getFirst(int... worlds)
    Gets the first friend currently on any of the specified worlds.
    default net.runelite.api.Friend
    getFirst(String... names)
    Gets the first friend with any of the specified names.
    default net.runelite.api.Friend
    getFirst(Predicate<net.runelite.api.Friend> filter)
    Gets the first friend that matches the specified filter predicate.
    boolean
    Checks if a player with the specified name is on the friends list.
    boolean
    Checks if a friend with the specified name is currently online.
    default boolean
    isOnline(net.runelite.api.Friend friend)
    Checks if the specified friend is currently online.
  • Method Details

    • getAll

      List<net.runelite.api.Friend> getAll(Predicate<net.runelite.api.Friend> filter)
      Gets all friends that match the specified filter predicate.
      Parameters:
      filter - the predicate to filter friends
      Returns:
      a list of friends matching the filter
    • getAll

      default List<net.runelite.api.Friend> getAll(String... names)
      Gets all friends with any of the specified names.
      Parameters:
      names - the names to search for (exact match)
      Returns:
      a list of friends with matching names
    • getAll

      default List<net.runelite.api.Friend> getAll(int... worlds)
      Gets all friends currently on any of the specified worlds.
      Parameters:
      worlds - the world numbers to filter by
      Returns:
      a list of friends on the specified worlds
    • getFirst

      default net.runelite.api.Friend getFirst(Predicate<net.runelite.api.Friend> filter)
      Gets the first friend that matches the specified filter predicate.
      Parameters:
      filter - the predicate to filter friends
      Returns:
      the first matching friend, or null if none found
    • getFirst

      default net.runelite.api.Friend getFirst(String... names)
      Gets the first friend with any of the specified names.
      Parameters:
      names - the names to search for (exact match)
      Returns:
      the first matching friend, or null if none found
    • getFirst

      default net.runelite.api.Friend getFirst(int... worlds)
      Gets the first friend currently on any of the specified worlds.
      Parameters:
      worlds - the world numbers to filter by
      Returns:
      the first matching friend, or null if none found
    • isAdded

      boolean isAdded(String name)
      Checks if a player with the specified name is on the friends list.
      Parameters:
      name - the player name to check
      Returns:
      true if the player is added as a friend, false otherwise
    • isOnline

      default boolean isOnline(net.runelite.api.Friend friend)
      Checks if the specified friend is currently online.
      Parameters:
      friend - the friend to check
      Returns:
      true if the friend is online, false otherwise
    • isOnline

      boolean isOnline(String name)
      Checks if a friend with the specified name is currently online.
      Parameters:
      name - the friend's name to check
      Returns:
      true if the friend is online, false otherwise