findItem

fun findItem(vararg attributes: SkyblockItem.Attribute, inInv: Boolean = false): Int?

Returns the first slot where an item with one of the specified attributes is found. Returns null if no matches were found.

SkyblockItem is used to determine whether an item meets an attribute.

Parameters

inInv

Will also search in the inventory and not only in the hotbar


fun findItem(item: SkyblockItem, inInv: Boolean = false): Int?

Returns the first slot where the specified item is found. Returns null if no matches were found.

Parameters

inInv

Will also search in the inventory and not only in the hotbar


fun findItem(name: String, ignoreCase: Boolean = false, inInv: Boolean = false, mode: Int = 0): Int?

Returns the first slot where the item name or id passes a check for name. The item name is checked to contain name. The item id is checked for a full match with name. Returns null if no matches were found.

Parameters

name

The name or item ID to find.

ignoreCase

Applies for the item name check.

inInv

Will also search in the inventory and not only in the hotbar

mode

Specify what to check. 0: display name and item id. 1: only display name. 2: only itemID.


fun findItem(regex: Regex, inInv: Boolean = false, mode: Int = 0): Int?

Returns the first slot where the item name or id passes a check for the regex. The item name is checked to contain the regex. The item id is checked for a full match. Returns null if no matches were found.

For case insensitivity use the flag "(?i)":

val regex = Regex("(?i)item name")

Parameters

regex

regex that has to be matched.

inInv

Will also search in the inventory and not only in the hotbar

mode

Specify what to check. 0: display name and item id. 1: only display name. 2: only itemID.


fun findItem(inInv: Boolean = false, predicate: (ItemStack?) -> Boolean): Int?

Returns the first slot where the ItemStack matches the predicate or null if no matches were found.

Parameters

inInv

Will also search in the inventory and not only in the hotbar