Getting Config from subClass

Discussion in 'Plugin Development' started by stamline, Aug 28, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    stamline

    Hello, I am fairly new to coding. And I wonder how I can reach getConfig ( ) from a subclass ? Any suggestions? Or is there any way to get stuff from config file.

    This is the SubClass:
    Code:
    public class Spawn implements CommandExecutor {
    
        @Override
        public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
            if(!(sender instanceof Player)){
                sender.sendMessage("Error");
                return false;
            }
            Player player = (Player) sender;
            if(args.length == 0){
                Location loc = Bukkit.getServer().getWorld()
            }
            return false;
        }
    
    }
    
    Config File:
    Code:
    #Hub
    
    Admins:
        - Babbsson99
        - Schnizel
        - Kebab
        -Notch
    Spawn:
        world: world
        x: 1
        y: 1
        z: 3
     
  2. Offline

    BrickBoy55

    Create an instance in your main class, and call it.
     
  3. Offline

    teej107

Thread Status:
Not open for further replies.

Share This Page