isHolding

fun EntityPlayerSP?.isHolding(vararg attributes: SkyblockItem.Attribute): Boolean

Check whether the player is holding an item with one of the specified attributes.

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


fun EntityPlayerSP?.isHolding(vararg items: SkyblockItem): Boolean

Check whether the player is holding one of the given items. Returns null if no matches were found.


fun EntityPlayerSP?.isHolding(vararg names: String, ignoreCase: Boolean = false, mode: Int = 0): Boolean

Check whether the player is holding one of the given items. Can check both the name and item ID.

Parameters

names

The name or item ID.

ignoreCase

Applies for the item name check.

mode

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


fun EntityPlayerSP?.isHolding(regex: Regex, mode: Int = 0): Boolean

Check whether the player is holding the given item. Can check both the name and item ID.

Parameters

regex

regex that has to be matched.

mode

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


fun EntityPlayerSP?.isHolding(predicate: (ItemStack?) -> Boolean): Boolean

Check whether the held item is matching the predicate.