pocket

Control the current pocket computer, adding or removing upgrades.

This API is only available on pocket computers. As such, you may use its presence to determine what kind of computer you are using:

if pocket then
  print("On a pocket computer")
else
  print("On something else")
end

Recipes

Pocket Computer
Stone
Stone
Stone
Stone
Golden Apple
Stone
Stone
Glass Pane
Stone
Pocket Computer
Advanced Pocket Computer
Gold Ingot
Gold Ingot
Gold Ingot
Gold Ingot
Golden Apple
Gold Ingot
Gold Ingot
Glass Pane
Gold Ingot
Advanced Pocket Computer
equipBack()Search the player's inventory for another upgrade, replacing the existing back upgrade with that item if found.
equipBottom()Search the player's inventory for another upgrade, replacing the existing bottom upgrade with that item if found.
unequipBack()Remove the pocket computer's back upgrade.
unequipBottom()Remove the pocket computer's bottom upgrade.
equipBack()Source

Search the player's inventory for another upgrade, replacing the existing back upgrade with that item if found.

This inventory search starts from the player's currently selected slot, allowing you to prioritise upgrades.

Returns

  1. boolean If an item was equipped.
  2. string | nil The reason an item was not equipped.
equipBottom()Source

Search the player's inventory for another upgrade, replacing the existing bottom upgrade with that item if found.

This inventory search starts from the player's currently selected slot, allowing you to prioritise upgrades.

Returns

  1. boolean If an item was equipped.
  2. string | nil The reason an item was not equipped.

Changes

  • New in version 1.116.0
unequipBack()Source

Remove the pocket computer's back upgrade.

Returns

  1. boolean If the upgrade was unequipped.
  2. string | nil The reason an upgrade was not unequipped.
unequipBottom()Source

Remove the pocket computer's bottom upgrade.

Returns

  1. boolean If the upgrade was unequipped.
  2. string | nil The reason an upgrade was not unequipped.

Changes

  • New in version 1.116.0