jamesmd95
Posts: 77
Joined: Sun Sep 16, 2012 7:47 pm
Location: Newcastle Upon Tyne
Contact: Website

Re: Minecraft server - How To

Sun Feb 10, 2013 10:56 pm

Yes did you watch my tutorial?

Code: Select all

apt-get install screen

Code: Select all

screen /opt/jdk1.8.0/bin/java -Xms200M Xmx200M -jar craftbukkit.jar
to access the server again

Code: Select all

screen -x
rapidwhois.uk | jmdawson.co.uk

ChrisJW
Posts: 8
Joined: Mon Feb 11, 2013 8:13 am

Re: Minecraft server - How To

Mon Feb 11, 2013 8:17 am

Howdy, thanks for this thread - I've recently purchased a Pi and just today had a go at setting up Minecraft on it, thought I'd share my experience.

When I used vanilla minecraft, it was pretty bad - blocks reappearing etc. Switched to CraftBukkit - much better. Seems to generally work. Mining, walking, building etc all fine. Gets a bit laggy when fighting mobs, especially with more than one person on the server. Haven't tried nether yet. I'm using a pre-existing world that's currently running primarily on a laptop on vanilla minecraft for a few friends.

Seems to be CPU limited - would running on a USB HDD via powered hub likely be better?

My SD card is a class 10 (45mb/s) 32GB Sandisk Extreme

jamesmd95
Posts: 77
Joined: Sun Sep 16, 2012 7:47 pm
Location: Newcastle Upon Tyne
Contact: Website

Re: Minecraft server - How To

Mon Feb 11, 2013 8:34 am

Nope, using that sd card is about as good as it gets. Look at the no spawn chunks part of my tutorial if your looking to speed it up further
rapidwhois.uk | jmdawson.co.uk

ChrisJW
Posts: 8
Joined: Mon Feb 11, 2013 8:13 am

Re: Minecraft server - How To

Mon Feb 11, 2013 9:27 am

No spawn chunks being the plugin for bukkit? Got that :)

Also, I'm running it headless on the Arch image. Would raspbian be any more optimised for this sort of thing?

jamesmd95
Posts: 77
Joined: Sun Sep 16, 2012 7:47 pm
Location: Newcastle Upon Tyne
Contact: Website

Re: Minecraft server - How To

Mon Feb 11, 2013 9:45 am

Personaly I think the debian based distro is faster although I have no benchmarks to prove this. In running it headless on raspian and its very smooth!
rapidwhois.uk | jmdawson.co.uk

ChrisJW
Posts: 8
Joined: Mon Feb 11, 2013 8:13 am

Re: Minecraft server - How To

Mon Feb 11, 2013 9:49 am

Hmm....might have to give it a go and see. If it gets playable with mobs for 4 or so people, I'll be gettin a 2nd pi for this. The first one was a test and xbmc. Doubt it'd be able to do both simultaneously :)

jamesmd95
Posts: 77
Joined: Sun Sep 16, 2012 7:47 pm
Location: Newcastle Upon Tyne
Contact: Website

Re: Minecraft server - How To

Mon Feb 11, 2013 9:53 am

Yo can easily get 4 players on! Aslong as you use nospawnchunks and get your armfreq to 1Ghz
rapidwhois.uk | jmdawson.co.uk

ChrisJW
Posts: 8
Joined: Mon Feb 11, 2013 8:13 am

Re: Minecraft server - How To

Mon Feb 11, 2013 10:07 am

With mobs and nether? I tried earlier, it was fine to play, but as soon as someone had a fight (zombie, creeper etc), was near impossible to hit with things bouncing around the place.

Do you use the Raspbian "wheezy" or Soft Float Debian "wheezy" one? The latter says it's slower, but is needed by jvm, which I thought was what java is...?

User avatar
xranby
Posts: 539
Joined: Sat Mar 03, 2012 10:02 pm
Contact: Website

Re: Minecraft server - How To

Mon Feb 11, 2013 10:42 am

ChrisJW wrote:With mobs and nether? I tried earlier, it was fine to play, but as soon as someone had a fight (zombie, creeper etc), was near impossible to hit with things bouncing around the place.

Do you use the Raspbian "wheezy" or Soft Float Debian "wheezy" one? The latter says it's slower, but is needed by jvm, which I thought was what java is...?
You should use the hardfloat JVM for use with Rasbian now when they are available. (the raspberry pi download page needs to be corrected)
http://www.raspberrypi.org/phpBB3/viewt ... 81&t=27805 - status of java on raspbian. (hard float)
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

