The Best Resource for Minecraft
The Best Resource for Minecraft

CC Tweaked Mod Wiki

CC: Tweaked is the definitive modern fork of ComputerCraft, adding programmable Lua-based computers, versatile robotic turtles, and advanced networking peripherals to Minecraft.

8 sections · 816 words

Overview#

CC: Tweaked is a comprehensive overhaul and continuation of the classic ComputerCraft mod. It introduces fully functional, programmable computers into the Minecraft world, allowing players to automate tasks, manage complex inventories, and create intricate redstone systems using the Lua programming language.

The mod is built on the Cobalt Lua runtime, supporting features from Lua 5.1, 5.2, and 5.3. Whether you are building a simple automated door or a massive multi-turtle mining operation, CC: Tweaked provides the hardware and software tools necessary for high-level automation.

Computers and Hardware#

Computers are the core of the mod. They run CraftOS, a lightweight operating system that provides a command-line interface and a suite of built-in programs.

Computer Types

Block Description Features
Computer The standard entry-level computer. Grayscale display, no mouse support.
Advanced Computer A high-tier computer made with gold. Full-color display, mouse interaction support, and multi-tasking (multishell).
Pocket Computer A handheld version of the computer. Portable, can be upgraded with modems for remote access.
Advanced Pocket Computer Handheld color computer. Portable color display with multishell support.

Peripherals

Peripherals are external blocks that can be connected to a computer to expand its functionality.

  • Monitors: Display text and graphics in the world. Advanced Monitors support color and touch input.
  • Modems: Allow computers to communicate over a network. Wireless modems use Rednet for long-distance signals.
  • Disk Drives: Read and write to Floppy Disks, which can store programs or music.
  • Speakers: Play DFPWM audio streams or Minecraft note block sounds.
  • Printers: Use ink and paper to create printed pages and books.
  • Redstone Relays: Specialized blocks for precise redstone input and output control.

Chest fullness displayed on a monitor

Turtles (Robotics)#

Turtles are mobile computers capable of interacting with the physical world. They can move, dig, place blocks, and detect their surroundings.

Turtle Mechanics

  • Fuel: Turtles require fuel to move. Any item that burns in a furnace can be used. One unit of fuel typically allows for one block of movement.
  • Inventory: Every turtle has a 16-slot internal inventory.
  • Upgrades: Turtles have two slots (left and right) for tools or peripherals.

Common Upgrades

Upgrade Item Required Function
Mining Turtle Diamond Pickaxe Breaks almost any block, including obsidian.
Felling Turtle Diamond Axe Efficiently chops down trees.
Digging Turtle Diamond Shovel Quickly clears dirt, sand, and gravel.
Combat Turtle Diamond Sword Attacks mobs and players.
Wireless Turtle Wireless Modem Allows the turtle to receive remote commands via Rednet.
Crafty Turtle Crafting Table Allows the turtle to craft items using its own inventory.

Crafting Recipes#

Most CC: Tweaked recipes follow a consistent logic, using Stone for standard tiers and Gold for advanced tiers.

Result Ingredients
Computer 7x Stone, 1x Redstone, 1x Glass Pane
Advanced Computer 7x Gold Ingot, 1x Redstone, 1x Glass Pane
Turtle 1x Computer, 1x Chest, 7x Iron Ingot
Advanced Turtle 1x Advanced Computer, 1x Chest, 7x Gold Ingot
Monitor 6x Stone, 2x Glass Pane, 1x Redstone
Advanced Monitor 6x Gold Ingot, 2x Glass Pane, 1x Redstone
Wireless Modem 7x Stone, 1x Redstone, 1x Ender Pearl
Wired Modem 7x Stone, 1x Redstone, 1x Iron Ingot
Networking Cable 1x Redstone, 1x String (Yields 6)
Disk Drive 7x Stone, 1x Redstone, 1x Floppy Disk
Speaker 7x Stone, 1x Redstone, 1x Note Block

Programming and APIs#

CC: Tweaked provides several built-in APIs to control hardware. These are accessed directly in Lua scripts.

Core APIs

  • term: Controls the terminal display (writing text, setting colors).
  • fs: Manages the filesystem (creating, reading, and deleting files).
  • os: Handles system events, timers, and alarms.
  • turtle: Exclusive to turtles; controls movement, digging, and placing.
  • peripheral: Detects and wraps attached peripherals to use their functions.
  • redstone: Reads and emits redstone signals from any side of the block.
  • http: Allows the computer to communicate with the real-world internet (if enabled in config).

Networking (Rednet)

Rednet is a high-level API built on top of the Modem peripheral. It allows for easy message passing between computers using unique IDs rather than physical sides.

-- Example: Sending a message
rednet.open("back")
rednet.send(5, "Hello Computer #5!")

Events#

The mod uses an event-driven system. Programs can wait for specific triggers using os.pullEvent.

Event Trigger
char Fired when a character is typed.
key Fired when a keyboard key is pressed.
mouse_click Fired when the terminal is clicked (Advanced only).
redstone Fired when the redstone input changes.
timer Fired when a countdown timer reaches zero.
modem_message Fired when a message is received over a modem.
turtle_inventory Fired when a turtle's inventory changes.
terminate Fired when the user tries to abort the program (Ctrl+T).

Configuration and Commands#

Server administrators can manage the mod using the /computercraft command.

  • /computercraft view: Opens a GUI to see all currently loaded computers and their resource usage.
  • /computercraft gc: Forces a Lua garbage collection to free up memory.
  • /computercraft shutdown [id]: Remotely shuts down a specific computer.

Key Config Options

  • fuel_limit: Sets the maximum fuel a turtle can hold (Default: 20,000 for normal, 100,000 for advanced).
  • http_enabled: Enables or disables the http API for security.
  • computer_limit: Limits the number of computers a single player can have active.

ComputerCraft Lua interactive prompt in-game