NAME ID REFERENCE

image

In this book, you used the name IDs of Minecraft blocks to write your programs. This reference lists the block name IDs so you can reference them when modifying the programs you wrote in this book or when writing new programs on your own. Before looking at the list of IDs, let’s review how to find a block’s name ID.

FINDING A BLOCK’S NAME ID

You need to know a block’s name ID when you’re working with specific types of blocks in your programs. When your turtle is facing a block, as shown in Figure 1, use the turtle.inspect() function to determine what type of block is in front of the turtle.

image

Figure 1: A turtle facing a grass block before calling turtle.inspect()

You can find all the information associated with a block by calling turtle.inspect() and examining the table value the function returns. The 'name' key in the returned table contains the name ID of the block in front of the turtle. For example, if the turtle is in front of a grass block and you call turtle.inspect() in the Lua shell, the returned table should look like the following:

lua> turtle.inspect()
true
{
  state = {
    snowy = false,
  },
  name = "minecraft:grass",
  metadata = 0,
}

The grass block’s name ID is "minecraft:grass". In most cases, the name ID will be enough to identify the blocks you want to use in your programs. But in some cases, you might need to also use other keys in the table that turtle.inspect() returns.

DISTINGUISHING BETWEEN BLOCKS THAT SHARE NAME IDS

Some blocks share name IDs, and you can only uniquely identify them from other keys in the table. For example, oak wood planks and spruce wood planks have the same name ID of "minecraft:planks", but their metadata keys have different values. If you call turtle.inspect() when the turtle is in front of oak wood planks, the function returns the following table:

lua> turtle.inspect()
true
{
  state = {
    variant = "oak",
  },
  name = "minecraft:planks",
  metadata = 0,
}

But if the turtle is in front of spruce wood planks, the function returns this table:

lua> turtle.inspect()
true
{
  state = {
    variant = "spruce",
  },
  name = "minecraft:planks",
  metadata = 1,
}

Although the name ID of both blocks is "minecraft:planks", you can use the different metadata values (0 for oak and 1 for spruce) to distinguish between the two block types in your programs. These plank blocks also have a state key containing a table with a variant key that holds more information about the block.

LIST OF BLOCK NAME IDS

Table 1 lists the name IDs for most of the blocks your turtle might interact with. However, Table 1 doesn’t distinguish between blocks that share name IDs. For example, the table lists the name ID of wood planks but doesn’t list the keys that distinguish between oak wood planks and spruce wood planks. In situations where you want to distinguish between blocks that share name IDs, you’ll need to use turtle.inspect() to find out which values in the tables are different for the blocks.

Table 1: Minecraft Name IDs

Icon

Name

Name ID

image

Acacia Door 'minecraft:acacia_door'

image

Acacia Fence

'minecraft:acacia_fence'

image

Acacia Fence Gate

'minecraft:acacia_fence_gate'

image

Acacia Wood Stairs

'minecraft:acacia_stairs'

image

Activator Rail

'minecraft:activator_rail'

None

Air

'minecraft:air'

image

Anvil

'minecraft:anvil'

image

Beacon

'minecraft:beacon'

image

Bed

'minecraft:bed'

image

Bedrock

'minecraft:bedrock'

image

Beetroots

'minecraft:beetroots'

image

Birch Door

'minecraft:birch_door'

image

Birch Fence

'minecraft:birch_fence'

image

Birch Fence Gate

'minecraft:birch_fence_gate'

image

Birch Wood Stairs

'minecraft:birch_stairs'

image

Black Glazed Terracotta

'minecraft:black_glazed_terracotta'

image

Black Shulker Box

'minecraft:black_shulker_box'

image

Blue Glazed Terracotta

'minecraft:blue_glazed_terracotta'

image

Blue Shulker Box

'minecraft:blue_shulker_box'

image

Bone Block

'minecraft:bone_block'

image

Bookshelf

'minecraft:bookshelf'

image

Brewing Stand

'minecraft:brewing_stand'

image

Brick Stairs

'minecraft:brick_stairs'

image

Bricks

'minecraft:brick_block'

image

Brown Glazed Terracotta

'minecraft:brown_glazed_terracotta'

image

Brown Mushroom

'minecraft:brown_mushroom'

image

Brown Mushroom Block

'minecraft:brown_mushroom_block'

image

Brown Shulker Box

'minecraft:brown_shulker_box'

image

Cactus

