Crab.swap()

From 8x9craft
Jump to: navigation, search
function swap(firstSlot: Number, secondSlot: Number): boolean

Swap items in the crab's inventory.

Parameters:

firstSlot: Number - crab's inventory slot number of the first item to swap. Counting starts at 0 and there are 15 slots in all, so valid slot number values are within 0..14.
secondSlot: Number - crab's inventory slot number of the second item to swap.

Returns: true or false depending on whether crab could swap items or not.

Examples

// Swap items in the crab inventory's first and last slot.
crab.swap(0, 14);

See also