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

Solved help with running plugin!

Comments in 'Plugin Development' started by HotFireyDeath, Mar 28, 2015.

  1. HotFireyDeath
    Offline

    HotFireyDeath Notable Member Plugin Developer

    Joined:
    Mar 19, 2015
    Posts:
    328
    Plugins:
    1
    Minecraft User:
    HotFireyDeath
    I'm new at plugin development, so I'd appreciate if someone can please help me!
    This is exactly what prints in the terminal:

    Code:
    19:23:29[INFO] Starting Minecraft: PE server version v0.10.5 alpha
    19:23:29[INFO] Loading pocketmine.yml...
    19:23:29[INFO] Loading server properties...
    19:23:29[INFO] Starting Minecraft PE server on 0.0.0.0:19132
    19:23:29[INFO] This server is running PocketMine-MP version 1.4.1-980 "絶好(Zekkou)ケーキ(Cake)" (API 1.11.0)
    19:23:29[INFO] PocketMine-MP is distributed under the LGPL License
    19:23:29[INFO] Loading DevTools v1.10.0
    19:23:29[INFO] Enabling DevTools v1.10.0
    19:23:29[INFO] Loading source plugin MyPlugin v1.0.0
    19:23:29[WARNING] RuntimeException: "Couldn't load source plugin MyPlugin: main class not found" (E_USER_WARNING) in "/DevTools_v1.10.0-902ce885.phar/src/FolderPluginLoader/FolderPluginLoader" at line 70
    19:23:29[INFO] Disabling DevTools v1.10.0
    19:23:29[INFO] Preparing level "world"
    19:23:30[INFO] Starting GS4 status listener
    19:23:30[INFO] Setting query port to 19132
    19:23:30[INFO] Query running on 0.0.0.0:19132
    19:23:30[INFO] Default game type: SURVIVAL
    19:23:30[INFO] Done (0.592s)! For help, type "help" or "?"
    Can someone please explain to me what is going wrong, and maybe what to do to fix this?
  2. Angelo Vidrio
    Offline

    Angelo Vidrio Active Member Plugin Developer

    Joined:
    Jan 16, 2014
    Posts:
    123
    Plugins:
    5
    Minecraft User:
    LilCrispy45
    Check your plugin.yml and make sure that the "main:" is the directory that your main.php is in. EX:
    Code:
    name: MyPlugin
    author: LilCrispy2o9/Angelo Vidrio
    description: Show how to configure a plugin.yml
    version: 1.0.0
    main: MyPlugin\Main  #<--------This is the "main:" directory
    api: [1.10.0]
    so in your plugin folder, open up your src folder. If there is another folder in src, put that folder name in the "main:" directory in plugin.yml. So if there is a folder in src named "Plugin1" that contains your main.php, your plugin.yml should look like
    Code:
    name: MyPlugin
    author: LilCrispy2o9/Angelo Vidrio
    description: Show how to configure a plugin.yml
    version: 1.0.0
    main: Plugin1\Main  #<--------
    api: [1.10.0]
    HotFireyDeath likes this.
  3. HotFireyDeath
    Offline

    HotFireyDeath Notable Member Plugin Developer

    Joined:
    Mar 19, 2015
    Posts:
    328
    Plugins:
    1
    Minecraft User:
    HotFireyDeath
    It would either be that I don't understand, or that I'm still doing it wrong.
    Here is a diagram of my directory (starting from the plugins folder):
    [​IMG]
    and here is my plugin.yml code:
    Code:
    name: MyPlugin
    main: src\appletCore\MyPlugin\MyPlugin.php
    version: 1.0.0
    api: 1.0.0
    
    would you be able to provide a little bit of a more specific detail? Thank you!
  4. MCPEPIG
    Offline

    MCPEPIG Notable Member

    Joined:
    Jun 22, 2014
    Posts:
    349
    Minecraft User:
    MCPEPIG
    Make the main appletCore/MyPlugn/MyPlugin
  5. Samueljh1
    Offline

    Samueljh1 Active Member Plugin Developer

    Joined:
    Jan 9, 2015
    Posts:
    316
    Plugins:
    5
    Minecraft User:
    Samueljh1_
    PHP uses '\' not '/'. Do:

    PHP:
    nameMyPlugin
    author
    ChopStickSoft #Credit :P
    mainappletCore\MyPlugin\MyPlugin.php
    version
    1.0.0
    api
    1.0.0
    PocketKiller, EvolSoft, xiaoq and 2 others like this.
  6. xiaoq
    Offline

    xiaoq Active Member

    Joined:
    Dec 23, 2014
    Posts:
    232
    Minecraft User:
    xiaoq
    have some error in main class
  7. MCPEPIG
    Offline

    MCPEPIG Notable Member

    Joined:
    Jun 22, 2014
    Posts:
    349
    Minecraft User:
    MCPEPIG
    Forgot about that lol
  8. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    No .php lol
    Why does everyone get it wrong :D
    Also you have to declare namespace appletCore\MyPlugin in your PHP file and name the class MyPlugin
  9. Samueljh1
    Offline

    Samueljh1 Active Member Plugin Developer

    Joined:
    Jan 9, 2015
    Posts:
    316
    Plugins:
    5
    Minecraft User:
    Samueljh1_
    lol.
  10. HotFireyDeath
    Offline

    HotFireyDeath Notable Member Plugin Developer

    Joined:
    Mar 19, 2015
    Posts:
    328
    Plugins:
    1
    Minecraft User:
    HotFireyDeath
    Ok, ok. The plugin finally works! Thanks guys!
    Last edited: May 6, 2016
    xiaoq likes this.

Share This Page

Advertisement