jamesmd95
Posts: 77
Joined: Sun Sep 16, 2012 7:47 pm
Location: Newcastle Upon Tyne
Contact: Website

Re: Minecraft server - How To

Mon Feb 11, 2013 12:06 pm

You need this version of java! "http://www.java.net/download/JavaFXarm/ ... 012.tar.gz"

It is by far the fastest for the pi, see my tutorial for how to install it, raspian is the best image to use.
rapidwhois.uk | jmdawson.co.uk

r00x
Posts: 41
Joined: Mon Feb 04, 2013 11:05 am

Re: Minecraft server - How To

Tue Feb 12, 2013 11:41 am

ChrisJW, are you running the server from within X? It really benefits from running with the bare minimum software you can get away with. For me, it generally runs very well on vanilla:
  • I use a bodged install of Raspbian (my Internet is crap and the install fell over). Whatever, runs great! :lol: I will be attempting to install properly, because...
  • ...I use a crappy SD card as well, and am about to switch to one of these fancy Sandisk UHS models. Not necessarily optimal for the Pi (I hear UHS support is coming though) but it will be faster than the current card. The SD card certainly affects performance as it is the scratch disk for your map data. For me, this means the server runs great unless I sprint halfway across a biome and force loads of new chunks to generate. Then it can get laggy while it builds the local area.
  • I do not use X. My Pi runs pretty much headless, I SSH in to mess around with it.
  • You can disable Nether, spawn-npcs, spawn-monsters, spawn-animals in server.properties for a massive speed boost. The AI is quite stressful on the Pi it seems, so much so that without them it actually runs without constantly maxing the CPU at stock clocks (if '$ top' isn't lying to me!), but it should run OK with them on.
  • My Pi is overclocked (ARM 1GHz Core 500MHz RAM 600MHz over-volt=3). Overclocking really helps. Especially the core overclock (default is 250MHz there).
  • Launch the server with -Xmx408M for much better performance IF you have (a) a 512MB Pi and (b) are not running X, just the terminal and (c) have set gpu-mem=16 in /boot/config.txt

Dumbledood
Posts: 4
Joined: Tue Feb 12, 2013 7:00 pm

Re: Minecraft server - How To

Tue Feb 12, 2013 7:28 pm

While I was on about 3 hours ago, someone with username "PlanetMinecraft" came on, and asked for op. Despite me telling him/her/it I wasn't an admin or the owner, they weren't clever enough to parse my response and continued to ask me. Also said they wanted pictures - why would you need op for that?

I would not give op to just anyone who asks on my server, and on other servers I've seen people scam saying they're from planet minecraft - I would not trust anyone you don't personally know with any power.

Also, I moved away from the spawn, and possibly because of that a lot of people logged on and had lag problems (falling through the world) - probably due to the server needing to load chunks into memory. Sorry for this.

I notice you've now started whitelisting. I think lots of people will connect just to try connecting to a tiny server, but now they can't. It's up to you if you want to use the whitelist, but for publicity's sake the whitelist is not going to help things. If you really want to provide a server for your buddies then that's cool, but you are top google hit for "raspberry pi minecraft server" and inevitably you're going to get a bit of traffic as a result.

I really shouldn't play on your server, stealing your resources, so won't ask you to whitelist me.

r00x
Posts: 41
Joined: Mon Feb 04, 2013 11:05 am

Re: Minecraft server - How To

Tue Feb 12, 2013 7:49 pm

A Pi server could do with a practical user limit of about 5. All readers please bear in mind:

1) if users do not stay together the number of chunks to load goes up considerably!

2) every time a player wanders into a new area it will force chunk generation to occur. This is a VERY slow process on the Pi, especially if you have a rubbish SD card.

3) Even if the chunks have been generated in the past, moving into new chunks is also intensive for the Pi, as it shuffles more data.

You can observe points (2) and (3) happening by :
- disabling animal, monster and npc spawning (to free up CPU) then load the server
- CTRL+ALT+F2 to get to a second terminal (log in here)
- running 'top' to observe CPU usage. Should be low with no-one joined.
- join the server - it will jump but should not max out (perhaps needs a bit of time to settle)
- now alternate between looking/moving around small distances, and standing still. Observe the change in CPU utilisation! I generally found it to be 50-70% standing still and could be over 90% moving around.

