Guest User

Untitled

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