Supposedly, I have full (public) access to an entity class (I can modify what ever I like to); How do I close() it on server shutdown. I'd not like the server to respawn it on startup.
The server disables plugins first, then saves worlds. Which means, you can "kill" or "close" the entity while the plugin is disabling.
You need to close the entity before the entity's chunk is saved to disk, and make sure you set the chunk as changed to make sure the chunk is saved without your entity. I'm not certain how the timing of this will play with plugins. This may get even more dicey in the future when threaded level I/O is implemented. I think this may be lacking in the current API. Feel free to open an issue or PR to suggest the ability to mark an entity as temporary as a possible addition.
You could overwrite Entity::saveNBT() and make sure the entities compound tag is completely empty, you could also kill the entity when the server tries to spawn it again; purely up to you.
Why have the server do more effort to load it if it's only going to die? close it when your plugin disables.