blocks – Block descriptions

The blocks module contains descriptions of blocks.

class bravo.blocks.Block(slot, name, secondary=0, drop=None, replace=0, ratio=1, quantity=1, dim=16, breakable=True, orientation=None)[source]

Bases: object

A model for a block.

There are lots of rule and properties specific to different types of blocks. This class encapsulates those properties in a singleton-style interface, allowing many blocks to be referenced in one location.

The basic idea of this class is to provide some centralized data and information about blocks, in order to abstract away as many special cases as possible. In general, if several blocks all have some special behavior, then it may be worthwhile to store data describing that behavior on this class rather than special-casing it in multiple places.

  • slot (int) – The index of this block. Must be globally unique.
  • name (str) – A common name for this block.
  • secondary (int) – The metadata/damage/secondary attribute for this block. Defaults to zero.
  • drop (int) – The type of block that should be dropped when an instance of this block is destroyed. Defaults to the slot value, to drop instances of this same type of block. To indicate that this block does not drop anything, set to air.
  • replace (int) – The type of block to place in the map when instances of this block are destroyed. Defaults to air.
  • ratio (float) – The probability of this block dropping a block on destruction.
  • quantity (int) – The number of blocks dropped when this block is destroyed.
  • dim (int) – How much light dims when passing through this kind of block. Defaults to 16 = opaque block.
  • breakable (bool) – Whether this block is diggable, breakable, bombable, explodeable, etc. Only a few blocks actually genuinely cannot be broken, so the default is True.
  • orientation (tuple) – The orientation data for a block. See orientable() for an explanation. The data should be in standard face order.

Whether this block can be oriented.

Orientable blocks are positioned according to the face on which they are built. They may not be buildable on all faces. Blocks are only orientable if their metadata can be used to directly and uniquely determine the face against which they were built.

Ladders are orientable, signposts are not.

Return type:bool
Returns:True if this block can be oriented, False if not.

Retrieve the metadata for a certain orientation, or None if this block cannot be built against the given face.

This method only returns valid data for orientable blocks; check orientable() first.

class bravo.blocks.Item(slot, name, secondary=0)[source]

Bases: object

An item.


List of slots of boots.


List of slots of chestplates.

Note that slot 303 (chainmail chestplate) is a chestplate, even though it is not normally obtainable.


List of slots of helmets.

Note that slot 86 (pumpkin) is a helmet.


List of slots of leggings.


A dictionary of Block objects.

This dictionary can be indexed by slot number or block name.


A dictionary of Item objects.

This dictionary can be indexed by slot number or block name.


Get the key for a given block/item.

Project Versions

Previous topic


Next topic

chunk – Chunk data structures

This Page