What’s up my name is technobo here for troubleshoot and in today’s video i’ve got a really interesting topic for you that i’ve wanted to do for quite some time but had no idea how to do basically if you’re hosting a minecraft server it has to be running all the time for someone to Connect but assuming you’d like to save some ram to use in other programs etc you’d have to go ahead and stop your server completely and then start it for people to join is there a way that you can have your server off all the time until someone wants to Connect to it it starts up they play they disconnect and the server shuts down once again while that’s exactly what i’ll be showing you how to do in this video today while running a minecraft server isn’t too heavy on your cpu at all times it does take a constant amount of ram And that is however much you give the server at times cpu can spike especially when plugins are saving the world etc etc so for this video i’ll be using both my desktop over here and my laptop where i have this server running everything is port forwarded and working as expected I’m currently using a paper server and if you’re curious on how to set one up for yourself as well as port forwarding etc those videos will be linked in the description down below so now that i’ve started up my minecraft server on my laptop i can have a look at task manager over Here and you can see that minecraft is using five six or seven gigabytes of ram and only a tiny bit of cpu processing power and the server will always use a constant amount of ram it will fluctuate a bit up and down but with that aside as you can see the Server is running i’m simply going to go ahead and open up minecraft and show you that i’m able to connect to it currently loading long command 0 out of 20. i can connect to it and of course play minecraft as per normal it’s just currently a normal paper server Working exactly as you’d expect so i’m going to go ahead and disconnect from the server and then save the actual server itself with save all to save the world and everything else in it then i’ll be using stop then once the server closes down completely i’ll also close the cmd window as well Of course i’m using a gui but for you you’ll probably only be using the cmd window with no gui so with all of that aside let’s get into the actual video basically we’ll be using this open source project over here mc is sleeping service data we’ll be downloading this And installing it setting it up and choosing a minecraft version currently the latest public release is set for 1.16.1 if your server is running something newer than that in other words like mine on 1.16.2 you’ll need to do something a bit different other than just downloading this exe over here That’s exactly what i’ll be showing you in today’s video we’ll be able to pick a specific version of minecraft set up this open source project and as soon as someone pings the server it’ll return its name someone tries to connect and it’ll save the server starting up And then of course it’ll boot up the server so with that in mind let’s go ahead and install some prerequisites scrolling down on this page we’ll need node.js if you’re using it linux you’ll need node as well but you can check that out here so heading across to node.js’s website We’ll see this page over here now of course you’ll need to download node if you don’t already have it installed and of course i’ll be guiding you through that now so i’ll click on current for latest features and i’ll click windows installer i’ll click on it to open it when it’s done And we’ll begin installing o.js simply clicking next i accept next choosing an install location next and leaving everything as is here next we’ll make sure to check this box over here saying automatically install the necessary tools next and install then when you see this window over here Simply press any key any key again and then yes when prompted for admin from here chocolaty will install and it’ll stall a bunch of other prerequisites and then when we get see here you’ll see type enter to exit simply type enter and hit enter then that window will close And we’re completely done installing node.js the next step we’ll have to make sure that we know where our minecraft server is and for that i’ll be heading across to my laptop over here where this paper folder contains my minecraft server so all we have to do from here is head Across to the github page linked in the description down below this is the mc sleeping server open source project simply have a look at this page over here click the code button in the top right and then click download zip then we’ll be downloading a zip clicking it to open It once it’s done and we’ll open the folder inside of the zip so we see all of these files we’ll select all of them and then drag and drop them all out into the same folder as our minecraft server jar if i refresh the folder You’ll see all of these new files at the very top over here from here all we have to do is install a plugin into our spigot paper craft bucket etc server that will shut down the server automatically when there are no players online and for this it’s super simple we’re Going to be using the empty server stopper plugin head across to the third link in the description down below which will take you across to the spigot mc page simply click download now and empty server stopper.jar will be downloaded all you have to do is simply click keep Head across to your paper server head across to your minecraft server and open up the plugins folder then simply drag and drop the jar file that we just downloaded into this folder and now it’s loaded onto our server basically this plugin will shut down your server after 60 seconds When no player is on and when that happens this mc sleeping service starter simply waits for people to ask if the server is online and then if someone connects to it it’ll start it up again so now that we’ve got node.js installed the starter and the stopper installed let’s go ahead and do A tiny bit of config before we actually get to launching this project so simply open up sleeping settings dot yml with a text editor of your choice i’ll be using notepad plus plus then inside of here we can adjust the server name this will be the server name that Shows up on the list to something that you want so i’ll enter the name of the server which was long command and inside of brackets i’ll enter sleeping of course the name doesn’t really matter at all then when a player connects to the server this login message will be presented to them Currently it’s waking server up come back in a minute that sounds about right then what we have to do is replace the server startup command at the very bottom over here currently it’s simply starting up spigot.jar with no extra arguments heading across to our server folder over here And opening up our run.bat server.bat etc etc will have the way that we normally start our server in my case it’s this over here java xms 14gb 16 gig jar paper 186 dot jar i’ll simply copy that line and i’ll paste it in here so that this Is the command that’s run when our server is asked to start and then finally the last thing that we have to do in the settings folder is add a new line either at the end or say somewhere up here and add server version as such capitalization is important Colon space followed by the service version in my case it’ll be 1.16.2 then hit ctrl s to save the file and you can close out of it what versions are currently supported well it uses the node minecraft protocol which is this project over here link to the description down below Simply make sure that the server version you’re trying to use is on this list over here if it is create and then finally the last thing you have to be aware of is the server port over here this is supposed to match the same port that your server is running on If you’re running multiple servers make sure to change this over here so now that we’ve configured this let’s quickly install this project as we haven’t done it just yet and make sure everything is up to date so at the very top in the url bar over here i’ll type in Cmd and it’ll open a command prompt window inside of our server folder in my case c uses techno desktop paper this folder over here then with the command prompt window open here simply type in npm space install and this will install the node project it’ll download all the required plugins And files and set it up for us after that’s done we’ll quickly run the update npm space update and great now we’re done updating the actual server itself then finally after the update commands are run all you have to do to start the server is type in npm Space start this will then show you a bunch of text as such and says ready for battle i’ll open up minecraft once again and refresh my server list this time you should see a different icon which you do longman over here sleeping 0 out of 20. as you can see on The server side as soon as i refresh the list a new line appears saying a prince has taken a quick peek handshaking 1.16.2 this handshaking over here is the client version that’s pinging the server if we try and connect to the server we’ll see connecting to the server and After a couple of seconds we’ll see connection lost waking up the server come back in a minute having a look at our server screen over here we can see that the minecraft server is currently starting up as you’d expect so from here all the player has to do is wait for the server To start up completely there we go now the server is started up i can refresh the list over here as you can see our server is running double clicking opening it up we’re not connecting to the server as per normal as the normal server is running If we go ahead and disconnect you’ll see on the server console over here that after 60 seconds it should say server is shutting down there we go server empty shutdown in 60 minutes so that may be a bit long for your liking if we head across to the actual server Folder itself then open up the plugins folder we can have a look for the empty server stopper folder and open up the config as you can see shutdown time 60 i’ll set it up to 1 saving the file after a minute our server should shut down So for this i’ll simply run stop for now just to make sure that we close the server and i’ll double click on the server once again the server will start up i’ll go ahead and try to connect to the server using my minecraft client the server will once again start up and Now the server is started up i’ll go ahead and connect to it and then disconnect so that our server shutdown plugin now says shutdown in one minute we’ll simply wait for the server to shut down after a minute so you can see what happens and there we go the minecraft Server has stopped as expected and it’s simply waiting for someone to refresh their list then they’re able to connect to the server and play as normal the server goes back to this low power sleeping mode awesome so from here i’ll simply close out of the command prompt window And head back to our server folder we’ll be taking our old server.bat and either renaming it so we don’t use it like this alt server.bat or we’ll simply be editing it i’ll be making a new one simply titled server.bat once again i’ll go ahead and open it up with a text Editor add echo off and the next line will be npm space start then on the third line just in case this program decides to crash i’ll enter pause that’ll keep the window open if for some reason it crashes out and would vanish usually so closing out of it simply running Server.bat we’ll start up our listener once again waiting for someone to connect and then it will start up the server so what if you’d like to change the service icon from this one over here to your own server icon or something else well first of all You have to make sure that you actually have one this image over here is 64 by 64 pixels which is the exact dimensions that a server icon needs to be simply rename the file to server hyphen icon and make sure it’s of dot png file type Then i’ll be pasting it into the home directory of our server and then we’ll be opening up sleeping server starter.js with a text editor of our choice this dot js file is where all of the code for the server starter is what we’re looking for is the very top favicon string Inside of here we have a base64 encoded image uri all we have to do is select everything between the open quotation marks and the closing quotation marks at the end here then removing them all we have to do is encode that image as a base64 uri how do we do that Well the next link in the description down below will take you across to this page over here simply drag and drop the icon onto this page and then click copy image then we’ll head back to the quotation marks and simply paste it in there then save this file and simply open up server.band Refreshing our server list we should see our server over here now has the server icon that we mentioned earlier opening it up it’ll go ahead and start the server as you’d expect using mc sleeping server starter and after it eventually starts up because we also placed the server icon In the home directory of the folder our normal server itself should also have an icon on it where before it didn’t have an icon when the actual server was running and now that our actual server is running you can see our icon over here is working as expected joining the server We can play as usual and as soon as we disconnect the server will shut down in a minute back to that low power mode and then simply refreshing our server list and there we go so anyways that’s about it for this video it took incredibly long to record In fact over half an hour so hopefully i’m able to edit this down to something a bit more understandable anyways i’ll probably keep using this for my server as the amount of ram that it takes up now is absolutely tiny being only 60 megabytes instead of a couple of gigabytes thank You for watching my name has been technoba here for troubleshoot and i’ll see you all next time ciao Video Information
This video, titled ‘Minecraft: Auto start/stop server when players connect | SleepingServerStarter’, was uploaded by TroubleChute on 2020-10-07 15:28:45. It has garnered 110956 views and 2461 likes. The duration of the video is 00:13:15 or 795 seconds.
Running a server all the time? Well, you can keep it completely off, and when a player attempts to connect to the server it will startup. After some time passes with no players on the server, it shuts down, waiting for the next player to connect. This way you can always “keep a server running”, but only have it use RAM/CPU when there are players online. The rest of the time it’s in a ‘low power’ mode, waiting for someone to connect. This video explains the entire process from start to finish.
Downloads: – McSleepingServerStarter: https://github.com/vincss/mcsleepingserverstarter – Node.js: https://nodejs.org/en/download/ – Empty Server Stopper: https://www.spigotmc.org/resources/emptyserverstopper.19409/ – Supported versions: https://github.com/PrismarineJS/node-minecraft-protocol – Image to Base64: https://base64-image.de
Related: – Minecraft Server playlist: https://www.youtube.com/playlist?list=PLsSFD61FiOVnbWS6k0SpBZETzAEnNuXDm – Spigot/Bukkit server setup: https://youtu.be/lNp4I-600wo – Paper server setup: https://youtu.be/o3vZx0l8y_U – Fabric server setup: https://youtu.be/q5MFHzdDG3g – Port forwarding: https://youtu.be/X75GbRaGzu8 – Multi-router port forwarding: https://youtu.be/Vm30a6CN3MA
#Minecraft #Guide #Server #autostart —————————– 💸 Found this useful? Help me make more! Support me by becoming a member: https://youtube.com/channel/UCkih2oVTbXPEpVwE-U7kmHw/join —————————– 💸 Direct donations via Ko-Fi: https://ko-fi.com/TCNOco 💬 Discuss video & Suggest (Discord): https://s.tcno.co/Discord 👉 Game guides & Simple tips: https://YouTube.com/TroubleChuteBasics 🌐 Website: https://tcno.co 📧 Need voice overs done? Business query? Contact my business email: TroubleChute (at) tcno.co
Everything in this video is my personal opinion and experience, and should not be considered professional advice. Always do your own research and make sure what you’re doing is safe.