Inventory

Inventory functions

isAnyScreenOpened()

Returns true if any screen opened.

Returns:

  • (boolean).

-- Example code showing how to use the function
local isOpened = player.inventory.isAnyScreenOpened()

isSignOpened()

Returns true if sign opened.

Returns:

  • (boolean).

-- Example code showing how to use the function
local isOpened = player.inventory.isSignOpened()

getSignText(line)

Returns line of sign.

Returns:

  • (string).

-- Example code showing how to use the function
if player.inventory.isSignOpened() then
    local line = player.inventory.getSignText(0)
end

setSignText(line, text)

Returns true if success.

Returns:

  • (boolean) return true is successfully.

-- Example code showing how to use the function
if player.inventory.isSignOpened() then
    local status = player.inventory.setSignText(0, "1000")
end

getChestTitle()

Returns chest title.

Returns:

  • (string).

-- Example code showing how to use the function
local title = player.inventory.getChestTitle()

getStack(slot)

Returns the item in the slot.

Parameters:

  • slot (number) - Slot id.

Returns:

Example Usage:

-- Example code showing how to use the function
local item = player.inventory.getStack(36)

getStackFromContainer(slot)

Returns the item in the slot.

Parameters:

  • slot (number) - Slot id.

Returns:

Example Usage:

-- Example code showing how to use the function
local item = player.inventory.getStackFromContainer(36)

getStackFromId(id)

Create the item from id.

Parameters:

  • id (string) - Hypixel API ID.

Returns:

Example Usage:

-- Example code showing how to use the function
local item = player.inventory.getStackFromId("HYPERION")

getContainerSlots()

Returns the number of slots in an open container.

Returns:

  • (number) - Int.

Example Usage:

-- Example code showing how to use the function
local slots = player.inventory.getContainerSlots()

leftClick(slot)

Returns true if successfully.

Parameters:

  • slot (number) - Slot id.

Returns:

  • (boolean).

Example Usage:

-- Example code showing how to use the function
player.inventory.leftClick(0)

rightClick(slot)

Returns true if successfully.

Parameters:

  • slot (number) - Slot id.

Returns:

  • (boolean).

Example Usage:

-- Example code showing how to use the function
player.inventory.rightClick(0)

dropAll(slot)

Returns true if successfully.

Parameters:

  • slot (number) - Slot id.

Returns:

  • (boolean).

Example Usage:

-- Example code showing how to use the function
player.inventory.dropAll(0)

closeScreen()

Closes an open screen (chest, inventory, etc.)

Returns:

  • (boolean).

Example Usage:

-- Example code showing how to use the function
player.inventory.closeScreen()

Last updated