extracted from #1739 This currently can also trigger a bug where the inventory may not be saved correctly if you edit it when you are outside of the render distance.