Skip to content

Instantly share code, notes, and snippets.

@unitycoder
Last active October 31, 2023 22:56
Show Gist options
  • Save unitycoder/8ef8a5b73f57e6504f160abd305c5093 to your computer and use it in GitHub Desktop.
Save unitycoder/8ef8a5b73f57e6504f160abd305c5093 to your computer and use it in GitHub Desktop.
Install MineCraft Forge & Mods on Centos Linux (command line)
// =============================================================================
// INSTALL PLUGINS * client can use vanilla minecraft
//Download CraftBukkit
https://getbukkit.org/download/craftbukkit
//Copy and run it on server
java -Xmx2048M -Xms2048M -jar craftbukkit-1.10.2-R0.1-SNAPSHOT.jar -o true
// Add bukkit plugins
https://mods.curse.com/bukkit-plugins/minecraft
// For example Tree Cut plugin
https://dev.bukkit.org/bukkit-plugins/timber/
// Download and copy to plugins/ folder
// after first run can edit Timber/config.yml file for settings
// permissions
https://github.com/SpigotMC/SpigotCraft/blob/master/plugins/PermissionsEx/permissions.yml
// ====================================================================
// creating startup script
create file run.sh
chmod +x run.sh
// add contents
java -Xmx4096M -Xms2048M -jar craftbukkit-1.10.2-R0.1-SNAPSHOT.jar -o true
pause
// run script with
./run.sh
// keep minecraft server running after closing SSH/Putty
screen
run.sh
CTRL+A+D
// now can close console
// How to stop running minecraft
screen -r
CTRL+C
// ====================================================================
// INSTALL MINECRAFT FORGE ON CENTOS, FROM PUTTY COMMAND LINE
( you have minecraft vanilla server installed already : https://minecraft.net/en/download/server )
//download minecraft forge .jar and copy it to your server minecraft/ folder
http://files.minecraftforge.net/
http://www.minecraftforge.net/forum/index.php/topic,40486.0.html
// run installer
java -jar minecraftforge-installer.jar --installServer
// you can now delete the installer jar if want to
// now run forge minecraft
java -Xmx2048M -Xms2048M -jar forge-1.10.2-12.18.1.2011-universal.jar nogui
// INSTALL MODS *** MODS REQUIRE CLIENT TO INSTALL THE MOD ALSO ***
// Tree Chopper Mod *Requires client to have FML Forge mod..
http://minecraftsix.com/tree-chopper-mod/
Download and copy to mods/ folder
yum install nano
yum install screen
cd ~
mkdir mc
cd mc
touch run.sh
chmod +x run.sh
// java and git
sudo yum install git java-1.8.0-openjdk-devel
// buildtools
wget -O BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
git config --global --unset core.autocrlf
java -jar BuildTools.jar
// update run.sh with new filename
echo "java -Xmx2048M -Xms2048M -jar spigot-1.16.3.jar -o true" > run.sh
// run
screen
run.sh
// first time, set eula value true (save ctrl+x)
nano eula.txt
// CTRL+A+D
- check os version/type: cat /etc/*release
- update yum: sudo yum update
- check java version: java -version
- install wget/curl: sudo yum -y install wget curl
- download java: wget https://download.java.net/java/GA/jdk17.0.2/dfd4a8d0985749f896bed50d7138ee7f/8/GPL/openjdk-17.0.2_linux-x64_bin.tar.gz
- extract: tar xvf openjdk-17.0.2_linux-x64_bin.tar.gz
- move: sudo mv jdk-17.0.2/ /opt/jdk-17/
- add dirs: nano ~/.bashrc
export JAVA_HOME=/opt/jdk-17
export PATH=$PATH:$JAVA_HOME/bin
- ???: source ~/.bashrc
- check path: echo $JAVA_HOME
- check version: java --version
- https://sysadminxpert.com/steps-to-upgrade-java-8-to-java-11-on-centos-7/#Steps_to_Upgrade_Java_8_to_Java_11_on_CentOS_7
- https://techviewleo.com/install-java-openjdk-on-rocky-linux-centos/
- if wrong java version, move old one out: which java
/usr/bin/java
- mv /usr/bin/java /usr/bin/javaold
- java -version, now prints 18
- now can build: java -jar BuildTools.jar --rev latest
### ERRRORS
java --version
Unrecognized option: --version
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
its "java -version" for 1.8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment