我想知道如何移动播放器的目标服务器,到目前为止我还没有任何代码,但我还没有找到一个供我的Minecraft Server网络的插件。我确实已经有一个名为命令同步的插件,该插件将我的BungeeCord服务器和我的Spigot服务器与sync console bungee send @p tntwars
链接在Vanilla中,其中tntwars
是我的目标服务器。这就是我所知道的,因为插头论坛很可怕,而且无用>
如何将该播放器移至另一台服务器?
来自蹦极插件:
在ServerInfo target = ProxyServer.getInstance().getServerInfo("Hub");
player.connect(target);
来自Spigot插件:
在将示例连接到服务器。(使用Example
是连接到服务器发送命令的播放器时使用的,例如"踢"到服务器(
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Connect");
out.writeUTF("pvp");
//applies to the player you send it to. aka Kick To Server.
Player player = Bukkit.getPlayerExact("Example");
player.sendPluginMessage(this, "BungeeCord", out.toByteArray());
连接到服务器的示例。(当您需要将播放器从网络上的另一台服务器中拉出时使用,应使用小心来确保他们不是中间的或其他任何东西,因为您不一定要拥有播放器的服务器状态上下文(
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("ConnectOther");
out.writeUTF("Example");
out.writeUTF("pvp");
//Any online player at all.
//Aka Pull To Server.
Player player = Iterables.getFirst(Bukkit.getOnlinePlayers(), null);
player.sendPluginMessage(this, "BungeeCord", out.toByteArray());
没有任何在线玩家,您将无法向蹦极发送消息!