Facebook Twitter Instagram Pinterest YouTube
    Trending
    • Elecrow Meteor IPS Touchscreen with RGB LEDs
    • Pi Pico Pinout Display on the Command Line
    • How to Add a Raspberry Pi Pico Reset Button
    • Pi Pico Onboard LED
    • Pi Pico W Pinout and Power Pins
    • CrowPi L Raspberry Pi Laptop and Learning Platform
    • Pi Pico W Launched
    • Add Kodi to RetroPie Menu
    Facebook Twitter Instagram Pinterest YouTube RSS
    Raspberry Pi SpyRaspberry Pi Spy
    • Home
    • Categories
      • General
      • Hardware
      • Programming
      • Python
      • Software
      • Tutorials & Help
    • BerryClip
      • BerryClip Instructions
      • BerryClip Plus Instructions
      • Videos & Reviews
    • Buy
      • Buy Pi
      • Buy Pi Accessories
      • Buy Books
    • Tools
      • Ultimate Raspberry Pi Alexa Skill
      • Pi Power Estimator App
      • Pi-Lite 14×9 LED Matrix Sprite Editor
      • RPiREF Pin-out Reference App
      • Simple Ohm’s Law Calculator
      • Web Sites & Links
    • Tutorials & Help
        Featured
        November 9, 20200

        Raspberry Pi Temperature Monitoring

        Recent
        December 23, 2022

        How to Add a Raspberry Pi Pico Reset Button

        November 20, 2022

        Pi Pico Onboard LED

        May 6, 2022

        Add Kodi to RetroPie Menu

      1. Contact Us
      2. Site Map
      Raspberry Pi SpyRaspberry Pi Spy
      You are at:Home»Software»Minecraft»Raspberry Pi Minecraft Block ID Number Reference
      Minecraft Python API Block ID Reference

      Raspberry Pi Minecraft Block ID Number Reference

      2
      By Matt on September 4, 2014 Minecraft

      When you’ve installed Minecraft on the Raspberry Pi and setup the Python API you will want to get creating scripts to manipulate the Minecraft World. This is going to involve a lot of block manipulation.

      Each type of block (sand, dirt, water etc) has a unique ID number associated with it. It is helpful to have a list of these numbers to hand so you can use them in your code.

      There aren’t as many blocks in the Pi edition as the full PC versions but there are still plenty to work with.

      Minecraft Screenshot

      Here is the full list defined as constants in the API with their block ID numbers :

      API Blocks
      =======================
      AIR                   0
      STONE                 1
      GRASS                 2
      DIRT                  3
      COBBLESTONE           4
      WOOD_PLANKS           5
      SAPLING               6
      BEDROCK               7
      WATER_FLOWING         8
      WATER                 8
      WATER_STATIONARY      9
      LAVA_FLOWING         10
      LAVA                 10
      LAVA_STATIONARY      11
      SAND                 12
      GRAVEL               13
      GOLD_ORE             14
      IRON_ORE             15
      COAL_ORE             16
      WOOD                 17
      LEAVES               18
      GLASS                20
      LAPIS_LAZULI_ORE     21
      LAPIS_LAZULI_BLOCK   22
      SANDSTONE            24
      BED                  26
      COBWEB               30
      GRASS_TALL           31
      WOOL                 35
      FLOWER_YELLOW        37
      FLOWER_CYAN          38
      MUSHROOM_BROWN       39
      MUSHROOM_RED         40
      GOLD_BLOCK           41
      IRON_BLOCK           42
      STONE_SLAB_DOUBLE    43
      STONE_SLAB           44
      BRICK_BLOCK          45
      TNT                  46
      BOOKSHELF            47
      MOSS_STONE           48
      OBSIDIAN             49
      TORCH                50
      FIRE                 51
      STAIRS_WOOD          53
      CHEST                54
      DIAMOND_ORE          56
      DIAMOND_BLOCK        57
      CRAFTING_TABLE       58
      FARMLAND             60
      FURNACE_INACTIVE     61
      FURNACE_ACTIVE       62
      DOOR_WOOD            64
      LADDER               65
      STAIRS_COBBLESTONE   67
      DOOR_IRON            71
      REDSTONE_ORE         73
      SNOW                 78
      ICE                  79
      SNOW_BLOCK           80
      CACTUS               81
      CLAY                 82
      SUGAR_CANE           83
      FENCE                85
      GLOWSTONE_BLOCK      89
      BEDROCK_INVISIBLE    95
      STONE_BRICK          98
      GLASS_PANE          102
      MELON               103
      FENCE_GATE          107
      GLOWING_OBSIDIAN    246
      NETHER_REACTOR_CORE 247
      

      Some of the blocks that appear in the inventory screen aren’t listed but here they are :

      Non-API Blocks
      =======================
      PAINTING            321
      STONE_STAIRS         67
      OAK_STAIRS           53
      OAK_STAIRS           59
      NETHERRACK           87
      TRAPDOOR             96
      MELON_SEEDS         105
      BRICK_STAIRS        108
      SANDSTONE_STAIRS    128
      STONE_BRICK_STAIRS  109
      NETHER_BRICK        112
      NETHER_BRICK_STAIRS 114
      QUARTZ_BLOCK        155
      QUARTZ_STAIRS       156
      STONE_CUTTER        245
      BONE_MEAL           351

      If you have imported the “block” library at the top of your script like this :

      import mcpi.block as block

      you can call up the blocks in the “API Block List” using the following syntax :

      block.MELON.id

      In this example it saves you defining your own variable or using the number 103 and may make your script more readable.

      To use the blocks in the “Non-API Block List” you will have to use the block number directly.

      Examples

      Place a block of sandstone :

      mc.setBlock(10,10,10,block.SANDSTONE.id)

      Place a stone cutter on top of the sandstone :

      mc.setBlock(10,11,10,245)

      Place a block of grass on top of the stone cutter :

      mc.setBlock(10,11,10,block.GRASS.id)
      Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
      Previous ArticleHow to Reset a Forgotten Raspberry Pi Password
      Next Article How To Create A Pyramid In Minecraft With Python

      Related Posts

      How to Change Your Character Skin In Minecraft Pi Edition

      Piper – The Minecraft Toolbox For Raspberry Pi

      How To Create A Pyramid In Minecraft With Python

      2 Comments

      1. Rejesto on August 17, 2016 12:40 pm

        Can I see an example of an block ID with a .data extension? I’m trying to rotate some stairs by using the block ID 108.3, but to no avail. What would I need to do to have the ID make the block rotate?

        Reply
        • Gyigyi on July 1, 2017 6:20 pm

          Instead of doing 108.3 do 108, 3

          Reply

      Leave A Reply Cancel Reply

      This site uses Akismet to reduce spam. Learn how your comment data is processed.

      Recent Posts
      March 13, 2023

      Elecrow Meteor IPS Touchscreen with RGB LEDs

      December 26, 2022

      Pi Pico Pinout Display on the Command Line

      December 23, 2022

      How to Add a Raspberry Pi Pico Reset Button

      November 20, 2022

      Pi Pico Onboard LED

      November 14, 2022

      Pi Pico W Pinout and Power Pins

      Categories
      • 1-wire
      • 3D Printing
      • Add-ons
      • BBC Micro:bit
      • BerryClip
      • Books
      • Camera Module
      • Cases
      • Events
      • General
      • Hardware
      • I2C
      • Infographics
      • Interfaces
      • Minecraft
      • Model A+
      • Model B+
      • News
      • Pi Models
      • Pi Pico
      • Pi Zero
      • Power
      • Programming
      • Python
      • Raspberry Pi OS
      • Raspbian
      • RetroGaming
      • Robotics
      • Sensors
      • Software
      • SPI
      • Tutorials & Help
      Tags
      Arduino audio battery berryclip Birthday bluetooth cambridge camera CamJam DigiMakers display games GPIO I2C interface Kickstarter Kodi LCD LED Linux media Minecraft Model A motionEyeOS PCB photography photos Pi-Lite Pi Pico power python Raspberry Jam Raspberry Pi Bootcamp raspbian Retrogaming retroPie screen SD card security sensor SPI SSH temperature ultrasonic video
      Raspberry PI Related
      • Adafruit Blog
      • Average Maker
      • Official RaspBerry Pi Site
      • Raspberry Pi Pod
      • RasPi.tv
      • RaspTut
      • Stuff About Code
      Tech Resources
      • MattsBits – Pi Resources
      • Microbit Spy
      • Technology Spy
      Archives
      About

      Unofficial site devoted to the Raspberry Pi credit card sized computer offering tutorials, guides, resources,scripts and downloads. We hope to help everyone get the most out of their Pi by providing clear, simple articles on configuring, programming and operating it.

      Popular Posts
      September 19, 2014

      Top 5 Reasons The Raspberry Pi Sucks

      July 27, 2012

      16×2 LCD Module Control Using Python

      October 20, 2013

      Analogue Sensors On The Raspberry Pi Using An MCP3008

      Recent Posts
      March 13, 2023

      Elecrow Meteor IPS Touchscreen with RGB LEDs

      December 26, 2022

      Pi Pico Pinout Display on the Command Line

      December 23, 2022

      How to Add a Raspberry Pi Pico Reset Button

      Facebook Twitter Instagram Pinterest YouTube RSS

      Entries RSS | Comments RSS

      This site is not associated with the official Raspberrypi.org site or the Raspberry Pi Foundation. Raspberry Pi is a trademark of the Raspberry Pi Foundation.

      Copyright © 2022 - All Rights Reserved - Matt Hawkins

      mastodon.social@RPiSpy

      Type above and press Enter to search. Press Esc to cancel.