<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_entity(self, *components) -> int: """Create a new Entity. This method returns an Entity ID, which is just a plain integer. You can optionally pass one or more Component instances to be assigned to the Entity. :param components: Optional components to be assigned to the entity on creation. :return: The next Entity ID in sequence. """

        self._next_entity_id += 1

        # TODO: duplicate add_component code here for performance
        for component in components:
            self.add_component(self._next_entity_id, component)

        # self.clear_cache()
        return self._next_entity_id