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

Inspiration How to start learning writing plugins

Comments in 'Resources' started by PEMapModder, Feb 8, 2014.

  1. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Do you learn maths by reciting this table?
    No you don't. They just teach you how to find out these equations.

    And I am only teaching you how to learn, how to find out API functions; not to teach you every API function.
  2. TrueBaccaAli
    Offline

    TrueBaccaAli Active Member

    Joined:
    Apr 6, 2015
    Posts:
    71
    Yes, you do have a point but it would be nice if you did a comprehensive and larger guide on creating plugins for PocketMine.
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Well, I plan to but don't have time.
  4. TrueBaccaAli
    Offline

    TrueBaccaAli Active Member

    Joined:
    Apr 6, 2015
    Posts:
    71
    I suggest you to tell a staff member to junk this thread if you're going to make a better and more comprehensive tutorial than this one because this is not detailed or written properly. This doesn't cover the main concept of coding plugins, and coding in general. What if I'm a beginner and I don't know how to code or anything like that? You should have a introduction for new programmers; cover what a programming language is, what it's used for and all of that stuff. I want to learn how to make a Pocket Mine plugin in PHP but I don't know PHP and how to code in PHP, not to mention that you don't explain what this specific line of code does, you just tell us to basically copy and paste this line of code or whatever without knowing its true purpose and meaning. Overall you did a great effort on this tutorial but I feel that you could've done so, so, so much more. Just my thoughts OP.
    Last edited: Apr 9, 2015
    joshuac666, Falk and PEMapModder like this.
  5. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Indeed. A forum post is not a good place for writing these.
  6. joshuac666
    Offline

    joshuac666 New Member

    Joined:
    Apr 15, 2015
    Posts:
    18
    Minecraft User:
    joshuac68
    This tutorial made no sense to me, someone who has no background in programming...
  7. aliuly
    Offline

    aliuly Notable Member Plugin Developer

    Joined:
    Feb 8, 2014
    Posts:
    1,086
    Plugins:
    17
    You kinda need to know PHP first.
    Legoboy0215 likes this.
  8. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    As long as you have a working brain, you don't need to learn PHP at all. Just find the pattern from other plugins.
  9. joshuac666
    Offline

    joshuac666 New Member

    Joined:
    Apr 15, 2015
    Posts:
    18
    Minecraft User:
    joshuac68
    Can you point me to a good plugin a beginner can learn from?
  10. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Try looking for small plugins, which usually means plugins with a small size. Some may work in a wrong way though.

    I have some super simple plugin examples here:
    https://github.com/PEMapModder/PocketMine-Plugin-Tutorials
    joshuac666 likes this.
  11. joshuac666
    Offline

    joshuac666 New Member

    Joined:
    Apr 15, 2015
    Posts:
    18
    Minecraft User:
    joshuac68
    I've checked all of the plugin examples, and the tutorial, the tutorial seems like its going for an audience of begginers who know absolutely no php, but if that's the case it doesn't work, I mean, you didn't even specify that you need to put $ before a variable! Jesus Christ dude! I just wand to make the lives of server owners easier to give them cool and useful plugins, but I can't even find a good tutorial that teaches me the BASICS of php! All I know is that your supposed to put <?php at the begining! And that you can do this: $variable=123 what uses does it have? I don't know! What the fuck is API! What is it, how do I use it, and where do I get it! How can I make a thing where you tap a block and teleport somewhere else!? I don't know!!! Where do I learn php itself without having to have a web server to run the php on!? I do not fucking know! How do I know which file in the pocketmine SRC does what!? I. DO. NOT. KNOOOOOW!!!!
  12. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Please stay calm and watch your own language; language is something how people know you, and having dirty language gives people the impression that you are dirty yourself.

    The tutorial is incompleted and is going to be rewritten. As for the API functions, as I said earlier, read http://jenkins.pocketmine.net/job/PocketMine-MP-Doc/doxygen instead of having someone to teach you. There are so many things that can be done; we can't teach them all one by one. You can either read the docs, browse the PocketMine source code or read other plugins. That's how we all learn.
    As for what API is, API refers to Application Programmer's Interface, i.e. the interface between programmers developing applications (in this case plugins) with the main software and the main software itself's internals. In other words, it provides a layer of convenience for developers to easily get the main software to do something without touching the software's internals. For an anology, a car (the software) has the seats, doors, brakes, etc. for the user (users of the software) to use. However, when the car is being maintained, the engineer (the developers) does not touch the very tiny parts inside the car, like the structure of the engine (the internals of the software). The engineer only manages the engine's exposed pipes, wires, etc. (API) instead. You can read the documentation about the PocketMine API at the jenkins link supplied above.
    About tap-a-block-and-teleport-somewhere-else, what about trying to read the SimpleWarps plugin?
    About running PHP without a web server, PocketMine itself is run in PHP. You should maybe learn how to install PocketMine plugins instead.
    Legoboy0215 likes this.
  13. joshuac666
    Offline

    joshuac666 New Member

    Joined:
    Apr 15, 2015
    Posts:
    18
    Minecraft User:
    joshuac68
    None of your post made any sense whatsoever, please, I beg you, can you make a post on what to learn, how to learn it, where to learn it, all step by step for people who know nothing about php... Please please please, I just want to join this community and have fun, develop cool plugins and help server owners... By biggest objective is to make an voxelsniper plugin... Please, I can't see how anyone can learn how to make a plugin when there's no tutorials to do it... Please :'(...
    PEMapModder likes this.
  14. joshuac666
    Offline

    joshuac666 New Member

    Joined:
    Apr 15, 2015
    Posts:
    18
    Minecraft User:
    joshuac68
    I have two questions: 1. How do I read the code for simplewarp. 2. Im looking at the github link you sent me, and I'm curious, if I want to make a plugin where if I type /myname and in the chat it says "your name is: <name of executor>". How would I do that? I would think it has something to do with pocketmine\entity\human, and the 'public member function " getName () ".' But what else would I need? Its extremely confusing... Also uld I learn php before starting to make plugins, if so, what's the best place to learn (hopefully not a place where I have to have a web server...) And then where am I supposed to learn the functions of the API? Am I supposed to just guess it? I'm seriously confused! Thanks...
  15. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    I started with no tutorials on the new API.
    1 Use DevTools, unphar.com or PEMapModder.zapto.org to decompile the phar.
    2 $sender->sendMessage("Your name is " . $sender->getName() . ".");
  16. joshuac666
    Offline

    joshuac666 New Member

    Joined:
    Apr 15, 2015
    Posts:
    18
    Minecraft User:
    joshuac68
    okay that still doesn't make sense, first of all, how to did you learn how to make that code, second of all what about the fact I want that to happen after I type /myname and also what do I put before it. If you could please do this for me: write a whole php file that allows you to type /myname and it will tell me my username, and do the // thing and explain EVERYTHING about how this is the case, and why this is placed here, and where this class and that function comes from... Please! Please do that for me!
  17. aliuly
    Offline

    aliuly Notable Member Plugin Developer

    Joined:
    Feb 8, 2014
    Posts:
    1,086
    Plugins:
    17
    The problem is that unless you are willing to read other's people code on your own you won't learn. For example for the PocketMine API there are docs and tutorials. The docs are OKish for reference but don't tell you everything. In particular you won't find examples, tutorials on the other hand can tell you how to do certain things but they become quickly out of date.

    I myself would look into other peoples code to see how they do certain things. Also I would look into the PocketMine source to see how certain things are implemented.

    BTW, I use Linux and installed the PHP packages. So that comes with a phar command that let's you do all sort of things.
    PEMapModder likes this.
  18. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Phat is a class, not a command :D
  19. joshuac666
    Offline

    joshuac666 New Member

    Joined:
    Apr 15, 2015
    Posts:
    18
    Minecraft User:
    joshuac68
    PEMapModder, I tried to make a plugin with the small amount of information you gave me, and its on github ( https://github.com/joshuac666/myname ) its basically is a simulation of the file I put in the pocketmine plugins folder, called "myname" but when I run the server on my phone it says "could not load 'MyFirstPlugin'incompatable API" and i have no idea why... Could ya help me please?...
  20. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    The API at plugin.yml should be 1.*.* not 0.*.*

Share This Page

Advertisement