Developer Documentation

Setting it up

If you're going to use this for a public plugin and is needed, I recommend doing one of the following:

If you need the plugin to be on the server, add this in your plugin.yml:

      depend:[TransferAPI]
      



Otherwise, add this:

       softdepend:[TransferAPI]
       

Sending a player

package me.me.me;

import me.Wes.transferAPI.API;

public class me {
	

	public boolean onCommand(CommandSender sender, Command cmd, String string, String[] args) {
		if(cmd.getName().equalsIgnoreCase("hub")) {
			Player p = (Player) sender;
			if(p.hasPermission("me.hub")) {
				API.connect(p, "lobby");
			}
		}
		return false;
	}
}

Using the event

package me.me.me;

import me.Wes.transferAPI.API;

public class me {
	
	@EventHandler
	public void onServerSwitch(ServerSwitchEvent e) {
		Player p = e.getPlayer();
		if(p.getServer().equals("lobby")) {
			p.sendMessage(ChatColor.RED + "Teleporting!");
		}
	}
	
}

Comments

Posts Quoted:
Reply
Clear All Quotes