The reason this happens is because you're mining blocks that are not breakable. The durability will be shown as decreasing on the green bar but actually nothing happens at all. If you mine breakable blocks or wear down the durability on your weapon by hitting a real player the durability won't be restored