Before using Json I made this class, to be implemented by each item handler that needs custom metadata.
/** Storage class for item meta data */ class cItemMeta { public: virtual ~cItemMeta() {} /** Load from NBT source. */ virtual void FromNBT(const cParsedNBT & a_NBT) = 0; /** Load from copy. */ virtual void FromCopy(const cItemMeta * a_Meta) = 0; /** From JSON */ virtual void FromJSON(const Json::Value & a_Value) = 0; /** Write to NBT */ virtual void ToNBT(cFastNBTWriter & a_Writer) = 0; /** To JSON */ virtual void ToJSON(Json::Value & a_OutValue) = 0; /** Is equal to */ virtual bool IsEqual(cItemMeta * a_ItemMeta) = 0; };