Commands, reading from a .yml

Discussion in 'Plugin Development' started by MuisYa, Aug 2, 2011.

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

    MuisYa

    Hello all :3
    I need some help with a command which withdraws information from a .yml file.
    What my plugin does is when a player places a piston, it will write a 1 behind his name.
    WHen you place another one, 2 and so on.

    What i want is when a admin, so with permissions (I can fix that myself) types ''/PistonAlert Name'' the plugin will search for the player ''Name'' in the .yml and returns a amount.

    Can someone please help me with this, i can send him all my classes :3
    Thanks!

    No one? There must be a pro developer :3

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  2. Offline

    Nitnelave

    Well, bukkit has a pretty good configuration API. You could create a file, then a new Configuration(file).
    From there, all you have to do is :
    to read : config.getInteger(playername);
    to write : config.setProperty(playername, count);
     
  3. Offline

    MuisYa

    Ill try this API, thanks :D
     
Thread Status:
Not open for further replies.

Share This Page