Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to wright a config and plugin.yml help

Comments in 'Plugin Development' started by MyAJVideo, Jun 21, 2015.

  1. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    I am making a staff list plugin which gives info about the server staffs but I can't test it because I always get this error ( can't find main file ). I also want to add a config with that you can put your staff in but I don't really know how to do it.
    Thank you.

    Attached Files:

  2. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    Read the docs or copy and paste a plugin.yml from a plugin.
  3. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    I did I just don't know how to make the config that's not in the docs
  4. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    Here:
    Code:
    name: PluginNameHere
    description:
    author:
    main: Name\Spacehere\Main
    load: POSTWORLD
    version: 1.0.0
    api: [1.11.0]
    commands:
        cmd1:
            usage: /cmd1
            description: *******
     
  5. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    What it Name? On the Name\Spacehere?
  6. hoyinm14mc
    Offline

    hoyinm14mc Notable Member Plugin Developer

    Joined:
    Jun 4, 2014
    Posts:
    502
    Plugins:
    9
    Minecraft User:
    hoyinm14mc
    Your file structure
  7. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    I tryed it like I did with my plugins before but I get class not loaded ? Class why does it want my class and not my pile?
  8. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    Because you wrote the namespace wrong.
  9. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    Ohh OK I did it without the SRC folder is that wrong ?
  10. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    show me a screen shot.
  11. hoyinm14mc
    Offline

    hoyinm14mc Notable Member Plugin Developer

    Joined:
    Jun 4, 2014
    Posts:
    502
    Plugins:
    9
    Minecraft User:
    hoyinm14mc
    For example if the plugin file structure is
    Code:
    ExamplePlugin/src/hoyinm/ExamplePlugin/MainClass.php
    In plugin.yml, write
    Code:
    name: ExamplePlugin
    main: hoyinm\ExamplePlugin\MainClass
    api: ["1.12.0"]
    version: 0.1
    
    In your main class
    PHP:
    namespace hoyinm\ExamplePlugin;
    Legoboy0215 and MyAJVideo like this.
  12. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    Still won't work please help

    Attached Files:

  13. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    This is the namespace

    Attached Files:

  14. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Please note that staffs is not the plural form of staff. I had fallen into that trap in my English exam. Please don't let me see that again.
  15. Anton Magsino
    Offline

    Anton Magsino Active Member

    Joined:
    Jan 17, 2014
    Posts:
    58
    Minecraft User:
    MinecrafterPH
    You forgot
    PHP:
    use pocketmine\command\Command;
    use 
    pocketmine\command\CommandExecutor;
    Also, use \n to make line breaks, not make a new line.
  16. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    \n = line break recognized by PocketMine for separating message packets
    PHP_EOL = system line separator
    MyAJVideo likes this.
  17. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    But it still says it can't find the phile ?
  18. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    Ups true but I'm long not fineshed but how do I wright the config.yml ? For people to use?
  19. hoyinm14mc
    Offline

    hoyinm14mc Notable Member Plugin Developer

    Joined:
    Jun 4, 2014
    Posts:
    502
    Plugins:
    9
    Minecraft User:
    hoyinm14mc
    Maybe change your main.php to Main.php
  20. DA_Swagnemite
    Offline

    DA_Swagnemite Notable Member Plugin Developer

    Joined:
    Nov 17, 2013
    Posts:
    388
    Plugins:
    7
    Minecraft User:
    DA_SWAGNEMITE
    iksaku, MyAJVideo and HotFireyDeath like this.

Share This Page

Advertisement