This is a food item, eating it will statisfy some of your hunger. It will also provide minor healing
The chocolate bar is a food item that is non-craftable and is primarly used to restore Calories.
The chocolate bar can be consumed by putting it into the Hotbar and pressing the specified key of 1-6. Or from anywhere in your Inventory by hovering your mouse over the item and then clicking on it with your right-mouse button after which you can select the Eat option.
The chocolate bar can be obtained in two different ways: