Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. package fr.hub.black;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.GameMode;
  5. import org.bukkit.Location;
  6. import org.bukkit.Material;
  7. import org.bukkit.World;
  8. import org.bukkit.command.Command;
  9. import org.bukkit.command.CommandExecutor;
  10. import org.bukkit.command.CommandSender;
  11. import org.bukkit.configuration.file.FileConfiguration;
  12. import org.bukkit.entity.Player;
  13. import org.bukkit.inventory.ItemStack;
  14. import org.bukkit.inventory.PlayerInventory;
  15.  
  16. public class hub implements CommandExecutor {
  17.  
  18. private FileConfiguration config;
  19. private Main pl;
  20.  
  21. public hub(Main main){
  22. this.pl = main;
  23. this.config = pl.getConfig();
  24.  
  25. }
  26.  
  27.  
  28. public hub() {
  29. // TODO Auto-generated constructor stub
  30. }
  31.  
  32.  
  33. @Override
  34. public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
  35. if(sender instanceof Player){
  36. Player player = (Player) sender;
  37. int x = config.getInt("locations.x.");
  38. int y = config.getInt("locations.y.");
  39. int z = config.getInt("locations.z.");
  40. String monde = config.getString("World.");
  41. World world = Bukkit.getWorld(monde);
  42. player.sendMessage("coucou");
  43. player.teleport(new Location(world, x, y, z));
  44. PlayerInventory pi = player.getInventory();
  45. player.sendMessage("Salut"+x+y+z);
  46. player.getInventory().clear();
  47. pi.addItem(new ItemStack(Material.DIAMOND));
  48. player.setGameMode(GameMode.CREATIVE);
  49. config.set("locations.x", x);
  50.  
  51.  
  52.  
  53. }
  54. return false;
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement