Inventory

Inventory functions

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).

-- Example code showing how to use the function
if player.inventory.isSignOpened() then
    local line = 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)

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(36)

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(36)

Last updated