- 版权类型
- 转载
- 插件中文名称
- 虚拟主机命令插件
- 插件英文名称
- Virtual Host Command Plugin
- 支持的核心
- Bukkit
- Spigot
- Paper
- Purpur
- 其他Spigot下游
- 其他Paper下游
- 资源语言
- 英语
- 其他
- 支持版本(Java)
- 1.20
- 1.21
- 开源许可证
- 保留所有权益/无许可证
支持信息
Minecraft版本:1.21–1.21.8, 1.20.2–1.20.6支持平台:Bukkit, Paper, Spigot
简介
有没有想过为同一个 Minecraft/Bukkit 服务器拥有不同的域/子域,并且根据玩家加入的域提供不同的设置?这个插件有点像 Apache 虚拟主机,用于 Minecraft 服务器详细描述
Bukkit/Minecraft 的虚拟主机命令插件
有没有想过为同一个 Minecraft/Bukkit 服务器拥有不同的域/子域,并且根据玩家加入的域提供不同的设置?这个插件有点像 apache 虚拟主机,检测玩家使用的 Minecraft 服务器的主机名 (CNAME)。您可以根据主机名配置在加入服务器时要运行的命令。例如,您可以拥有一个具有多元宇宙和子域 hub.example.com 和 pvp.example.com 的服务器,然后根据玩家用于连接到服务器的域将玩家直接发送到中心世界或竞技场世界。# Forward the hostname that the Bedrock client used to connect over to the Java server<br> # This is designed to be used for forced hosts on proxies<br> forward-hostname: true<br>
下面是一个示例,即在具有相同 IP 地址的同一服务器上运行的四个虚拟主机,但通过不同的 CNAME 使用不同的虚拟主机进行访问:
更新 0.9.2
- 小修、清理、内务
- 添加了 ifInWorld 和 ifNotInWorld 条件(请参阅示例配置)
更新 0.9.3
- 小修复
- 添加了虚拟主机的 motd 和图标配置(参见示例配置)
示例配置
请参阅 plugins/VirtualHostCommandPlugin/config.yml 中的 up2date 文件# Example config file for VirtualHostCommand bukkit plugin<br># Location: plugins/VirtualHostCommandPlugin/config.yml<br><br>vhosts:<br> host_example:<br> # the hoostname is matched agains the joining hostname via starts-with, so parts work as well<br> # you can also add the port, sub.domain.com:port<br> # it's mandatory, and always case-insensitive<br> hostname: example.com<br> # (optional) only run if player joined this world(s) <br> ifInWorld: "world_some_regex"<br> # (optional) only run if player did not join this world(s)<br> # if ifInWorld and ifNotInWorld present, they must be both true<br> ifNotInWorld: "world_some_regex"<br> # (optional) MOTD for this vhost<br> # NOTE: this only works if you server implementation returns a hostname in the ping event, many don't :(<br> # for paper-mc we have added a workaround to fetch the vhost hostname pinged via reflection.<br> motd: "some colorfull MOTD server message\nmultiline if you like!"<br> # (optional) server icon filename, format like server-icon.png, same root directory<br> # NOTE: same restrictions as for 'motd' config option apply <br> icon: server-icon-example.png <br> # List of commands to be executed if joining via this hostname <br> commands:<br> # he following placeholders are allowd:<br> # %player% , %hostname% and %port%<br> - some command ...<br> - another cmmand with %player% to replace with player name<br> - msg %player% haha it works from %hostname%<br><br> host_example2:<br> # example with an IP<br> hostname: "123.45.67.89"<br> commands:<br> - some command ...<br> - another cmmand with %player% to replace with player name<br> - msg %player% haha it works<br><br> host_hub:<br> hostname: hub.myworld.com<br> ifNotInWorld: "^world_hub"<br> commands:<br> - gamemode %player% survival<br> - msg %player% crazy shit<br> - mv tp %player% world_hub
见 https://github.com/cgaffga/mc-vhost/tree/main/docs