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

Solved Whats wrong?

Comments in 'Plugin Development' started by YanSoo, Sep 14, 2016.

  1. Jazzwhistle
    Offline

    Jazzwhistle Notable Member

    Joined:
    Dec 27, 2014
    Posts:
    364
    Minecraft User:
    Awzaw
    The error messages (almost) always give you the information you need... one of the first things to learn when coding anything is what they mean. When you see a message about a missing or incompatible function, you check the spelling, syntax, imports etc for that function... If it says a variable is nul you figure out why by examining your code up to that point, and maybe use echo or var_dump if it's not obvious to display the variable at different points in your code etc.
    Primus likes this.
  2. YanSoo
    Offline

    YanSoo New Member

    Joined:
    Apr 28, 2016
    Posts:
    23
    Minecraft User:
    YanSoo
    So I forgot to add these?
    Code:
    use pocketmine\command\Command;
    Use pocketmine\command\CommandSender
    AGAIN LIKE I DID IN THE FIRST VERSION OF MY CODE
  3. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    Stop. Learn PHP and OOP basics before you do anything else. Learning only the API and reading code is no use if you don't process them. Never copy what you DON'T understand.
    Gamecrafter and Muqsit like this.
  4. Muqsit
    Offline

    Muqsit Active Member

    Joined:
    Sep 9, 2015
    Posts:
    175
    Minecraft User:
    Muqsit
    Don't code to learn, learn to code.
  5. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    learning code through coding works, if you are willing to actually think about every single piece of the code
    Gamecrafter and Primus like this.
  6. YanSoo
    Offline

    YanSoo New Member

    Joined:
    Apr 28, 2016
    Posts:
    23
    Minecraft User:
    YanSoo
    I do know HOW to code... a website... so I need to learn the pocketmine API. Websites and plugins aren't the same thing
  7. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    Why a 0 in onCommand? And btw functions may never start with a number, the same on variables
    Last edited: Sep 17, 2016
  8. YanSoo
    Offline

    YanSoo New Member

    Joined:
    Apr 28, 2016
    Posts:
    23
    Minecraft User:
    YanSoo
    The 0 in onCommand is just a thing so it looks like a zero but actually is not because when I posted my post it came out as ::eek:ncommand
  9. YanSoo
    Offline

    YanSoo New Member

    Joined:
    Apr 28, 2016
    Posts:
    23
    Minecraft User:
    YanSoo
    Am I allowed to post this?
    -------------------------------
    If anyone is nice enough to make a pull request with the corrections of this plugin... I will learn from my mistakes... and I'll be very grateful
    https://github.com/YanSoo123/InfoPlugin
    ------------------------------
    BTW if I'm not allowed to post this pls tell me...
  10. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    Yes, you are right. coding a website and coding a plugin is different. But you only know how to code a website, not a plugin. Right now you are attempting to write a plugin without learning the basics of PHP first. HTML is not PHP. If you don't even know how to read your own error and attempt to fix your own problem, how are you going to learn OOP? If you don't know how OOP works, how are you going to write a plugin? You seem to be stuck on the syntax part of PHP right now. Don't try to climb a cliff you know is too tall for you, because you're only setting yourself up for failure. Instead, climb a smaller cliff. And then from that cliff, climb up until you reach another one. And so on. You'll eventually reach that tall cliff. Take it step-by-step. Don't take lunges.
  11. YanSoo
    Offline

    YanSoo New Member

    Joined:
    Apr 28, 2016
    Posts:
    23
    Minecraft User:
    YanSoo
    I just had a wrong class name and some a spelling mistake thx...
  12. YanSoo
    Offline

    YanSoo New Member

    Joined:
    Apr 28, 2016
    Posts:
    23
    Minecraft User:
    YanSoo
    What API does this plugin go in? 2.0.0 or 1.13.0? Or do I decide...
  13. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Your code would work in any new API (1.0.0 - 2.0.0) Basically yes, you decide.
  14. YanSoo
    Offline

    YanSoo New Member

    Joined:
    Apr 28, 2016
    Posts:
    23
    Minecraft User:
    YanSoo
    Issue resolved. Thank you to all the people who helped.

Share This Page

Advertisement