Run code on Server-Startup?
Does anyone know how to run code on server-startup?
Howdy! Why do you need to run code at startup? Not sure but i think all mods/ code get init at startup (before loading the world) in theory you could run code from that moment .. but its a bit out of my league. @Metachronism might maybe be able to help you if he knows what you try to archive
Let's take the MOTD-Mod for example.
To activate it I must manually run the "/motd-on" command after server startup.
I would like to have that automated.
you could hijack an Item and use its constructor - in the future we'll have a more automated way to have plugins that are run at startup.
Would be nice to have something to hook into that gets executed once the server is done with the startup thru the api.
For modding having diffrent runlevels to hook into might be very usefull depending on what your mod is intended to do.
We should define a set of events which are related to changes in server state for this purpose. Such as: