ComputerCraft Archive

getBlockName

turtle utility armstrongl github

Description

A collection of scripts for Minecraft ComputerCraft Tweaked (tweaked.cc)

Installation

Copy one of these commands into your ComputerCraft terminal:

wget:wget https://raw.githubusercontent.com/armstrongl/cc-scripts/master/src/turtle_ops/getBlockName.lua getblockname
Archive:wget https://cc.shobie.xyz/cc/get/gh-armstrongl-cc-scripts-src-turtle-ops-getblockname getblockname
Quick Install: wget https://cc.shobie.xyz/cc/get/gh-armstrongl-cc-scripts-src-turtle-ops-getblockname getBlockName

Usage

Run: getBlockName

Tags

turtle

Source

View Original Source

Code Preview

local coreOpsLoaded = os.loadAPI("coreOps")

if coreOpsLoaded == true then
    local success, data = turtle.inspect()
    local blockName = coreOps.getBlockKeyValue(data, "name")
    print("Block name: ", blockName)
end