swapArmorItem

fun swapArmorItem(itemName: String, blockedSlots: Int = 0, ignoreCase: Boolean = true): Int?

Swaps out the first item found that matches the given name with the corresponding worn armor piece.

Armor swaps must only be performed when the inventory is open. It is checked whether the inventory is alr open, if not the method will return null or open the inventory if specified through openInv.

Return

The armor slot that swapped or null if nothing was done. 0 is Helmet, 1 is Chest plate, 2 is Leggings, 3 is Boots.

Parameters

blockedSlots

4 bits containing which armor pieces should not be swapped. The right most bit is the helmet. If it is 1 the helmet will not be swapped.