Config Boolean, returning true.

Discussion in 'Plugin Development' started by BuzzSmooth, Apr 21, 2015.

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

    BuzzSmooth

    Plugin is only returning true.

    If I change it to false, save it, and restart the plugin, it continues to be true.

    Code:
      @EventHandler
      public void onKill(EntityDeathEvent e)
      {
        if ((e.getEntity() instanceof Player))
        {
          Player m = (Player)e.getEntity();
          if ((m.getKiller() instanceof Player))
          {
            Player p = m.getKiller();
           
            giveXPP(p, 1);
          }
        }
       if (getConfig().getBoolean("PuntosMobs")) {
        if ((e.getEntity() instanceof Monster))
        {
          Monster m = (Monster)e.getEntity();
          if ((m.getKiller() instanceof Player))
          {
            Player p = m.getKiller();
           
            giveXPZ(p, 1);
          }
        }
        }
    }
     
  2. Offline

    SuperOriginal

    Show your config
     
  3. Offline

    BuzzSmooth

    @SuperOriginal
    HTML:
    #Variable de jugador
    # %PLAYER% = Nombre del jugador
    PuntosMobs: true
    Ajustes:
    NOVIPAnimales: "&7* Para ganar mas rapido &bCoins &7hazte &6VIP &7y reciviras el &cx2 &7 *"
    NOVIPPersona: "&7* Para ganar mas rapido &bCoins &7hazte &6VIP &7y reciviras el &cx2 &7 *"
    Rankx5: ""
    Rankx4: "&c&oEl siguiente nivel cuenta con &nx5 XP"
    Rankx3: "&c&oEl siguiente nivel cuenta con &nx4 XP"
    Rankx2: "&c&oEl siguiente nivel cuenta con &nx3 XP"
    #Los puntos se iran multiplicando desde x2 hasta x5 dependiendo del permiso
    Puntos:
      Mobs: 3
      Personas: 9
     
    Last edited: Apr 21, 2015
  4. Offline

    SuperOriginal

    Are you sure you're correctly saving and reloading the config.yml in the data folder?
     
  5. Si necesitas ayuda en espaƱol dimelo
     
  6. Offline

    nj2miami

    @BuzzSmooth - Are you just changing it in your source code or are you editing the server config.yml?
     
  7. Offline

    Zombie_Striker

    Its "Puntos.Mob" What you are looking for in the config before was something like
    Code:
    PuntosMobs: 3
    ,But "Puntos" is one directory, and Mobs are another. The '.' is a separator for the config.


    [Edit], Just reread the config, overlooked that one section.
     
    Last edited: Apr 21, 2015
  8. Offline

    SuperOriginal

    @Zombie_Striker The OP is looking for the Boolean, not that configuration section.
     
  9. Offline

    Zombie_Striker

    Maybe try making a check for it
    Code:
    if(!getConfig().contains("PuntosMobs")){
    getConfig().set("PuntosMobs",true);
    }
    //The boolean check
    Also, use an else statement. I'm guessing Player is not also a Monster, so why have them both be checked.
     
Thread Status:
Not open for further replies.

Share This Page