Minecraft wiki entry for Pre-flattening, associated text: For an anvil in the world, 0x1 is the bit that determines whether the anvil is orientated in a north-south (0) or a west-east (1) direction. 0x4 and 0x8 are bits which determine whether the anvil is a regular (0x4 & 0x8 = 0), a slightly damaged (0x4 = 1) or a very damaged (0x8 = 1) one. For an anvil in the inventory, the data value is a counter of how damaged it is.