swapItemToSlot

fun swapItemToSlot(sourceSlot: Int, targetSlot: Int): Boolean

Swaps the item in sourceSlot to the targetSlot in your hotbar.

Keep in mind that this swap is not instantaneous it gets queued to happen at the end of the tick. Use mc.thePlayer.inventory.currentItem as target if you want to swap the item to the currently selected hotbar slot.

Return

true if the swap was successful, false otherwise.

See also

Parameters

targetSlot

the slot in your hotbar that the item should be swapped to. Hsa to be in between 0 and 8.


fun swapItemToSlot(regex: Regex, target: Int, matchMode: Int = 0): Boolean

Looks for the specified item in your inventory queues to and swaps it to the specified target slot.

Keep in mind that this swap is not instantaneous it gets queued to happen at the end of the tick. Use mc.thePlayer.inventory.currentItem as target if you want to swap the item to the currently selected hotbar slot.

Return

true if the swap was successful, false otherwise.

See also

Parameters

target

the slot in your hotbar that the item should be swapped to. Hsa to be in between 0 and 8.

matchMode

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