And don't be sorry, I learnt about chunks today :D
And sadly, there is no way to detect a forcefully crash or abort.
It's like telling your arduino board to save all the files when the battery is...
And I'll just ping you even though you have already received an notification/email because you are watching this thread.
Here's something I managed to pull together with my wild imagination lol.
I haven't tested it and it's just theoretical. It may or may not work....
Why don't we run a schedule repeating task to clear all entities, like every 5 minutes?
Then also clear them all when with the custom stop command.
Are entities saved as a nbt data on the world?
If so, then we can just remove the entities data as a whole.
We'll declare a private variable $IsFirstJoined = false;
When a player joins, If $IsFirstJoined is setted to false then clear the entities, then...
Maybe we run it after a first player joins?
Maybe we can clear the entity onEnable?
This detects if /stop is used. Or proper shutting down.
I don't think it's possible to do something when it's going to forcefully crash. Since all...
Is it possible to detect if a server is going to forcefully crash?
This may be totally wrong.
new IntTag("ActionType", 0),...
That would be possible but wouldn't it affect the performance? We wouldn't know which chunk to load.
Unless we store that data in memory when...
Hmm, I thought maybe we can control the forcefully shutdown, but I don't think we can.
And did you read the results? Hmm
Separate names with a comma.