Minecraft/Server

From Omnia
Revision as of 23:01, 18 July 2021 by Kenneth (talk | contribs) (→‎SRV Record)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Minecraft Server

java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui

Minecraft

See Minecraft

Port

TCP Port 25565

Download

Download server for PC/Mac | Minecraft - https://minecraft.net/en-us/download/server

wget https://s3.amazonaws.com/Minecraft.Download/versions/1.11.2/minecraft_server.1.11.2.jar
java -Xmx1024M -Xms1024M -jar minecraft_server.1.11.2.jar nogui

Installation

Install Java JRE:

sh jre-6u23-linux-i586-rpm.bin

Install Minecraft:

wget http://www.minecraft.net/download/minecraft_server.jar

Execute Server:

java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui

Server Commands

SMP Server commands - Minecraft Wiki - http://www.minecraftwiki.net/wiki/SMP_Server_commands

Sourced 2011.03.06:

Op commands

These commands are usable by console or by the ops on the server (by putting a slash "/" before a command). It is not necessary to put < or > in a command.

Command Description Usage
help or ? Shows a list of server commands in the console or in-game. help
kick <player> Removes a player from the server. kick player1
ban <player> Bans a player from the server. ban player1
pardon <player> Pardons a banned player so that they can connect again. pardon player1
ban-ip <ip> Bans an IP address from the server. ban-ip 192.168.1.5
pardon-ip <ip> Pardons a banned IP address so that they can connect again. pardon-ip 192.168.1.5
op <player> Turns a player into an op. op player1
deop <player> Removes op status from a player. deop player1
tp <player1> <player2> Moves <player1> to the same location as <player2>. tp player1 player2
give <player> <id> [<num>] Gives <player> <num> (default 1) of the resource with Data values <id>. give player1 3 64 (gives player1 64 blocks of dirt)
stop Gracefully stops the server. stop
save-all Forces a server-wide level save. save-all
save-off Disables terrain saving (useful for backup scripts). save-off
save-on Re-enables terrain saving. save-on
list Lists all currently connected players. list
say <message> Broadcasts a message to all players. say hello minecraft world!
whitelist <on/off> Enable or disable whitelisting (i.e. only listed players may join). whitelist on
whitelist <add/remove> <player> Add or remove a player from the whitelist. whitelist add notch
whitelist list Lists all currently whitelisted players. whitelist list
whitelist reload Reload the whitelist from file. whitelist reload
time <add/set> <amount> Add to or set the world time. Amount may be a number between 0 and 24000, inclusive, where 0 is dawn (i.e. clock is bisected; left side is day) and 12000 is noon. time set 0

Player commands

These commands are usable by any player.

Command Description
/kill Inflicts 1000 damage points to the user, killing them and returning them to the spawn point. Useful when lost or stuck.
/me <action> Sends a message as an IRC-style action (e.g. "* Player slaps everyone around a bit with a large trout").
/tell <player> <message> Sends a private message to another player.

Utilities

Cartograph - map your Alpha - Minecraft Forum - Official Minecraft Forums

server.properties

Server.properties - Minepedia - http://www.minecraftwiki.net/wiki/Server.properties

admin-slot=false  # Allow op's to join even if the server is full. 
grow-trees=true   # Whether or not the server will allow planted saplings to grow into trees.
level-name=world  # The folder to save the Alpha format Map in. It's best to keep this the default to avoid confusion.
max-connections=3 # The max number of connections the server will accept from the same IP. 
max-players=20    # The max numbers of players that can play on the server at the same time.
monsters=false    # Set true if you want monsters to be spawned at night, false if you don't.
motd=             # The MOTD is displayed when people join the server. 
online-mode=true  # Authenticate users against minecraft.net
public=false      # Whenever or not the server should be displayed in the server list. 
server-ip=        # Set this if you want the server to bind to a particular IP (default is wildcard)
server-name=      # The name of the server. This is displayed in the server list and when someone is joining the server 
server-port=25565 # Changes the port the server is hosting on
verify-names=true # If enabled the server will make sure that the client is logged in with the same IP on Minecraft.net.

Delete Player

"If you want to delete a player from the game, you can remove the player's .dat file. Navigate to the Minecraft home directory, open the map folder, open the player's folder, and delete the PLAYERNAME.dat file. This will cause the player to start over at the spawn point with no inventory. The player's changes to the world will be unchanged along with any inventory stored in chests. "

[server_name]/players/[player].dat