'minecraft:cactus'

image

Cake

'minecraft:cake'

image

Carpet

'minecraft:carpet'

image

Carrots

'minecraft:carrots'

image

Cauldron

'minecraft:cauldron'

image

Chest

'minecraft:chest'

image

Chorus Flower

'minecraft:chorus_flower'

image

Chorus Plant

'minecraft:chorus_plant'

image

Clay

'minecraft:clay'

image

Coal Block

'minecraft:coal_block'

image

Coal Ore

'minecraft:coal_ore'

image

Cobblestone

'minecraft:cobblestone'

image

Cobblestone Stairs

'minecraft:stone_stairs'

image

Cobblestone Wall

'minecraft:cobblestone_wall'

image

Cobweb

'minecraft:web'

image

Cocoa

'minecraft:cocoa'

image

Concrete

'minecraft:concrete'

image

Concrete Powder

'minecraft:concrete_powder'

image

Crafting Table

'minecraft:crafting_table'

image

Cyan Glazed Terracotta

'minecraft:cyan_glazed_terracotta'

image

Cyan Shulker Box

'minecraft:cyan_shulker_box'

image

Dandelion

'minecraft:yellow_flower'

image

Dark Oak Door

'minecraft:dark_oak_door'

image

Dark Oak Fence

'minecraft:dark_oak_fence'

image

Dark Oak Fence Gate

'minecraft:dark_oak_fence_gate'

image

Dark Oak Wood Stairs

'minecraft:dark_oak_stairs'

image

Daylight Sensor

'minecraft:daylight_detector'

image

Dead Bush

'minecraft:deadbush'

image

Detector Rail

'minecraft:detector_rail'

image

Diamond Block

'minecraft:diamond_block'

image

Diamond Ore

'minecraft:diamond_ore'

image

Dirt

'minecraft:dirt'

image

Dispenser

'minecraft:dispenser'

image

Double Red Sandstone Slab

'minecraft:double_stone_slab2'

image

Double Stone Slab

'minecraft:double_stone_slab'

image

Double Wooden Slab

'minecraft:double_wooden_slab'

image

Dragon Egg

'minecraft:dragon_egg'

image

Dropper

'minecraft:dropper'

image

Emerald Block

'minecraft:emerald_block'

image

Emerald Ore

'minecraft:emerald_ore'

image

Enchantment Table

'minecraft:enchanting_table'

image

End Gateway

'minecraft:end_gateway'

image

End Portal

'minecraft:end_portal'

image

End Portal Frame

'minecraft:end_portal_frame'

image

End Rod

'minecraft:end_rod'

image

End Stone

'minecraft:end_stone'

image

End Stone Bricks

'minecraft:end_bricks'

image

Ender Chest

'minecraft:ender_chest'

image

Farmland

'minecraft:farmland'

image

Fence Gate

'minecraft:fence_gate'

image

Fire

'minecraft:fire'

image

Flower Pot

'minecraft:flower_pot'

image

Flowing Lava

'minecraft:flowing_lava'

image

Flowing Water

'minecraft:flowing_water'

image

Frosted Ice

'minecraft:frosted_ice'

image

Furnace

'minecraft:furnace'

image

Glass

'minecraft:glass'

image

Glass Pane

'minecraft:glass_pane'

image

Glowing Redstone Ore

'minecraft:lit_redstone_ore'

image

Glowstone

'minecraft:glowstone'

image

Gold Block

'minecraft:gold_block'

image

Gold Ore

'minecraft:gold_ore'

image

Grass

'minecraft:grass'

image

Grass Path

'minecraft:grass_path'

image

Grass (Tall)

'minecraft:tallgrass'

image

Gravel

'minecraft:gravel'

image

Gray Glazed Terracotta

'minecraft:gray_glazed_terracotta'

image

Gray Shulker Box

'minecraft:gray_shulker_box'

image

Green Glazed Terracotta

'minecraft:green_glazed_terracotta'

image

Green Shulker Box

'minecraft:green_shulker_box'

image

Hardened Clay

'minecraft:hardened_clay'

image

Hay Bale

'minecraft:hay_block'

image

Hopper

'minecraft:hopper'

image

Ice

'minecraft:ice'

image

Inverted Daylight Sensor

'minecraft:daylight_detector_inverted'

image

Iron Bars

'minecraft:iron_bars'

image

Iron Block

'minecraft:iron_block'

image

Iron Door

