### Get Basic Block Information (Lua) Source: https://tweaked.cc/reference/block_details Demonstrates how to retrieve basic information about a block using `turtle.inspect`. This includes the block's namespaced ID and its state, which describes its properties like moisture level or whether a piston is extended. ```lua local ok, block = turtle.inspect() if ok then print('Block Name: ' .. block.name) print('Block State:') for key, value in pairs(block.state) do print(string.format(' %s = %s', key, tostring(value))) end else print('No block in front of the turtle.') end ``` -------------------------------- ### Check Block Tags (Lua) Source: https://tweaked.cc/reference/block_details Shows how to check if a block possesses specific tags using the `tags` field returned by `turtle.inspect`. This example checks if the block in front of the turtle is classified as a log. ```lua local function is_log() local ok, block = turtle.inspect() return ok and block.tags and block.tags["minecraft:logs"] end if is_log() then print('The block in front is a log.') else print('The block in front is not a log.') end ``` -------------------------------- ### Turn On Command Source: https://tweaked.cc/reference/computercraft_command Turns on one or more specified computers, or all loaded computers if no arguments are provided. ```APIDOC ## /computercraft turn-on [computers...] ### Description Turns on one or more computers. If no computers are specified, all loaded computers are turned on. ### Method POST (or PUT, as it modifies state) ### Endpoint `/computercraft turn-on [computers...]` ### Parameters #### Path Parameters - `computers...` (string) - Optional - One or more computer IDs or selectors to turn on. ### Request Example ```json { "computers": ["#0", "#2"] } ``` Or ```json { "computers": ["@c[family=command]"] } ``` Or empty for all computers. ``` -------------------------------- ### Dump Command Source: https://tweaked.cc/reference/computercraft_command Prints information about loaded computers, including ID, position, and status. Can provide detailed info for a specific computer. ```APIDOC ## /computercraft dump ### Description Prints a table of currently loaded computers with their id, position, and running status. Can also dump detailed information about a specific computer. ### Method GET (implicitly, as it retrieves data) ### Endpoint `/computercraft dump [computer]` ### Parameters #### Path Parameters - `computer` (string) - Optional - The ID or selector for a specific computer to dump detailed information about. ### Response #### Success Response (200) - `id` (number) - The unique identifier for the computer. - `position` (string) - The world coordinates of the computer. - `running` (boolean) - Indicates if the computer is currently running. - (Detailed info for specific computer includes more fields) #### Response Example ```json { "computers": [ { "id": 12, "position": "(100, 64, 200)", "running": true }, { "id": 15, "position": "(110, 64, 210)", "running": false } ] } ``` ``` -------------------------------- ### View Command Source: https://tweaked.cc/reference/computercraft_command Opens a terminal for the specified computer, allowing remote viewing without direct interaction. ```APIDOC ## /computercraft view [computer] ### Description Opens a terminal for the specified computer, enabling remote viewing without interacting with the physical block. Primarily intended for use from the `dump` command interface. ### Method POST (or GET, as it retrieves a view) ### Endpoint `/computercraft view [computer]` ### Parameters #### Path Parameters - `computer` (string) - Optional - The ID or selector for the computer to open a terminal for. If not specified, behavior might be undefined or default to a nearby computer. ### Request Example ```json { "computer": "@c[label=main]" } ``` ``` -------------------------------- ### CC: Tweaked Command Overview Source: https://tweaked.cc/reference/computercraft_command The `/computercraft` command allows server owners to manage running computers on a server. Permissions vary, with most sub-commands requiring operator status, except for 'queue' which is available to all players. ```APIDOC ## /computercraft Command ### Description Manages running computers on a server. Sub-commands have specific permission requirements. ### Permissions - `computercraft.command.NAME`: Permission node for individual sub-commands. - All players: `queue` sub-command. - Operator (op) or equivalent: Most other sub-commands on multiplayer servers. - Single-player worlds (cheats enabled): `dump`, `turn-on`/`shutdown`, `track`. - Single-player worlds (cheats disabled): `tp` and `view` require cheats. ### Computer Selectors Used to target specific computers for commands. Similar to entity selectors. #### Supported Predicates: - `id=`: Select by computer ID. - `instance=`: Select by instance ID. - `family=`: Select by computer type. - `label=