CC: Tweaked Download CC: Tweaked on CurseForge

CC: Tweaked is a fork of ComputerCraft, adding programmable computers, turtles and more to Minecraft.

This website contains documentation for all Lua libraries and APIs from the latest version of CC: Tweaked. This documentation is still in development, so will most likely be incomplete. If you've found something you think is wrong, or would like to help out please get in touch on GitHub.

Globals

_GFunctions in the global environment, defined in bios.lua.
colorsThe Colors API allows you to manipulate sets of colors.
coloursColours for lovers of British spelling.
commandsThe commands API allows your system to directly execute Minecraft commands and gather data from the results.
diskThe Disk API allows you to interact with disk drives.
fsThe FS API allows you to manipulate files and the filesystem.
gpsThe GPS API provides a method for turtles and computers to retrieve their own locations.
helpProvides an API to read help files.
httpThe http library allows communicating with web servers, sending and receiving data from them.
ioEmulates Lua's standard io library.
keysThe Keys API provides a table of numerical codes corresponding to keyboard keys, suitable for decoding key events.
multishellMultishell allows multiple programs to be run at the same time.
osThe os API allows interacting with the current computer.
paintutilsAn API for advanced systems which can draw pixels and lines, load and draw image files.
parallelProvides a simple implementation of multitasking.
peripheralThe Peripheral API is for interacting with peripherals connected to the computer, such as the Disk Drive, the Advanced Monitor and Monitor.
pocketControl the current pocket computer, adding or removing upgrades.
rednetThe Rednet API allows systems to communicate between each other without using redstone.
redstoneInteract with redstone attached to this computer.
settingsThe settings API allows to store values and save them to a file for persistent configurations for CraftOS and your programs.
shellThe shell API provides access to CraftOS's command line interface.
termThe Terminal API provides functions for writing text to the terminal and monitors, and drawing ASCII graphics.
textutilsThe textutils API provides helpful utilities for formatting and manipulating strings.
turtleThe turtle API allows you to control your turtle.
vectorThe vector API provides methods to create and manipulate vectors.
windowThe Window API allows easy definition of spaces within the display that can be written/drawn to, then later redrawn/repositioned/etc as need be.

Modules

cc.completionA collection of helper methods for working with input completion, such as that require by _G.read.
cc.expectThe cc.expect library provides helper functions for verifying that function arguments are well-formed and of the correct type.
cc.image.nftProvides utilities for working with "nft" images.
cc.prettyProvides a "pretty printer", for rendering data structures in an aesthetically pleasing manner.
cc.requireThis provides a pure Lua implementation of the builtin require function and package library.
cc.shell.completionA collection of helper methods for working with shell completion.
cc.stringsVarious utilities for working with strings and text.

Peripherals

commandThis peripheral allows you to interact with command blocks.
computerA computer or turtle wrapped as a peripheral.
driveDisk drives are a peripheral which allow you to read and write to floppy disks and other "mountable media" (such as computers or turtles).
modemThe modem peripheral allows you to send messages between computers.
monitorMonitors are a block which act as a terminal, displaying information on one side.
printerThe printer peripheral allows pages and books to be printed.
speakerSpeakers allow playing notes and other sounds.

Generic Peripherals

energy_storageMethods for interacting with blocks using Forge's energy storage system.
fluid_storageMethods for interacting with tanks and other fluid storage blocks.
inventoryMethods for interacting with inventories.

Events

alarmThe timer event is fired when an alarm started with os.setAlarm completes.
charThe char event is fired when a character is typed
computer_commandThe computer_command event is fired when the /computercraft queue command is run for the current computer.
diskThe disk event is fired when a disk is inserted into an adjacent or networked disk drive.
disk_ejectThe disk_eject event is fired when a disk is removed from an adjacent or networked disk drive.
http_checkThe http_check event is fired when a URL check finishes.
http_failureThe http_failure event is fired when an HTTP request fails.
http_successThe http_success event is fired when an HTTP request returns successfully.
keyThis event is fired when any key is pressed while the terminal is focused.
key_upFired whenever a key is released (or the terminal is closed while a key was being pressed).
modem_messageThe modem_message event is fired when a message is received on an open channel on any modem.
monitor_resizeThe monitor_resize event is fired when an adjacent or networked monitor's size is changed.
monitor_touchThe monitor_touch event is fired when an adjacent or networked Advanced Monitor is right-clicked.
mouse_clickThis event is fired when the terminal is clicked with a mouse.
mouse_dragThis event is fired every time the mouse is moved while a mouse button is being held.
mouse_scrollThis event is fired when a mouse wheel is scrolled in the terminal.
mouse_upThis event is fired when a mouse button is released or a held mouse leaves the computer's terminal.
pasteThe paste event is fired when text is pasted into the computer through Ctrl-V (or ⌘V on Mac).
peripheralThe peripheral event is fired when a peripheral is attached on a side or to a modem.
peripheral_detachThe peripheral_detach event is fired when a peripheral is detached from a side or from a modem.
rednet_messageThe rednet_message event is fired when a message is sent over Rednet.
redstoneThe redstone event is fired whenever any redstone inputs on the computer change.
task_completeThe task_complete event is fired when an asynchronous task completes.
term_resizeThe term_resize event is fired when the main terminal is resized, mainly when a new tab is opened or closed in multishell.
terminateThe terminate event is fired when Ctrl-T is held down.
timerThe timer event is fired when a timer started with os.startTimer completes.
turtle_inventoryThe turtle_inventory event is fired when a turtle's inventory is changed.
websocket_closedThe websocket_closed event is fired when an open WebSocket connection is closed.
websocket_failureThe websocket_failure event is fired when a WebSocket connection request fails.
websocket_messageThe websocket_message event is fired when a message is received on an open WebSocket connection.
websocket_successThe websocket_success event is fired when a WebSocket connection request returns successfully.