Alternative: Can we add a read-only "loader_inventory" attribute on LuaEntity that holds the `defines.inventory.<x>` value for the inventory that the loader interacts with?
Special bonus points for making that attribute writeable to allow inventory selection.