'minecraft:iron_door'

image

Iron Ore

'minecraft:iron_ore'

image

Iron Trapdoor

'minecraft:iron_trapdoor'

image

Jack o’ Lantern

'minecraft:lit_pumpkin'

image

Jukebox

'minecraft:jukebox'

image

Jungle Door

'minecraft:jungle_door'

image

Jungle Fence

'minecraft:jungle_fence'

image

Jungle Fence Gate

'minecraft:jungle_fence_gate'

image

Jungle Wood Stairs

'minecraft:jungle_stairs'

image

Ladder

'minecraft:ladder'

image

Lapis Lazuli Block

'minecraft:lapis_block'

image

Lapis Lazuli Ore

'minecraft:lapis_ore'

image

Large Flowers

'minecraft:double_plant'

image

Leaves

'minecraft:leaves'

image

Leaves (Acacia/Dark Oak)

'minecraft:leaves2'

image

Lever

'minecraft:lever'

image

Light Blue Glazed Terracotta

'minecraft:light_blue_glazed_terracotta'

image

Light Blue Shulker Box

'minecraft:light_blue_shulker_box'

image

Light Gray Glazed Terracotta

'minecraft:silver_glazed_terracotta'

image

Light Gray Shulker Box

'minecraft:silver_shulker_box'

image

Lily Pad

'minecraft:waterlily'

image

Lime Glazed Terracotta

'minecraft:lime_glazed_terracotta'

image

Lime Shulker Box

'minecraft:lime_shulker_box'

image

Lit Furnace

'minecraft:lit_furnace'

image

Magenta Glazed Terracotta

'minecraft:magenta_glazed_terracotta'

image

Magenta Shulker Box

'minecraft:magenta_shulker_box'

image

Magma Block

'minecraft:magma'

image

Melon

'minecraft:melon_block'

image

Melon Stem

'minecraft:melon_stem'

image

Mob Head

'minecraft:skull'

image

Mob Spawner

'minecraft:mob_spawner'

image

Monster Egg

'minecraft:monster_egg'

image

Moss Stone

'minecraft:mossy_cobblestone'

image

Mycelium

'minecraft:mycelium'

image

Nether Brick

'minecraft:nether_brick'

image

Nether Brick Fence

'minecraft:nether_brick_fence'

image

Nether Brick Stairs

'minecraft:nether_brick_stairs'

image

Nether Portal

'minecraft:portal'

image

Nether Quartz Ore

'minecraft:quartz_ore'

image

Nether Wart

'minecraft:nether_wart'

image

Nether Wart Block

'minecraft:nether_wart_block'

image

Netherrack

'minecraft:netherrack'

image

Note Block

'minecraft:noteblock'

image

Oak Door

'minecraft:wooden_door'

image

Oak Fence

'minecraft:fence'

image

Oak Wood Stairs

'minecraft:oak_stairs'

image

Observer

'minecraft:observer'

image

Obsidian

'minecraft:obsidian'

image

Orange Glazed Terracotta

'minecraft:orange_glazed_terracotta'

image

Orange Shulker Box

'minecraft:orange_shulker_box'

image

Packed Ice

'minecraft:packed_ice'

image

Pink Glazed Terracotta

'minecraft:pink_glazed_terracotta'

image

Pink Shulker Box

'minecraft:pink_shulker_box'

image

Piston

'minecraft:piston'

image

Piston Head

'minecraft:piston_head'

image

Poppy

'minecraft:red_flower'

image

Potatoes

'minecraft:potatoes'

image

Powered Rail

'minecraft:golden_rail'

image

Prismarine

'minecraft:prismarine'

image

Pumpkin

'minecraft:pumpkin'

image

Pumpkin Stem

'minecraft:pumpkin_stem'

image

Purple Glazed Terracotta

'minecraft:purple_glazed_terracotta'

image

Purple Shulker Box

'minecraft:purple_shulker_box'

image

Purpur Block

'minecraft:purpur_block'

image

Purpur Double Slab

'minecraft:purpur_double_slab'

image

Purpur Pillar

'minecraft:purpur_pillar'

image

Purpur Slab

'minecraft:purpur_slab'

image

Purpur Stairs

'minecraft:purpur_stairs'

image

Quartz Block

'minecraft:quartz_block'

image

Quartz Stairs

'minecraft:quartz_stairs'

image

Rail

'minecraft:rail'

image

Red Glazed Terracotta

'minecraft:red_glazed_terracotta'

image

Red Mushroom

'minecraft:red_mushroom'

image

Red Mushroom Block

'minecraft:red_mushroom_block'

image

Red Nether Brick

'minecraft:red_nether_brick'

image

Red Sandstone

'minecraft:red_sandstone'

image

Red Sandstone Slab

'minecraft:stone_slab2'

image

Red Sandstone Stairs

'minecraft:red_sandstone_stairs'

image

Red Shulker Box

'minecraft:red_shulker_box'

image

Redstone Block

'minecraft:redstone_block'

image

Redstone Comparator (Powered)

'minecraft:powered_comparator'

image

Redstone Comparator (Unpowered)

'minecraft:unpowered_comparator'

image

Redstone Lamp (Active)

'minecraft:lit_redstone_lamp'

image

Redstone Lamp (Inactive)

'minecraft:redstone_lamp'

image

Redstone Ore

'minecraft:redstone_ore'

image

Redstone Repeater (Active)

'minecraft:powered_repeater'

image

Redstone Repeater (Inactive)

'minecraft:unpowered_repeater'

image

Redstone Torch (Active)

'minecraft:redstone_torch'

image

Redstone Torch (Inactive)

'minecraft:unlit_redstone_torch'

image

Redstone Wire

'minecraft:redstone_wire'

image

Sand

'minecraft:sand'

image

Sandstone

'minecraft:sandstone'

image

Sandstone Stairs

'minecraft:sandstone_stairs'

image

Sapling

'minecraft:sapling'

image

Sea Lantern

'minecraft:sea_lantern'

image

Slime Block

'minecraft:slime'

image

Snow

'minecraft:snow'

image

Snow Layer

'minecraft:snow_layer'

image

Soul Sand

'minecraft:soul_sand'

image

Sponge

'minecraft:sponge'

image

Spruce Door

'minecraft:spruce_door'

image

Spruce Fence

'minecraft:spruce_fence'

image

Spruce Fence Gate

'minecraft:spruce_fence_gate'

image

Spruce Wood Stairs

'minecraft:spruce_stairs'

image

Stained Clay

'minecraft:stained_hardened_clay'

image

Stained Glass

'minecraft:stained_glass'

image

Stained Glass Pane

'minecraft:stained_glass_pane'

image

Standing Banner

'minecraft:standing_banner'

image

Standing Sign

'minecraft:standing_sign'

image

Stationary Lava

'minecraft:lava'

image

Stationary Water

'minecraft:water'

image

Sticky Piston

'minecraft:sticky_piston'

image

Stone

'minecraft:stone'

image

Stone Brick Stairs

'minecraft:stone_brick_stairs'

image

Stone Bricks

'minecraft:stonebrick'

image

Stone Button

'minecraft:stone_button'

image

Stone Pressure Plate

'minecraft:stone_pressure_plate'

image

Stone Slab

'minecraft:stone_slab'

image

Sugar Cane

'minecraft:reeds'

image

TNT

'minecraft:tnt'

image

Torch

'minecraft:torch'

image

Trapdoor

'minecraft:trapdoor'

image

Trapped Chest

'minecraft:trapped_chest'

image

Tripwire

'minecraft:tripwire'

image

Tripwire Hook

'minecraft:tripwire_hook'

image

Vines

'minecraft:vine'

image

Wall Banner

'minecraft:wall_banner'

image

Wall Sign

'minecraft:wall_sign'

image

Weighted Pressure Plate (Heavy)

'minecraft:heavy_weighted_pressure_plate'

image

Weighted Pressure Plate (Light)

'minecraft:light_weighted_pressure_plate'

image

Wheat

'minecraft:wheat'

image

White Glazed Terracotta

'minecraft:white_glazed_terracotta'

image

White Shulker Box

'minecraft:white_shulker_box'

image

Wood

'minecraft:log'

image

Wood (Acacia/Dark Oak)

'minecraft:log2'

image

Wood Planks

'minecraft:planks'

image

Wooden Button

'minecraft:wooden_button'

image

Wooden Pressure Plate

'minecraft:wooden_pressure_plate'

image

Wooden Slab

'minecraft:wooden_slab'

image

Wool

'minecraft:wool'

image

Yellow Glazed Terracotta

'minecraft:yellow_glazed_terracotta'

image

Yellow Shulker Box

'minecraft:yellow_shulker_box'