Solved Listing Values that are true

Discussion in 'Plugin Development' started by wadu436, Dec 19, 2013.

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

    wadu436

    Hello people
    I am making a plugin that stops you from killing set mobs.
    i am impelenting a list function now.
    But i get some problems.
    Heres the config:
    Code:
    world:
      creeper: false
      skeleton: false
      spider: false
      zombie: false
      slime: false
      ghast: false
      pigzombie: false
      enderman: false
      cavespider: false
      silverfish: false
      blaze: false
      lavaslime: false
      squid: false
      wolf: false
      witch: false
      bat: true
      pig: true
      sheep: true
      cow: true
      chicken: true
      mushroomcow: true
      ozelot: true
      entityhorse: true
      villager: true
      
    So what i want to do is print every mob that has the true value on the users screen
    Can anyone help me?
     
  2. Offline

    Gater12

    wadu436 Spawn every mob that has the set value to to true or just send them a message that the mob is set to true?
     
  3. Offline

    wadu436

    Yeah, but the players can add more mobs that come with future releases or that arent in the config, and i also want to list those mobs
     
  4. Offline

    Gater12

    wadu436 You're not being very clear on this. Can you explain it more?
     
  5. Offline

    wadu436

    Ok so the players can add more mobs to the config (like giants if they use them)
    so with giants, the config would look like this:
    Code:
    world:
      creeper: false
      skeleton: false
      spider: false
      zombie: false
      slime: false
      ghast: false
      pigzombie: false
      enderman: false
      cavespider: false
      silverfish: false
      blaze: false
      lavaslime: false
      squid: false
      wolf: false
      witch: false
      bat: true
      pig: true
      sheep: true
      cow: true
      chicken: true
      mushroomcow: true
      ozelot: true
      entityhorse: true
      villager: true
      giants: true
    So i also want to list giants if its added to the config
     
  6. Offline

    Gater12

    wadu436
    I'd probably list like this:
    Code:
    disabledmobs:
       - enderman
       - giant
       - etc
    enabledmobs:
       - pig
       - cow
       - sheep
       - creeper
       - etc
    
    You can loop through the lists (enable/disable ones).
     
  7. Offline

    wadu436

    Ok thx for the help i made the command :)
     
Thread Status:
Not open for further replies.

Share This Page