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.
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.
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.
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.
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 |
Acacia Door | 'minecraft:acacia_door' | |
Acacia Fence |
'minecraft:acacia_fence' |
|
Acacia Fence Gate |
'minecraft:acacia_fence_gate' |
|
Acacia Wood Stairs |
'minecraft:acacia_stairs' |
|
Activator Rail |
'minecraft:activator_rail' |
|
None |
Air |
'minecraft:air' |
Anvil |
'minecraft:anvil' |
|
Beacon |
'minecraft:beacon' |
|
Bed |
'minecraft:bed' |
|
Bedrock |
'minecraft:bedrock' |
|
Beetroots |
'minecraft:beetroots' |
|
Birch Door |
'minecraft:birch_door' |
|
Birch Fence |
'minecraft:birch_fence' |
|
Birch Fence Gate |
'minecraft:birch_fence_gate' |
|
Birch Wood Stairs |
'minecraft:birch_stairs' |
|
Black Glazed Terracotta |
'minecraft:black_glazed_terracotta' |
|
Black Shulker Box |
'minecraft:black_shulker_box' |
|
Blue Glazed Terracotta |
'minecraft:blue_glazed_terracotta' |
|
Blue Shulker Box |
'minecraft:blue_shulker_box' |
|
Bone Block |
'minecraft:bone_block' |
|
Bookshelf |
'minecraft:bookshelf' |
|
Brewing Stand |
'minecraft:brewing_stand' |
|
Brick Stairs |
'minecraft:brick_stairs' |
|
Bricks |
'minecraft:brick_block' |
|
Brown Glazed Terracotta |
'minecraft:brown_glazed_terracotta' |
|
Brown Mushroom |
'minecraft:brown_mushroom' |
|
Brown Mushroom Block |
'minecraft:brown_mushroom_block' |
|
Brown Shulker Box |
'minecraft:brown_shulker_box' |
|
Cactus |
'minecraft:cactus' |
|
Cake |
'minecraft:cake' |
|
Carpet |
'minecraft:carpet' |
|
Carrots |
'minecraft:carrots' |
|
Cauldron |
'minecraft:cauldron' |
|
Chest |
'minecraft:chest' |
|
Chorus Flower |
'minecraft:chorus_flower' |
|
Chorus Plant |
'minecraft:chorus_plant' |
|
Clay |
'minecraft:clay' |
|
Coal Block |
'minecraft:coal_block' |
|
Coal Ore |
'minecraft:coal_ore' |
|
Cobblestone |
'minecraft:cobblestone' |
|
Cobblestone Stairs |
'minecraft:stone_stairs' |
|
Cobblestone Wall |
'minecraft:cobblestone_wall' |
|
Cobweb |
'minecraft:web' |
|
Cocoa |
'minecraft:cocoa' |
|
Concrete |
'minecraft:concrete' |
|
Concrete Powder |
'minecraft:concrete_powder' |
|
Crafting Table |
'minecraft:crafting_table' |
|
Cyan Glazed Terracotta |
'minecraft:cyan_glazed_terracotta' |
|
Cyan Shulker Box |
'minecraft:cyan_shulker_box' |
|
Dandelion |
'minecraft:yellow_flower' |
|
Dark Oak Door |
'minecraft:dark_oak_door' |
|
Dark Oak Fence |
'minecraft:dark_oak_fence' |
|
Dark Oak Fence Gate |
'minecraft:dark_oak_fence_gate' |
|
Dark Oak Wood Stairs |
'minecraft:dark_oak_stairs' |
|
Daylight Sensor |
'minecraft:daylight_detector' |
|
Dead Bush |
'minecraft:deadbush' |
|
Detector Rail |
'minecraft:detector_rail' |
|
Diamond Block |
'minecraft:diamond_block' |
|
Diamond Ore |
'minecraft:diamond_ore' |
|
Dirt |
'minecraft:dirt' |
|
Dispenser |
'minecraft:dispenser' |
|
Double Red Sandstone Slab |
'minecraft:double_stone_slab2' |
|
Double Stone Slab |
'minecraft:double_stone_slab' |
|
Double Wooden Slab |
'minecraft:double_wooden_slab' |
|
Dragon Egg |
'minecraft:dragon_egg' |
|
Dropper |
'minecraft:dropper' |
|
Emerald Block |
'minecraft:emerald_block' |
|
Emerald Ore |
'minecraft:emerald_ore' |
|
Enchantment Table |
'minecraft:enchanting_table' |
|
End Gateway |
'minecraft:end_gateway' |
|
End Portal |
'minecraft:end_portal' |
|
End Portal Frame |
'minecraft:end_portal_frame' |
|
End Rod |
'minecraft:end_rod' |
|
End Stone |
'minecraft:end_stone' |
|
End Stone Bricks |
'minecraft:end_bricks' |
|
Ender Chest |
'minecraft:ender_chest' |
|
Farmland |
'minecraft:farmland' |
|
Fence Gate |
'minecraft:fence_gate' |
|
Fire |
'minecraft:fire' |
|
Flower Pot |
'minecraft:flower_pot' |
|
Flowing Lava |
'minecraft:flowing_lava' |
|
Flowing Water |
'minecraft:flowing_water' |
|
Frosted Ice |
'minecraft:frosted_ice' |
|
Furnace |
'minecraft:furnace' |
|
Glass |
'minecraft:glass' |
|
Glass Pane |
'minecraft:glass_pane' |
|
Glowing Redstone Ore |
'minecraft:lit_redstone_ore' |
|
Glowstone |
'minecraft:glowstone' |
|
Gold Block |
'minecraft:gold_block' |
|
Gold Ore |
'minecraft:gold_ore' |
|
Grass |
'minecraft:grass' |
|
Grass Path |
'minecraft:grass_path' |
|
Grass (Tall) |
'minecraft:tallgrass' |
|
Gravel |
'minecraft:gravel' |
|
Gray Glazed Terracotta |
'minecraft:gray_glazed_terracotta' |
|
Gray Shulker Box |
'minecraft:gray_shulker_box' |
|
Green Glazed Terracotta |
'minecraft:green_glazed_terracotta' |
|
Green Shulker Box |
'minecraft:green_shulker_box' |
|
Hardened Clay |
'minecraft:hardened_clay' |
|
Hay Bale |
'minecraft:hay_block' |
|
Hopper |
'minecraft:hopper' |
|
Ice |
'minecraft:ice' |
|
Inverted Daylight Sensor |
'minecraft:daylight_detector_inverted' |
|
Iron Bars |
'minecraft:iron_bars' |
|
Iron Block |
'minecraft:iron_block' |
|
Iron Door |
'minecraft:iron_door' |
|
Iron Ore |
'minecraft:iron_ore' |
|
Iron Trapdoor |
'minecraft:iron_trapdoor' |
|
Jack o’ Lantern |
'minecraft:lit_pumpkin' |
|
Jukebox |
'minecraft:jukebox' |
|
Jungle Door |
'minecraft:jungle_door' |
|
Jungle Fence |
'minecraft:jungle_fence' |
|
Jungle Fence Gate |
'minecraft:jungle_fence_gate' |
|
Jungle Wood Stairs |
'minecraft:jungle_stairs' |
|
Ladder |
'minecraft:ladder' |
|
Lapis Lazuli Block |
'minecraft:lapis_block' |
|
Lapis Lazuli Ore |
'minecraft:lapis_ore' |
|
Large Flowers |
'minecraft:double_plant' |
|
Leaves |
'minecraft:leaves' |
|
Leaves (Acacia/Dark Oak) |
'minecraft:leaves2' |
|
Lever |
'minecraft:lever' |
|
Light Blue Glazed Terracotta |
'minecraft:light_blue_glazed_terracotta' |
|
Light Blue Shulker Box |
'minecraft:light_blue_shulker_box' |
|
Light Gray Glazed Terracotta |
'minecraft:silver_glazed_terracotta' |
|
Light Gray Shulker Box |
'minecraft:silver_shulker_box' |
|
Lily Pad |
'minecraft:waterlily' |
|
Lime Glazed Terracotta |
'minecraft:lime_glazed_terracotta' |
|
Lime Shulker Box |
'minecraft:lime_shulker_box' |
|
Lit Furnace |
'minecraft:lit_furnace' |
|
Magenta Glazed Terracotta |
'minecraft:magenta_glazed_terracotta' |
|
Magenta Shulker Box |
'minecraft:magenta_shulker_box' |
|
Magma Block |
'minecraft:magma' |
|
Melon |
'minecraft:melon_block' |
|
Melon Stem |
'minecraft:melon_stem' |
|
Mob Head |
'minecraft:skull' |
|
Mob Spawner |
'minecraft:mob_spawner' |
|
Monster Egg |
'minecraft:monster_egg' |
|
Moss Stone |
'minecraft:mossy_cobblestone' |
|
Mycelium |
'minecraft:mycelium' |
|
Nether Brick |
'minecraft:nether_brick' |
|
Nether Brick Fence |
'minecraft:nether_brick_fence' |
|
Nether Brick Stairs |
'minecraft:nether_brick_stairs' |
|
Nether Portal |
'minecraft:portal' |
|
Nether Quartz Ore |
'minecraft:quartz_ore' |
|
Nether Wart |
'minecraft:nether_wart' |
|
Nether Wart Block |
'minecraft:nether_wart_block' |
|
Netherrack |
'minecraft:netherrack' |
|
Note Block |
'minecraft:noteblock' |
|
Oak Door |
'minecraft:wooden_door' |
|
Oak Fence |
'minecraft:fence' |
|
Oak Wood Stairs |
'minecraft:oak_stairs' |
|
Observer |
'minecraft:observer' |
|
Obsidian |
'minecraft:obsidian' |
|
Orange Glazed Terracotta |
'minecraft:orange_glazed_terracotta' |
|
Orange Shulker Box |
'minecraft:orange_shulker_box' |
|
Packed Ice |
'minecraft:packed_ice' |
|
Pink Glazed Terracotta |
'minecraft:pink_glazed_terracotta' |
|
Pink Shulker Box |
'minecraft:pink_shulker_box' |
|
Piston |
'minecraft:piston' |
|
Piston Head |
'minecraft:piston_head' |
|
Poppy |
'minecraft:red_flower' |
|
Potatoes |
'minecraft:potatoes' |
|
Powered Rail |
'minecraft:golden_rail' |
|
Prismarine |
'minecraft:prismarine' |
|
Pumpkin |
'minecraft:pumpkin' |
|
Pumpkin Stem |
'minecraft:pumpkin_stem' |
|
Purple Glazed Terracotta |
'minecraft:purple_glazed_terracotta' |
|
Purple Shulker Box |
'minecraft:purple_shulker_box' |
|
Purpur Block |
'minecraft:purpur_block' |
|
Purpur Double Slab |
'minecraft:purpur_double_slab' |
|
Purpur Pillar |
'minecraft:purpur_pillar' |
|
Purpur Slab |
'minecraft:purpur_slab' |
|
Purpur Stairs |
'minecraft:purpur_stairs' |
|
Quartz Block |
'minecraft:quartz_block' |
|
Quartz Stairs |
'minecraft:quartz_stairs' |
|
Rail |
'minecraft:rail' |
|
Red Glazed Terracotta |
'minecraft:red_glazed_terracotta' |
|
Red Mushroom |
'minecraft:red_mushroom' |
|
Red Mushroom Block |
'minecraft:red_mushroom_block' |
|
Red Nether Brick |
'minecraft:red_nether_brick' |
|
Red Sandstone |
'minecraft:red_sandstone' |
|
Red Sandstone Slab |
'minecraft:stone_slab2' |
|
Red Sandstone Stairs |
'minecraft:red_sandstone_stairs' |
|
Red Shulker Box |
'minecraft:red_shulker_box' |
|
Redstone Block |
'minecraft:redstone_block' |
|
Redstone Comparator (Powered) |
'minecraft:powered_comparator' |
|
Redstone Comparator (Unpowered) |
'minecraft:unpowered_comparator' |
|
Redstone Lamp (Active) |
'minecraft:lit_redstone_lamp' |
|
Redstone Lamp (Inactive) |
'minecraft:redstone_lamp' |
|
Redstone Ore |
'minecraft:redstone_ore' |
|
Redstone Repeater (Active) |
'minecraft:powered_repeater' |
|
Redstone Repeater (Inactive) |
'minecraft:unpowered_repeater' |
|
Redstone Torch (Active) |
'minecraft:redstone_torch' |
|
Redstone Torch (Inactive) |
'minecraft:unlit_redstone_torch' |
|
Redstone Wire |
'minecraft:redstone_wire' |
|
Sand |
'minecraft:sand' |
|
Sandstone |
'minecraft:sandstone' |
|
Sandstone Stairs |
'minecraft:sandstone_stairs' |
|
Sapling |
'minecraft:sapling' |
|
Sea Lantern |
'minecraft:sea_lantern' |
|
Slime Block |
'minecraft:slime' |
|
Snow |
'minecraft:snow' |
|
Snow Layer |
'minecraft:snow_layer' |
|
Soul Sand |
'minecraft:soul_sand' |
|
Sponge |
'minecraft:sponge' |
|
Spruce Door |
'minecraft:spruce_door' |
|
Spruce Fence |
'minecraft:spruce_fence' |
|
Spruce Fence Gate |
'minecraft:spruce_fence_gate' |
|
Spruce Wood Stairs |
'minecraft:spruce_stairs' |
|
Stained Clay |
'minecraft:stained_hardened_clay' |
|
Stained Glass |
'minecraft:stained_glass' |
|
Stained Glass Pane |
'minecraft:stained_glass_pane' |
|
Standing Banner |
'minecraft:standing_banner' |
|
Standing Sign |
'minecraft:standing_sign' |
|
Stationary Lava |
'minecraft:lava' |
|
Stationary Water |
'minecraft:water' |
|
Sticky Piston |
'minecraft:sticky_piston' |
|
Stone |
'minecraft:stone' |
|
Stone Brick Stairs |
'minecraft:stone_brick_stairs' |
|
Stone Bricks |
'minecraft:stonebrick' |
|
Stone Button |
'minecraft:stone_button' |
|
Stone Pressure Plate |
'minecraft:stone_pressure_plate' |
|
Stone Slab |
'minecraft:stone_slab' |
|
Sugar Cane |
'minecraft:reeds' |
|
TNT |
'minecraft:tnt' |
|
Torch |
'minecraft:torch' |
|
Trapdoor |
'minecraft:trapdoor' |
|
Trapped Chest |
'minecraft:trapped_chest' |
|
Tripwire |
'minecraft:tripwire' |
|
Tripwire Hook |
'minecraft:tripwire_hook' |
|
Vines |
'minecraft:vine' |
|
Wall Banner |
'minecraft:wall_banner' |
|
Wall Sign |
'minecraft:wall_sign' |
|
Weighted Pressure Plate (Heavy) |
'minecraft:heavy_weighted_pressure_plate' |
|
Weighted Pressure Plate (Light) |
'minecraft:light_weighted_pressure_plate' |
|
Wheat |
'minecraft:wheat' |
|
White Glazed Terracotta |
'minecraft:white_glazed_terracotta' |
|
White Shulker Box |
'minecraft:white_shulker_box' |
|
Wood |
'minecraft:log' |
|
Wood (Acacia/Dark Oak) |
'minecraft:log2' |
|
Wood Planks |
'minecraft:planks' |
|
Wooden Button |
'minecraft:wooden_button' |
|
Wooden Pressure Plate |
'minecraft:wooden_pressure_plate' |
|
Wooden Slab |
'minecraft:wooden_slab' |
|
Wool |
'minecraft:wool' |
|
Yellow Glazed Terracotta |
'minecraft:yellow_glazed_terracotta' |
|
Yellow Shulker Box |
'minecraft:yellow_shulker_box' |
|
|
|
|