51工具盒子

依楼听风雨
笑看云卷云舒,淡观潮起潮落

我的世界java服务器搭建mod(forge)服务器(windows)

前期准备 {#前期准备}

  • 一台服务器(或者有公网ip的电脑,ipv6也行)
  • 准备好原版的服务端server
  • 准备好forge的服务器端
  • 准备好远程连接工具(可以使用Windwos自带的远程桌面)
  • 安装Java环境

本次安装以1.18.2为例来进行搭建

连接上服务器 {#连接上服务器}

我们在Windows开始按钮中的Windows附件 中找到远程桌面
远程桌面连接.png
我们可以左键长按把他拖到桌面方便快捷连接到服务器
计算机名称就是服务器的IP地址 ,默认的用户名是Administrator,密码写自己设置的密码(阿里云的服务器在创建完Windows系统后需要手动设置密码),在连接上服务器后,后续操作都可以在服务器上完成,在服务器上打开本文章进行下面的操作。

安装Java环境 {#安装Java环境}

在搭建我的世界服务器之前要先安装好对应的Java环境

  • 1.7- 推荐Java8
  • 1.8+推荐Java8/11
  • 1.16+推荐Java11/16
  • 1.18+推荐Java17

Java的下载 {#Java的下载}

先前往java官网的下载地址下载对应的版本,本次安装的版本是java17(我的世界1.18.2),我们安装对应的Windows版本就好了(建议安装exe版本)
java17的安装.png
点击安装后会要求登录账号,如果没有账号可以去注册一个,公司什么的可以随便填。
在下载完成后我们直接默认安装就好了,但是要记住我们的安装路径,如果是默认安装的话默认安装在C:\Program Files\java

Java的环境配置 {#Java的环境配置}

在Java安装完成后需要进行环境配置来进行使用
首先右键此电脑打开属性,进入高级系统设置
高级系统设置.png
在里面找到环境变量进行设置,记住我们要修改的地方只有system variables/系统变量 而不是用户变量
java环境变量的地方.png

新建JAVA_HOME 变量 {#新建JAVA-HOME-变量}

输入

|-------------|-----------------------------------------| | 1 2 | 变量名:JAVA_HOME 变量值:电脑上JDK安装的绝对路径 |

java环境变量安装1.png
以java17最新版为例Java的默认为C:\Program Files\java\jdk-17 ,注意文件夹位置是在jdk中而不是java中里面,JDK 路径下必须能够看到如下的文件
java-jdk.png

新建/修改 CLASSPATH 变量 {#新建-修改-CLASSPATH-变量}

如果存在 CLASSPATH 变量,选中点击 Edit(编辑)。
如果没有,点击 New(新建)... 新建。
输入/在已有的变量值后面添加:

|-------------|-------------------------------------------------------------------------------| | 1 2 | 变量名:CLASSPATH 变量值:.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar; |

java环境配置2.png
要注意前面的**.;**不要漏掉了

修改Path 变量 {#修改Path-变量}

由于 win10 的不同,当选中 Path 变量的时候,系统会很方便的把所有不同路径都分开了,不会像 win7 或者 win8 那样连在一起。
新建两条路径:

|-------------|---------------------------------------------| | 1 2 | %JAVA_HOME%\bin %JAVA_HOME%\jre\bin |

java环境变量配置3.png
检查 打开 cmd,输入 java,出现一连串的指令提示,说明配置成功了(可以再试一下javac如果没有报错就正常):
java环境检测.png

我的世界Java版的服务器官方server下载 {#我的世界Java版的服务器官方server下载}

如果玩的是最新版可以直接前往官方地址下载
下载旧版我们可以来到https://launchermeta.mojang.com/mc/game/version_manifest.json 中找到对应的版本来进行下载,如果不会找可在下方寻找对应的版本

|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | 1.2.5 https://launcher.mojang.com/v1/objects/d8321edc9470e56b8ad5c67bbd16beba25843336/server.jar 1.3.1 https://launcher.mojang.com/v1/objects/82563ce498bfc1fc8a2cb5bf236f7da86a390646/server.jar 1.3.2 https://launcher.mojang.com/v1/objects/3de2ae6c488135596e073a9589842800c9f53bfe/server.jar 1.4.2 https://launcher.mojang.com/v1/objects/5be700523a729bb78ef99206fb480a63dcd09825/server.jar 1.4.4 https://launcher.mojang.com/v1/objects/4215dcadb706508bf9d6d64209a0080b9cee9e71/server.jar 1.4.5 https://launcher.mojang.com/v1/objects/c12fd88a8233d2c517dbc8196ba2ae855f4d36ea/server.jar 1.4.7 https://launcher.mojang.com/v1/objects/2f0ec8efddd2f2c674c77be9ddb370b727dec676/server.jar 1.5.1 https://launcher.mojang.com/v1/objects/d07c71ee2767dabb79fb32dad8162e1b854d5324/server.jar 1.5.2 https://launcher.mojang.com/v1/objects/f9ae3f651319151ce99a0bfad6b34fa16eb6775f/server.jar 1.6.1 https://launcher.mojang.com/v1/objects/0252918a5f9d47e3c6eb1dfec02134d1374a89b4/server.jar 1.6.2 https://launcher.mojang.com/v1/objects/01b6ea555c6978e6713e2a2dfd7fe19b1449ca54/server.jar 1.6.4 https://launcher.mojang.com/v1/objects/050f93c1f3fe9e2052398f7bd6aca10c63d64a87/server.jar 1.7.2 https://launcher.mojang.com/v1/objects/3716cac82982e7c2eb09f83028b555e9ea606002/server.jar 1.7.3 https://launcher.mojang.com/v1/objects/707857a7bc7bf54fe60d557cca71004c34aa07bb/server.jar 1.7.4 https://launcher.mojang.com/v1/objects/61220311cef80aecc4cd8afecd5f18ca6b9461ff/server.jar 1.7.5 https://launcher.mojang.com/v1/objects/e1d557b2e31ea881404e41b05ec15c810415e060/server.jar 1.7.6 https://launcher.mojang.com/v1/objects/41ea7757d4d7f74b95fc1ac20f919a8e521e910c/server.jar 1.7.7 https://launcher.mojang.com/v1/objects/a6ffc1624da980986c6cc12a1ddc79ab1b025c62/server.jar 1.7.8 https://launcher.mojang.com/v1/objects/c69ebfb84c2577661770371c4accdd5f87b8b21d/server.jar 1.7.9 https://launcher.mojang.com/v1/objects/4cec86a928ec171fdc0c6b40de2de102f21601b5/server.jar 1.7.10 https://launcher.mojang.com/v1/objects/952438ac4e01b4d115c5fc38f891710c4941df29/server.jar 1.8 https://launcher.mojang.com/v1/objects/a028f00e678ee5c6aef0e29656dca091b5df11c7/server.jar 1.8.1 https://launcher.mojang.com/v1/objects/68bfb524888f7c0ab939025e07e5de08843dac0f/server.jar 1.8.2 https://launcher.mojang.com/v1/objects/a37bdd5210137354ed1bfe3dac0a5b77fe08fe2e/server.jar 1.8.3 https://launcher.mojang.com/v1/objects/163ba351cb86f6390450bb2a67fafeb92b6c0f2f/server.jar 1.8.4 https://launcher.mojang.com/v1/objects/dd4b5eba1c79500390e0b0f45162fa70d38f8a3d/server.jar 1.8.5 https://launcher.mojang.com/v1/objects/ea6dd23658b167dbc0877015d1072cac21ab6eee/server.jar 1.8.6 https://launcher.mojang.com/v1/objects/2bd44b53198f143fb278f8bec3a505dad0beacd2/server.jar 1.8.7 https://launcher.mojang.com/v1/objects/35c59e16d1f3b751cd20b76b9b8a19045de363a9/server.jar 1.8.8 https://launcher.mojang.com/v1/objects/5fafba3f58c40dc51b5c3ca72a98f62dfdae1db7/server.jar 1.8.9 https://launcher.mojang.com/v1/objects/b58b2ceb36e01bcd8dbf49c8fb66c55a9f0676cd/server.jar 1.9 https://launcher.mojang.com/v1/objects/b4d449cf2918e0f3bd8aa18954b916a4d1880f0d/server.jar 1.9.1 https://launcher.mojang.com/v1/objects/bf95d9118d9b4b827f524c878efd275125b56181/server.jar 1.9.2 https://launcher.mojang.com/v1/objects/2b95cc7b136017e064c46d04a5825fe4cfa1be30/server.jar 1.9.3 https://launcher.mojang.com/v1/objects/8e897b6b6d784f745332644f4d104f7a6e737ccf/server.jar 1.9.4 https://launcher.mojang.com/v1/objects/edbb7b1758af33d365bf835eb9d13de005b1e274/server.jar 1.10 https://launcher.mojang.com/v1/objects/a96617ffdf5dabbb718ab11a9a68e50545fc5bee/server.jar 1.10.1 https://launcher.mojang.com/v1/objects/cb4c6f9f51a845b09a8861cdbe0eea3ff6996dee/server.jar 1.10.2 https://launcher.mojang.com/v1/objects/3d501b23df53c548254f5e3f66492d178a48db63/server.jar 1.11 https://launcher.mojang.com/v1/objects/48820c84cb1ed502cb5b2fe23b8153d5e4fa61c0/server.jar 1.11.1 https://launcher.mojang.com/v1/objects/1f97bd101e508d7b52b3d6a7879223b000b5eba0/server.jar 1.11.2 https://launcher.mojang.com/v1/objects/f00c294a1576e03fddcac777c3cf4c7d404c4ba4/server.jar 1.12 https://launcher.mojang.com/v1/objects/8494e844e911ea0d63878f64da9dcc21f53a3463/server.jar 1.12.1 https://launcher.mojang.com/v1/objects/561c7b2d54bae80cc06b05d950633a9ac95da816/server.jar 1.12.2 https://launcher.mojang.com/v1/objects/886945bfb2b978778c3a0288fd7fab09d315b25f/server.jar 1.13 https://launcher.mojang.com/v1/objects/d0caafb8438ebd206f99930cfaecfa6c9a13dca0/server.jar 1.13.1 https://launcher.mojang.com/v1/objects/fe123682e9cb30031eae351764f653500b7396c9/server.jar 1.13.2 https://launcher.mojang.com/v1/objects/3737db93722a9e39eeada7c27e7aca28b144ffa7/server.jar 1.14 https://launcher.mojang.com/v1/objects/f1a0073671057f01aa843443fef34330281333ce/server.jar 1.14.1 https://launcher.mojang.com/v1/objects/ed76d597a44c5266be2a7fcd77a8270f1f0bc118/server.jar 1.14.2 https://launcher.mojang.com/v1/objects/808be3869e2ca6b62378f9f4b33c946621620019/server.jar 1.14.3 https://launcher.mojang.com/v1/objects/d0d0fe2b1dc6ab4c65554cb734270872b72dadd6/server.jar 1.14.4 https://launcher.mojang.com/v1/objects/3dc3d84a581f14691199cf6831b71ed1296a9fdf/server.jar 1.15 https://launcher.mojang.com/v1/objects/e9f105b3c5c7e85c7b445249a93362a22f62442d/server.jar 1.15.1 https://launcher.mojang.com/v1/objects/4d1826eebac84847c71a77f9349cc22afd0cf0a1/server.jar 1.15.2 https://launcher.mojang.com/v1/objects/bb2b6b1aefcd70dfd1892149ac3a215f6c636b07/server.jar 1.16 https://launcher.mojang.com/v1/objects/a0d03225615ba897619220e256a266cb33a44b6b/server.jar 1.16.1 https://launcher.mojang.com/v1/objects/a412fd69db1f81db3f511c1463fd304675244077/server.jar 1.16.2 https://launcher.mojang.com/v1/objects/c5f6fb23c3876461d46ec380421e42b289789530/server.jar 1.16.3 https://launcher.mojang.com/v1/objects/f02f4473dbf152c23d7d484952121db0b36698cb/server.jar 1.16.4 https://launcher.mojang.com/v1/objects/35139deedbd5182953cf1caa23835da59ca3d7cd/server.jar 1.16.5 https://launcher.mojang.com/v1/objects/1b557e7b033b583cd9f66746b7a9ab1ec1673ced/server.jar 1.17 https://launcher.mojang.com/v1/objects/0a269b5f2c5b93b1712d0f5dc43b6182b9ab254e/server.jar 1.17.1 https://launcher.mojang.com/v1/objects/a16d67e5807f57fc4e550299cf20226194497dc2/server.jar 1.18 https://launcher.mojang.com/v1/objects/3cf24a8694aca6267883b17d934efacc5e44440d/server.jar 1.18.1 https://launcher.mojang.com/v1/objects/125e5adf40c659fd3bce3e66e67a16bb49ecc1b9/server.jar 1.18.2 https://launcher.mojang.com/v1/objects/c8f83c5655308435b3dcf03c06d9fe8740a77469/server.jar |

在下载完成之后会获得一个名为server的文件这时我们要将他改为minecraft_server.1.18.2 这样的格式以便forge的服务器端能够识别,将后面的版本号更改为对应的就好了(如果直接拿这个server文件来开原版生存也行)。
将文件放到一个要用来存放服务器文件的文件夹中

forge的下载与安装 {#forge的下载与安装}

forge的下载 {#forge的下载}

来到forge的官网找到要下载的对应版本,将鼠标移动到下载按钮上右键复制连接
forge的安装.png
以1.18.2为例子在复制完连接之后回得到一下内容

|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 1 | https://adfoc.us/serve/sitelinks/?id=271228&url=https://maven.minecraftforge.net/net/minecraftforge/forge/1.18.2-40.2.10/forge-1.18.2-40.2.10-installer.jar |

我们可以看到复制到的连接里面有两个https我们只需要将=号和=前面这一串https删除就能得到forge的下载地址不用看广告

|-------------|-------------------------------------------------------------------------------------------------------------------------------------------| | 1 2 | 删除后变成如下连接,粘贴到导航栏中回车就好 https://maven.minecraftforge.net/net/minecraftforge/forge/1.18.2-40.2.10/forge-1.18.2-40.2.10-installer.jar |

forge的安装 {#forge的安装}

在下载完forge后进行安装,安装选择Install server 进行安装,安装地址修改到之前放server文件的位置
forge安装.png
等待安装完成后,会生成一个run.bat的文件双击运行完成后会生成一个名为eula.txt的文件打开,将里面的eula=false改为eula=true
在更改完后再次双击运行服务器就成功启动成功
服务器运行成功.png
使用stop关闭,下次要打开直接双击run.bat就好了

mod的添加 {#mod的添加}

将要添加的mod放到文件夹中的mods中,重新启动我的世界服务器就好了

后记 {#后记}

如果想要费正版用户进入服务器的话将server.properties的online-mode=true改为online-mode=falsh就好

赞(1)
未经允许不得转载:工具盒子 » 我的世界java服务器搭建mod(forge)服务器(windows)