I may put my Pi up for public Minecraft service in the near future, then we can share the load, haha. :lol:

randrade
Posts: 79
Joined: Thu Dec 27, 2012 8:42 pm
Contact: Website

Re: Minecraft server - How To

Tue Feb 12, 2013 8:29 pm

Dumbledood wrote:While I was on about 3 hours ago, someone with username "PlanetMinecraft" came on, and asked for op. Despite me telling him/her/it I wasn't an admin or the owner, they weren't clever enough to parse my response and continued to ask me. Also said they wanted pictures - why would you need op for that?

I would not give op to just anyone who asks on my server, and on other servers I've seen people scam saying they're from planet minecraft - I would not trust anyone you don't personally know with any power.

Also, I moved away from the spawn, and possibly because of that a lot of people logged on and had lag problems (falling through the world) - probably due to the server needing to load chunks into memory. Sorry for this.

I notice you've now started whitelisting. I think lots of people will connect just to try connecting to a tiny server, but now they can't. It's up to you if you want to use the whitelist, but for publicity's sake the whitelist is not going to help things. If you really want to provide a server for your buddies then that's cool, but you are top google hit for "raspberry pi minecraft server" and inevitably you're going to get a bit of traffic as a result.

I really shouldn't play on your server, stealing your resources, so won't ask you to whitelist me.
Feel free to play on my server. That's why it's public. and I haven't whitelisted anyone.

randrade
Posts: 79
Joined: Thu Dec 27, 2012 8:42 pm
Contact: Website

Re: Minecraft server - How To

Tue Feb 12, 2013 8:30 pm

I enabled nether on my server *scared*. Wonder how this will work...

As for generating chunks, I have a Samsung Class 6 8GB SD Card, and my Pi is running at 850MHz. No over-volting.

randrade
Posts: 79
Joined: Thu Dec 27, 2012 8:42 pm
Contact: Website

Re: Minecraft server - How To

Wed Feb 13, 2013 1:50 pm

Someone went into the server, took advantage of me being nice and having online-mode disabled, stole my account, deopped me, banned a couple of IPs and griefed many things.

Fortunately, I can do whatever I want to the server and fixed this.

I also reset the server - new map, new everything. And no, my username on it is not the same ;)

User avatar
tzj
Posts: 302
Joined: Thu Jan 05, 2012 3:09 pm
Location: Barnsley, SY, UK

Re: Minecraft server - How To

Wed Feb 13, 2013 2:27 pm

Security features would be a good follow up.
http://www.themagpi.com <---- Checkout the MagPi
(The MagPi - Co-Founder)

r00x
Posts: 41
Joined: Mon Feb 04, 2013 11:05 am

Re: Minecraft server - How To

Wed Feb 13, 2013 2:59 pm

tzj wrote:Security features would be a good follow up.
Don't disable online-mode, for starters :D

If you're using CraftBukkit you have access to all the security plugins which can be used to protect your Pi, so griefing could be a thing of the past.

However, griefing would be particularly easy within the confines of the Raspberry Pi, at least insofar as dragging the thing to a screeching halt with even a few blocks of TNT :lol:

randrade
Posts: 79
Joined: Thu Dec 27, 2012 8:42 pm
Contact: Website

Re: Minecraft server - How To

Wed Feb 13, 2013 3:00 pm

tzj wrote:Security features would be a good follow up.
What plugins do you recommend, for craftbukkit?

jamesmd95
Posts: 77
Joined: Sun Sep 16, 2012 7:47 pm
Location: Newcastle Upon Tyne
Contact: Website

Re: Minecraft server - How To

Wed Feb 13, 2013 8:10 pm

Worldguard and worldedit aswell as factions. :)
rapidwhois.uk | jmdawson.co.uk

TheArch1tect
Posts: 17
Joined: Tue Dec 11, 2012 3:20 am

Re: Minecraft server - How To

Wed Feb 13, 2013 9:07 pm

My apologies to randrade, for I am to blame for some of the signs that appeared around the spawn :D

Awesome job, I think I'll drop in from time to time to chat with players/play some. I'll definitely need advice when I try this myself, as I'm new to hosting servers/plugins.

-Arch

Also, is the nether/end disabled or enabled? I was wondering how it affected gameplay on the pi.

