He also died because when he was being chased, he refused to run through a bean field, trampling on the beans.
He used to also lecture by dressing like a girl, and sitting behind a curtain so that only his shadow would appear on the curtain. I love stories of ancient trans people. Yes they also believed in silly things sometimes, but they were just as intelligent and creative as we are. They were human in every way that we are today.
You would have to create a UI object for the container, and a array or list for the actual inventory objects, and then a way to sync this data to disk or to a save buffer to keep it updated.