Solved Remove Node from Config.yml

Discussion in 'Plugin Development' started by Jimfutsu, Aug 23, 2014.

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

    Jimfutsu

    Hey guys, I have a problem, I am making a warp plugin, which is based on a config. I have a problem. When players run the command /delwarp (warp), it is supposed to delete the warp. What happens though is that in the config it becomes warpname: {}. I am currently setting the node to null, which is making the node go to {}. Any other way I can completely remove the node?

    Thanks

    - Jim
     
  2. Offline

    ShadowLAX

    Jimfutsu getConfig().set("path", ""); Untested, but I believe it works.
     
  3. Offline

    Jimfutsu

    ShadowLAX

    Will try thanks for the suggestion.
     
  4. Offline

    ulsa

    getConfig().set(path, null); :)
     
  5. Offline

    Jimfutsu

    Apprently I cant edit by post.
    sr: ''

    doing what you said just makes the node a blank string.

    This wont work, as Ive stated bofre, all it does is set it to {}

    sr: {}

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 10, 2016
  6. Offline

    unon1100

    Are you sure? It should work properly. Works fine for me.
    getConfig().set(path, null);
    saveConfig();
     
  7. Offline

    Jimfutsu

    Code:
    Essentials:
      prefix: '[EssentialsRecoded]'
      warps:
        spawn:
          w: world
          x: 0
          y: 0
          z: 0
        t:
          w: world
          x: -135.0331715357019
          y: 66.0
          z: 80.87453850807263
      delay: 3
    
    Before
    Code:
    Essentials:
      prefix: '[EssentialsRecoded]'
      warps:
        spawn:
          w: world
          x: 0
          y: 0
          z: 0
        t: {}
      delay: 3
    
    after

    bump

    Nevermind, unon1100
    You were correct, setting the path to null does work.
    I think I was setting it to a blank string.

    Thanks!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 10, 2016
Thread Status:
Not open for further replies.

Share This Page