[http://www.minecraftwiki.net/wiki/Server

Server Administration

Server Administration - Minecraft Forums - http://www.minecraftforum.net/viewforum.php?f=10

Mods

Topaz

Topaz's Minecraft SMP Toolkit - http://minecraft.topazstorm.com/

[SMP] Topaz's Toolkit: waypoint teleporters, auto-backup... - Minecraft Forums - http://www.minecraftforum.net/viewtopic.php?f=10&t=36523

Topaz's Minecraft SMP Toolkit - Minecraft Forums - http://forums.redstonewire.com/viewtopic.php?f=25&t=36121


"Topaz's Minecraft SMP Toolkit (or tztk) enhances the vanilla Minecraft server by providing some useful scripts and in-game commands."
-create <id>[x<count>] creates the requested block or item for the current player
-tp <player> teleports the user to the specified player.
-list lists all connected users.

See Topaz - tztk-update.sh

See Topaz - tztk-server.sh


"Ideas for scripting retrieval of online-users list? - Minecraft Forums" ... "topaz toolkit already does this, and some nice additional features, such as auto backup, etc." [1]


My Modifications Todo:

  • Nightly Program Update
  • Mail / Messenger
  • tp allow/disallow
  • fix buffer issue
  • last log

bukkit

http://bukkit.org/

Bukkit is a free, open-source, software that provides the means to extend the popular Minecraft multiplayer server.
Our organization's aim is: to provide the Minecraft community with a powerful, well-designed and thought out solution to extending and controlling their servers.

Bukkit wiki - http://wiki.bukkit.org

Introducing Bukkit - a new Minecraft Server mod - http://forum.hey0.net/showthread.php?tid=3591

Installation: [2]

wget http://artifacts.lukegb.com/artifactory/plugins-snapshot/org/bukkit/craftbukkit/0.0.1-SNAPSHOT/craftbukkit-0.0.1-SNAPSHOT.jar
mv craftbukkit-0.0.1-SNAPSHOT.jar craftbukkit.jar
java -Xms512M -Xmx512M -jar craftbukkit.jar nogui


MCZall Server

MCZall - http://www.mclawl.tk

video: http://www.youtube.com/watch?v=T7mTe8UxkSU

hey0 hMod

Note: hey0 hMod, which is no longer being developed!


hey0 blog - http://blog.hey0.net/

hey0 forum - http://forum.hey0.net/

hey0 wiki - http://wiki.hey0.net/


http://www.minecraftforum.net/viewtopic.php?t=23340

http://www.minecraftwiki.net/wiki/Server_mods

https://github.com/mrsheen/minecraft-hey0-plugins

http://wiki.hey0.net/index.php/Getting_Started

http://forum.hey0.net/forumdisplay.php?fid=8

http://forum.hey0.net/showthread.php?tid=317

http://forum.hey0.net/showthread.php?tid=251


http://www.minecraftforum.net/viewtopic.php?t=23340

Bukkit will be superseding hMod. Once Bukkit is ready, hMod will no longer be updated. I no longer have an interest in Minecraft, so this change is for the best. The hMod forum won't be deleted though, so you can keep posting and such, if you really want. It won't be very moderated though, since there'll be no point in doing so.

You can read more here: http://forum.hey0.net/showthread.php?tid=3591

Their official website: http://bukkit.org/

hMod stuff:

Installation:

wget http://hey0.net/get.php?dl=serverbeta -O hey0.zip
unzip hey0.zip

cd bin
sh server_nogui.sh

# or
cp bin/Minecraft_Mod.jar .
java -Xms1024M -Xmx1024M -jar Minecraft_Mod.jar nogui
java -Xms512M -Xmx512M -jar Minecraft_Mod.jar nogui

Currently broken for this verison of Minecraft:

java.lang.NoSuchMethodError: cw.<init>(Lnet/minecraft/server/MinecraftServer;)V
        at net.minecraft.server.MinecraftServer.<init>(SourceFile:57)
        at net.minecraft.server.MinecraftServer.main(SourceFile:503)
        at Main.main(Main.java:29)

Others

"Running fine on CentOS with WorldEdit, Cuboid, Backup & Maps plugins." [3]

Cartograph

Cartograph - map your Alpha - Minecraft Forums - http://www.minecraftforum.net/viewtopic.php?f=25&t=13134

Cartograph - Minepedia - The Minecraft Wiki - http://www.minecraftwiki.net/wiki/Cartograph


Installation:

wget http://sites.google.com/site/zbtestbed/C.jar -o C.jar

Ratty's Linux server admin tricks

crontab

crontab:

# do a backup every hour
0 * * * * nice -n 20 ~/bin/backup-minecraft.sh

# 5:05 make cartographer maps
5 5 * * * nice -n 20 ~/bin/makemaps.sh

backups

~/bin/backup-minecraft.sh:

#! /bin/bash

THEDATE=`date +%Y%m%d-%H%M`

cd
7z a ~/backups/game/minecraft.$THEDATE.7z minecraft -x@${HOME}/bin/exclude-world.txt
7z a ~/backups/world/minecraft.$THEDATE.7z minecraft/WorldNomNomNom

# remove old backups, anything over a day old
find ~/backups -type f -mtime +1 -exec rm -f '{}' \;

Cartographer

pynemap or c10t can do that

Map world:

ln -s ~/minecraft/WorldNomNomNom ~/.minecraft/saves/World1

~/bin/makemaps.sh:

#! /bin/bash

export RTMP=/tmp/makemaps.$$.

# make catographer maps
cd ~/web-maps

THEFILE=nomland-`date +%Y%m%d-%H%M`.png

( echo 1 ; echo WOb ) | ~/bin/cart5

# remove the .txt file that it makes
rm -f map1.txt

# this sleep makes it easier to hit control-c in case I made a mistake
sleep 1

convert -quality 100 -rotate 90 map1-*.png $THEFILE \
&& rm -f map1-*.png

rm -f current.png
ln $THEFILE current.png

# also make the diff maps
~/bin/makechanges.sh

~/bin/makechanges.sh:

#! /bin/bash

export RTMP=/tmp/makechanges.$$.

cd ~/web-maps

OLD=`ls nom*.png | tail -2 | head -1`
NEW=`ls nom*.png | tail -1`

echo old $OLD
echo new $NEW

compare -lowlight-color white $OLD $NEW $RTMP.1.tga
convert -transparent white $RTMP.1.tga $RTMP.2.tga
composite -quality 100 $RTMP.2.tga $OLD changes/changes-$NEW

rm -f new.png
ln changes/changes-$NEW new.png

rm -rf $RTMP.*

Slideshow

preprocessing:

mkdir -p ~/out/minecraft ~/out/minecraft/slides
cd ~/out/minecraft
ln -s ~/.minecraft/saves/World2 minecraft/WorldNomNomNom

makehourlyslides.sh:

#! /bin/bash

# comment out this next line if you want to just manually edit slidelist.txt
# and make it contain exactly which backups you want to generate
ls ~/backups/world > /tmp/slidelist.txt

for i in `/tmp/slidelist.txt`
do
# rm -rf is a very scary command, make damn sure you're in the right directory. You should be in ~/out/
rm -rf minecraft
7z x ~/backups/world/$i
( echo 2 ; echo WOb ) | ~/bin/cart5
convert -quality 100 -rotate 90 map?-*.png slides/$i.png \
&& rm -f map?-*.png
done

Get dimensions:

$ file *.png
minecraft.20100821-0400.7z.png: PNG image data, 3904 x 5728, 8-bit/color RGBA, non-interlaced
minecraft.20100821-0500.7z.png: PNG image data, 3904 x 5728, 8-bit/color RGBA, non-interlaced
minecraft.20100821-0600.7z.png: PNG image data, 3904 x 5728, 8-bit/color RGBA, non-interlaced
minecraft.20100821-0700.7z.png: PNG image data, 3920 x 5728, 8-bit/color RGBA, non-interlaced
minecraft.20100821-0800.7z.png: PNG image data, 3920 x 5728, 8-bit/color RGBA, non-interlaced
minecraft.20100821-0900.7z.png: PNG image data, 3920 x 5728, 8-bit/color RGBA, non-interlaced
minecraft.20100821-1000.7z.png: PNG image data, 3920 x 5728, 8-bit/color RGBA, non-interlaced

makediffs.sh:

#! /bin/bash

# this script assumes slides is filled with all the same dimensions
# manually peel out any really odd size ranges

cd ~/out/minecraft/slides
mkdir zoomed zoomed-text

#echo make a list of only the unique images
md5sum -b *.png | uniq -w 32 | awk -F'*' '{print $2}' > /tmp/list1

echo make cropped versions with and without text overlay
for i in `cat /tmp/list1`
do echo $i
NICENAME=`echo $i | awk -F. '{print $2}'`
convert $i -crop 858x917+1049+2230 -quality 100 ../zoomed/$i
convert ../zoomed/$i  -quality 100 -pointsize 24 label:$NICENAME -gravity Center -append ../zoomed-text/$i
done

echo make compare versions
cd ~/out/minecraft/zoomed
# remove the | bash at the end if you want to debug what its doing
ls | awk -f ~/bin/diffy.awk | bash
rm -f /tmp/temp1.tga /tmp/temp2.tga /tmp/temp3.tga

# cleanup temp file
rm -f /tmp/list1

diffy.awk:

BEGIN { getline
LAST = $0 }
{ split($0,x,".")
NICENAME = x[2]
print "compare -lowlight-color white " LAST " " $0 " /tmp/temp1.tga"
print "convert -transparent white /tmp/temp1.tga /tmp/temp2.tga"
print "composite -quality 100 /tmp/temp2.tga " LAST " /tmp/temp3.tga"
print "convert /tmp/temp3.tga -quality 100 -pointsize 24 label:\"" NICENAME "\" -gravity Center -append ../changes/changes-" $0
LAST = $0
}

Source

Source: Ratty's Linux server admin tricks - Minecraft Forum - Official Minecraft Forums

Mapping

Minecraft Overviewer

See Minecraft/Overviewer

SRV Record

To target Minecraft to a specific port, use an SRV record:

Format:

# Top level:
_minecraft._tcp TTL class SRV priority weight port target
# Subdomain:
_minecraft._tcp.name TTL class SRV priority weight port target

For example: _minecraft._tcp.play maps play.yourdomain.com

  1. Service: _minecraft
  2. Protocol: _tcp / _tcp.play
  3. Priority: 0 (or 1, or something else)
    1. Priority: the lower the value, the more preferred.
  4. Weight: 0 (or 5, or something else)
    1. Weight: the higher the value, the more preferred. (Opposite of Priority)
  5. Target: Your Minecraft hostname.
  6. Port: The port your Minecraft server is set to use. (eg. 25565)
  7. TTL: You can leave as default (eg. 300)

Example:

dig SRV _minecraft._tcp.mc5.mydomain.com
_minecraft._tcp.mc5.mydomain.com. 1620 IN  SRV     0 5 9005 mc5.mydomain.com.

Notes

TO READ

Running minecraft in a screen session. - Minecraft Forum - Official Minecraft Forums

HOW-TO: Run a server on Amazon EC2 - Minecraft Forum - Official Minecraft Forums

Another shell script - Minecraft Forum - Official Minecraft Forums

[SMP Topaz's Toolkit: waypoint teleporters, auto-backup... - Minecraft Forum - Official Minecraft Forums]

Cartograph - map your Alpha - Minecraft Forum - Official Minecraft Forums

Simple Batch Cartograph Timer - Minecraft Forum - Official Minecraft Forums

BEST: Ratty's Linux server admin tricks - Minecraft Forum - Official Minecraft Forums


*Official speeds for all materials* - Minecraft Forum - Official Minecraft Forums

MineEdit All-In-One Editor (Last Updated 7/30/2010) - Minecraft Forum - Official Minecraft Forums

NBTedit - Minecraft Forum - Official Minecraft Forums

[Tutorial Editing spawn and map geography - Minecraft Forum - Official Minecraft Forums]

Minecraft Multiplayer: GWJ World | Gamers With Jobs

Server mod (plugins!) b103 - Minecraft Forum - Official Minecraft Forums

Screen Tricks

Give random Items:

while true; do ITEM=$(( 1 + $RANDOM % 96 )) ; screen -x minecraft -p 0 -X stuff "give player $ITEM 5"`echo -ne '\015'` ; sleep 30 ; done
while true; do ITEM=$(( 1 + $RANDOM % 5 )) ; screen -x minecraft -p 0 -X stuff "give spincycle $ITEM 1"`echo -ne '\015'` ; sleep .5 ; done

Always be day:

while true ; do screen -x minecraft -p 0 -X stuff "time set 22500"`echo -ne '\015'` ; date ; sleep 600 ; done
while true ; do screen -x mc -p 0 -X stuff "time set 0"`echo -ne '\015'` ; date ; sleep 600 ; done

Player Edit

cp kiloforce.dat kiloforce.dat.old
cat kiloforce.dat | gzip -d | xxd > k.xxd
cat kiloforce.dat | gzip -d | xxd > k.xxd ; vim k.xxd
vim k.xxd
cat k.xxd | xxd -r | gzip > kiloforce.dat

Empty Player:

0000000: 0a00 0009 0003 506f 7306 0000 0003 4065  ......Pos.....@e
0000010: 5000 0000 0000 4051 0000 0000 0000 c076  P.....@Q.......v
0000020: 2800 0000 0000 0100 084f 6e47 726f 756e  (........OnGroun
0000030: 6401 0200 0446 6972 65ff ec03 0009 4469  d....Fire.....Di
0000040: 6d65 6e73 696f 6e00 0000 0002 0009 4465  mension.......De
0000050: 6174 6854 696d 6500 0009 0008 526f 7461  athTime.....Rota
0000060: 7469 6f6e 0500 0000 0200 0000 0000 0000  tion............
0000070: 0009 0009 496e 7665 6e74 6f72 7901 0000  ....Inventory...
0000080: 0000 0500 0c46 616c 6c44 6973 7461 6e63  .....FallDistanc
0000090: 6500 0000 0002 0006 4865 616c 7468 0014  e.......Health..
00000a0: 0200 0848 7572 7454 696d 6500 0009 0006  ...HurtTime.....
00000b0: 4d6f 7469 6f6e 0600 0000 0300 0000 0000  Motion..........
00000c0: 0000 00bf b412 05c2 8f5c 2900 0000 0000  .........\).....
00000d0: 0000 0001 0008 536c 6565 7069 6e67 0002  ......Sleeping..
00000e0: 000a 4174 7461 636b 5469 6d65 0000 0200  ..AttackTime....
00000f0: 0a53 6c65 6570 5469 6d65 7200 0002 0003  .SleepTimer.....
0000100: 4169 7201 2c00                           Air.,.
X: 170.5 (4065 5000 0000 0000)
Y: 69.62000000476837 (4051 0000 0000 0000)
Z: -354.5 (c076 2800 0000 0000)

With 10 Torches in Inventory:

0000000: 0a00 0009 0003 506f 7306 0000 0003 4065  ......Pos.....@e
0000010: 5000 0000 0000 4051 0000 0000 0000 c076  P.....@Q.......v
0000020: 2800 0000 0000 0100 084f 6e47 726f 756e  (........OnGroun
0000030: 6401 0200 0446 6972 65ff ec03 0009 4469  d....Fire.....Di
0000040: 6d65 6e73 696f 6e00 0000 0002 0009 4465  mension.......De
0000050: 6174 6854 696d 6500 0009 0008 526f 7461  athTime.....Rota
0000060: 7469 6f6e 0500 0000 02bf 888d 603f f154  tion........`?.T
0000070: d809 0009 496e 7665 6e74 6f72 790a 0000  ....Inventory...
0000080: 0001 0200 0644 616d 6167 6500 0001 0004  .....Damage.....
0000090: 536c 6f74 0001 0005 436f 756e 740a 0200  Slot....Count...
00000a0: 0269 6400 3200 0500 0c46 616c 6c44 6973  .id.2....FallDis
00000b0: 7461 6e63 6500 0000 0002 0006 4865 616c  tance.......Heal
00000c0: 7468 0014 0200 0848 7572 7454 696d 6500  th.....HurtTime.
00000d0: 0009 0006 4d6f 7469 6f6e 0600 0000 0300  ....Motion......
00000e0: 0000 0000 0000 00bf b412 05c2 8f5c 2900  .............\).
00000f0: 0000 0000 0000 0001 0008 536c 6565 7069  ..........Sleepi
0000100: 6e67 0002 000a 4174 7461 636b 5469 6d65  ng....AttackTime
0000110: 0000 0200 0a53 6c65 6570 5469 6d65 7200  .....SleepTimer.
0000120: 0002 0003 4169 7201 2c00                 ....Air.,.

Server Startup Script

See Minecraft Startup Script

Bypassing the Auth server

Minecraft SMP, bypassing the Auth server - http://william.hogman.me/2010/10/03/MineHx.html

getversion.jsp:

2:ignorethis:<?php echo $_POST['user']; ?>:<?php echo rand(10,10000); ?>

joinserver.jsp:

ok

checkserver.jsp:

YES

Seed

Seed (Level Generation) - Minecraft Wiki - http://www.minecraftwiki.net/wiki/Random_seed

seedscope.net › minecraft level tools - http://seedscope.net/ (was http://mc.42nex.us/)

Awesome Seeds:

  • Glacier - towering towers
  • -1784338777788894343 - collassal arches caves
  • -6849886422920757622 - kenneth hills

Server Icon

Create a 64x64 PNG image called "server-icon", and place in the server folder.

server-icon

ref: [4]

Java 16

As of 2021 need Java 16:

add-apt-repository ppa:linuxuprising/java
apt install oracle-java16-installer

keywords