Guest User

Untitled

a guest
Apr 24th, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. package fr.minigame.black;
  2.  
  3. import org.bukkit.Location;
  4. import org.bukkit.World;
  5. import org.bukkit.command.Command;
  6. import org.bukkit.command.CommandSender;
  7. import org.bukkit.entity.Player;
  8. import org.bukkit.event.Listener;
  9. import org.bukkit.plugin.java.JavaPlugin;
  10.  
  11. public class Main extends JavaPlugin implements Listener{
  12. public void onEnable(){
  13. getConfig().options().copyDefaults(true);
  14. saveDefaultConfig();
  15. }
  16.  
  17. public boolean onCommand(CommandSender sender, Command command, String name, String[] args){
  18. Player p = (Player) sender;
  19. if(name.equalsIgnoreCase("minigame")){
  20. if(args.length == 0){
  21. p.sendMessage("§cVous n'avez pas mis d'argument");
  22. }else{
  23. if(args[0].equalsIgnoreCase("lobby")){
  24. p.sendMessage("Vous avez été téléporté au lobby !");
  25. int x = getConfig().getInt("Locations.Lobby.x");
  26. int y = getConfig().getInt("Locations.Lobby.y");
  27. int z = getConfig().getInt("Locations.Lobby.z");
  28. World world = getServer().getWorld(getConfig().getString("Locations.Lobby.World"));
  29. p.teleport(new Location(world, x, y, z));
  30.  
  31.  
  32.  
  33. }
  34. }
  35. }
  36. return false;
  37.  
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment