User:Umucraft/Game mechanics/Internal representation of item and blocks

This page is about how items and blocks are internally represented in Minecraft, which is important for how the technical ItemBlocks were removed from the game and how to add new item and blocks.

Versions prior 1.3
Items

Items were represented as this in versions prior 12w18a:

A working example of this:

And an example without extra constructors:

Blocks

Blocks were represented as this in versions prior 1.3:

A working example of this without an extra constructor:

And with an extra constructor:

Versions between 1.3 and 1.5
Items

In versions between 1.3.x (inclusive) and 1.5 (exclusive), the items were represented as this (there is id + 255 offset for items):

A working example of this:

And with an extra constructor:

Blocks

In versions between 1.3.x (inclusive) and 1.5 (exclusive), the blocks were represented as this (there is no offset for blocks):

A working example:

And without extra constructor:

Versions between 1.5 and 1.6
Items

Items were represented as this in versions between 1.5 (inclusive) and 1.6 (exclusive):

A working example:

And without extra constructor:

Blocks

Blocks were represented as this:

A working example:

And without extra constructor: