Skip to main content
Discovery icon for Minecraft Computer Mods Discord server

Minecraft Computer Mods

2,588 Online
7,346 Members
# computercraft3 people

ComputerCraft inventory scripting

Learn to access and display ComputerCraft peripheral inventory contents using `peripheral.wrap()`, `chest.list()`, and `textutils.serialize()` to print the results.

  • Use `peripheral.wrap("side")` to access a peripheral (like a chest) attached to the computer, specifying the side it's on (e.g., "top", "left").
  • The `chest.list()` function returns a table containing the inventory items of the wrapped peripheral.
  • `textutils.serialize(chest.list())` can be used within a `print()` function to display the contents of the inventory table in a readable format.
Summarized from recent messages, might be inaccurate

More conversations

Talk, Play, &
Hang Out

Find your space to hang out, discuss the latest updates with the party chat, and see who's down to join your next match.
Get App