Package rsb.methods
Class NPCs
java.lang.Object
rsb.methods.MethodProvider
rsb.methods.NPCs
Provides access to non-player characters.
-
Field Summary
FieldsModifier and TypeFieldDescriptionA filter that accepts all matches.Fields inherited from class rsb.methods.MethodProvider
methods
-
Method Summary
Modifier and TypeMethodDescriptionRSNPC[]
getAll()
Returns an array of all loaded RSNPCs.RSNPC[]
Returns an array of all loaded RSNPCs that are accepted by the provided FiltergetNearest
(int... ids) Returns the RSNPC that is nearest out of all of the RSPNCs with the provided ID(s).getNearest
(String... names) Returns the RSNPC that is nearest out of all of the RSPNCs with the provided name(s).getNearest
(Predicate<RSNPC> filter) Returns the RSNPC that is nearest out of all of loaded RSPNCs accepted by the provided Filter.net.runelite.api.NPC[]
getNPCs()
-
Field Details
-
ALL_FILTER
A filter that accepts all matches.
-
-
Method Details
-
getAll
Returns an array of all loaded RSNPCs.- Returns:
- An array of the loaded RSNPCs.
-
getAll
Returns an array of all loaded RSNPCs that are accepted by the provided Filter- Parameters:
filter
- Filters out unwanted matches.- Returns:
- An array of the loaded RSNPCs.
-
getNearest
Returns the RSNPC that is nearest out of all of loaded RSPNCs accepted by the provided Filter.- Parameters:
filter
- Filters out unwanted matches.- Returns:
- An RSNPC object representing the nearest RSNPC accepted by the provided Filter; or null if there are no matching NPCs in the current region.
-
getNPCs
public net.runelite.api.NPC[] getNPCs() -
getNearest
Returns the RSNPC that is nearest out of all of the RSPNCs with the provided ID(s). Can return null.- Parameters:
ids
- Allowed NPC IDs.- Returns:
- An RSNPC object representing the nearest RSNPC with one of the provided IDs; or null if there are no matching NPCs in the current region.
-
getNearest
Returns the RSNPC that is nearest out of all of the RSPNCs with the provided name(s). Can return null.- Parameters:
names
- Allowed NPC names.- Returns:
- An RSNPC object representing the nearest RSNPC with one of the provided names; or null if there are no matching NPCs in the current region.
-