OBSOLETE WITH V2. Please see https://lualink.github.io/docs/dependencies/ for using external plugins.
The Bungee addon provides functionality to send players from one server to another using LuaLink. This functionality is particularly useful for networked Minecraft servers running on platforms like Bungeecord, Waterfall, or Velocity.
-
Importing the Addon:
To use the Bungee addon, first obtain the addon instance:
local Bungee = addons.get("Bungee")
-
Sending a Player to Another Server:
Use the
sendPlayer
function to teleport a player to another server:Bungee.sendPlayer(playerObject, "SERVER_NAME")
Replace
"SERVER_NAME"
with the target server's name where you want to send the player.
- Velocity: For Velocity support, ensure that Bungee messaging channels are enabled in the Velocity configuration.
Here's a simple example demonstrating how to send a player to another server:
-- Import the Bungee addon
local Bungee = addons.get("Bungee")
script.registerSimpleCommand(function(sender, args)
if not utils.instanceOf(sender, "org.bukkit.entity.Player") then
sender:sendRichMessage("<red>This command can only be ran by a player!")
end
Bungee.sendPlayer(sender, "Hub") -- Sends the sender to a server with the name "Hub"
end, {
name = "hub"
})