Dumbledood
Posts: 4
Joined: Tue Feb 12, 2013 7:00 pm

Re: Minecraft server - How To

Thu Feb 14, 2013 10:13 am

randrade wrote: What plugins do you recommend, for craftbukkit?
I'm not sure you have the RAM for bukkit. As someone said above, don't run within X, and then you can tell java to use more RAM.

Worldguard or residence will prevent grief, both need worldedit as well. Both also need an in-game tutorial (just a set of signs) set up telling users how to use them.

Factions is an unusual twist on MC, basically it encourages war, PvP and griefing. And just getting killed a few times by PvP, mobs, falling or drowning means your land can be taken, so it will not really protect things.

There are plugins such as worldborder, which limit how many chunks are in your world, which would avoid the loading-too-many-chunks-at-once problem, but your world would have to be tiny, I fear.

However, I would advise you to forget about having a serious, persistent server and just have something lightweight to demo the abilities of the Pi. Maybe build a nice spawn area, but be ready to revert from a backup. I'd still increase the RAM java can use and use a fast card, as has been said.

The best servers I've played on have been whitelist-only. Otherwise spammers, griefers, foul-mouthed idiots, and those who'd rather mess stuff up than build new stuff are all inevitable visitors. Then you need admins/moderators who can mute,ban, rollback grief, and so on.

randrade
Posts: 79
Joined: Thu Dec 27, 2012 8:42 pm
Contact: Website

Re: Minecraft server - How To

Thu Feb 14, 2013 3:11 pm

I installed WorldEdit and WorldGuard. How do I get these to work, now? :P I already disabled TNT, for example, by editing the config file.

Also, to whoever asked, nether is enabled and sort of works. It lagged a bit for me, and I had to re enter the server to get in, because I got disconnected.

r00x
Posts: 41
Joined: Mon Feb 04, 2013 11:05 am

Re: Minecraft server - How To

Thu Feb 14, 2013 3:52 pm

I have no idea how to use those. Perhaps they generate config files after you fire up the server?

Grief Prevention seems to be recommended for world protection (watch the video - very impressive), particularly if you don't want to put a lot of time into managing your server's griefproof status. Probably resource-intensive if it works this well though!

As well as NoSpawnChunks, I'm experimenting with MobSpawnSettings, which allows you to control how often mobs spawn (to reduce high numbers of mobs absorbing the Pi's limited CPU time!). It looks like it's working, though I'm not sure if I'm setting it up correctly. If anyone knows of a better plugin for this let us know! :)

Regarding memory usage, Craftbukkit is really frugal with NoSpawnChunks, I'm very impressed. You should have seen it handle hundreds of blocks of TNT at once. No crashes, no hanging (apparently there was over the net, but locally for me, smooth as butter).

It seems to be more chunk generation and travelling between chunks which thrash the Pi rather than sheer memory utilisation, and I imagine this adds up very quickly with multiple users online.

If you want a cheap visual indicator of the Pi's load under Minecraft, buy a berryclip or something similar, and write a little bit of code to read CPU utilisation and graph it using the LEDs. :D I'm currently using this to see if my Pi is straining in Minecraft without needing to squint at a terminal window running Top or mpstat (will share the code if anyone needs it).

Dumbledood
Posts: 4
Joined: Tue Feb 12, 2013 7:00 pm

Re: Minecraft server - How To

Thu Feb 14, 2013 4:59 pm

randrade wrote:I installed WorldEdit and WorldGuard. How do I get these to work, now? :P I already disabled TNT, for example, by editing the config file..
I read here http://wiki.sk89q.com/wiki/WorldEdit that WorldEdit only works for multi-player as part of an alternative server, e.g. Bukkit. These alternatives either require you to insert their code into the standard minecraft server jar (replacing some mojang code), or to discard the minecraft server jar and use only their alternative server (bukkit does this).

I use Bukkit, and I believe the computing requirements (RAM & CPU) are higher than a standard server.

Also, typically, when minecraft updates, Bukkit won't update for days or even weeks afterwards, leaving players with a client that won't run on your older server unless they use a launcher application to manage multiple client versions.

But, I could be wrong about all this, I only use Bukkit, there may be another way. As an aside, I find all the minecraft stuff to be documented to variable standards, and the best way to learn is often to watch a tutorial video rather than documentation.

Return to “Networking and servers”