Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package fr.minigame.black;
- import org.bukkit.Bukkit;
- import org.bukkit.Location;
- import org.bukkit.World;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.configuration.file.FileConfiguration;
- import org.bukkit.entity.Player;
- import org.bukkit.event.Listener;
- import org.bukkit.plugin.java.JavaPlugin;
- public class Main extends JavaPlugin implements Listener{
- public void onEnable(){
- getConfig().options().copyDefaults(true);
- saveDefaultConfig();
- }
- private FileConfiguration config;
- public boolean onCommand(CommandSender sender, Command command, String name, String[] args){
- Player p = (Player) sender;
- if(name.equalsIgnoreCase("minigame")){
- if(args.length == 0){
- p.sendMessage("§cVous n'avez pas mis d'argument");
- }else{
- if(args[1].equalsIgnoreCase("lobby")){
- p.sendMessage("Vous avez été téléporté au lobby !");
- int x = config.getInt("Locations.lobby.x");
- int y = config.getInt("Locations.lobby.y");
- int z = config.getInt("Locations.lobby.z");
- String world0 = config.getString("Locations.lobby.world");
- World world = Bukkit.getWorld(world0);
- p.teleport(new Location(world, x, y, z));
- }
- }
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment