1. Skaiz

    Skaiz Active Member

    skaizdoesmc
    MVP+
    Galex GALEX
    Member
    Messages:
    207
    Hey, have you ever wanted to be able to code a Bukkit/Spigot plugin? Don't you know how to? Do you want to learn? This is the right thread for you then! With these 10 easy steps, you can easily code your first plugin!

    Step one - Downloading Software
    I personally prefer you to use Eclipse, if you're not familiar with coding at all, else try IntelliJ.
    1. Go to Eclipse's download page
    Now what you see should be like [​IMG] 2. Click "Get eclipse Neon" or click HERE to download it.
    3. Follow downloader's guides.
    4. Eclipse will prompt you about setting your workspace, I'd suggest you create a new folder called "workspace" and select that.

    Step two - Creating your first project

    1. What you should see is this:
    [​IMG]

    2. Click the button on right top corner.
    [​IMG]

    3. Great! You have found your way to Package explorer!

    4. Create new Java project
    [​IMG]

    5. Set whatever you want, as Project name.
    6. Click "Finish"

    7. Now what you see on package explorer is your project, it should have the name you set as Project name earlier.

    8. Go to your project properties: [​IMG]
    (Alternative method: ALT + ENTER)
    9. On properties, select Java build Path.
    10. Select "Libraries" Now, in libraries, you should see this
    11. [​IMG]

    12. Click on "Add External JARs..." [​IMG]


    13. You need to have Spigot CraftBukkit JAR file for this step if you don't have it yet. You need to download it, I'd suggest you to use THIS website to get it.
    Basically, next, you need to select your Spigot/Bukkit JAR file and select it and click open
    [​IMG]

    14. After selecting Spigot/Bukkit jar and applying it, you should see new "Referenced libraries" on your project. [​IMG]

    Step three - Create a path for your code.

    1. Click on "src" and create new Package called "me.<yourname>.<your project name>" or any other such as "net.<yourname>.<your project name>", use me. if you don't own the ".net" domain.
    [​IMG]

    16. Now you have your package! Now you can create your main class. You can call it whatever you like, but I personally prefer "<ProjectName>", "Core" or "Main". In this tutorial I will be using "Core" as main class name.

    [​IMG]

    17. You have you're first ever java class! That's amazing! :D Now let's start coding!

    18. First of all, you should define your class as "JavaPlugin", so to do that you need to type "extends JavaPlugin" after your class name.

    [​IMG]


    19. Now you need to create enable method, which enables the plugin and will be running always on server reload/restart. Let's do it!
    [​IMG]


    10. You now have onEnable method, what you need now is onDisable.

    [​IMG]

    11. Great! You now have the method to enable and disable the plugin. What we're gonna do now is our first command called "helloworld", let's get started! Shall we?

    12. Follow the tutorial I made to my channel on YouTube


    13. Now you need to create a file called "plugin.yml"
    [​IMG]
    [​IMG]


    14. Once you've created your plugin.yml it should show up in package explorer.
    [​IMG]

    15. Click on it, it should open it up
    [​IMG]

    16. Next thing we're gonna do is specifying our project name, author, version and register the command we made.

    17. [​IMG]
    Click here to get example plugin.yml

    18. Once you've edited plugin.yml, it should look like this
    [​IMG]
    18. Great! You have now completed coding your first ever plugin! What we need to is now is to export your project to a JAR file!

    Step four - Exporting your plugin to JAR file
    1. Right-click your project name.
    2. Click on "Export"
    3. [​IMG]
    4. Click "Finish"

    5. YAY! You have completed your first ever plugin and you now have it as JAR file too! You can now move it to your server plugins folder and use it!

    ----------------------------------------------------------------------------------------

    Thank you for following my tutorial, doing this took a nice time, so I really appreciate if you rated this thread! If you're having any problems, make sure to comment and I'll try to help you. Thank you once again for taking your time to read my thread! <3


    Regards,
    skaizdoesmc
     
    #1
    Last edited: Sep 28, 2017
    • Like x 33
    • Useful x 9
    • Hype Train x 2
    • Helper Lapis x 2
    • Disagree x 1
    • Mod Emerald x 1
  2. Skaiz

    Skaiz Active Member

    skaizdoesmc
    MVP+
    Galex GALEX
    Member
    Messages:
    207
    Reserved.
     
    #2
  3. Really nice guide Skaiz! I'll give it a go. ;)
     
    #3
    • Hype Train Hype Train x 3
    • Useful Useful x 2
  4. M0N3Y

    M0N3Y Well-Known Member

    M0N3YBALL3R
    MVP+
    Slate SLATE
    MEMBER
    Messages:
    2,399
    HYPE!!! Will be using this in the near future
     
    #4
    • Like Like x 2
  5. Awesome guide, a lot of effort went into this and it's really paid off! Hopefully it'll help a lot of people!
     
    #5
    • Like Like x 1
  6. Hiiva

    Hiiva Well-Known Member

    Hiiva
    MVP+
    Amico AMICO
    GUILDMASTER
    Messages:
    10,811
  7. Avertings

    Avertings Well-Known Member

    Messages:
    3,176
    I have always wanted to learn how to write plugins, thanks!
     
    #7
    • Hype Train Hype Train x 1
  8. Skaiz

    Skaiz Active Member

    skaizdoesmc
    MVP+
    Galex GALEX
    Member
    Messages:
    207
    I truly hope this helps you to learn coding!
     
    #8
  9. zengamer155

    zengamer155 New Member

    Zelkerr
    Messages:
    3
    well if i know someone who can code minecraft plugins can you give him a rank on hypixel like how coders like AgentK do?
     
    #9
  10. Skaiz

    Skaiz Active Member

    skaizdoesmc
    MVP+
    Galex GALEX
    Member
    Messages:
    207
    Unfortunately, I cannot give rank to your friend, I do not have the ability to do that and although I had permission, they would need to purchase it on store.hypixel.net.
     
    #10
  11. zengamer155

    zengamer155 New Member

    Zelkerr
    Messages:
    3
    Yeah i know you don't and i have a question
    Do you make plugins?
     
    #11
  12. Skaiz

    Skaiz Active Member

    skaizdoesmc
    MVP+
    Galex GALEX
    Member
    Messages:
    207
    I do! :p
     
    #12
  13. Plochem

    Plochem Well-Known Member

    Plochem
    MVP+
    IceSquad ICE
    Member
    Messages:
    3,995
    Nice beginner guide!
     
    #13
    • Like Like x 1
  14. zengamer155

    zengamer155 New Member

    Zelkerr
    Messages:
    3
    I
    am thinking if we can make a server and make plugins and minigames i have a lot of friends who can help what is your opinion
     
    #14
  15. TurtleRy

    TurtleRy Well-Known Member

    holahoop
    VIP
    Messages:
    1,125
    kind-of complicated but it's cool <3
     
    #15
    • Like Like x 1
  16. Well this guide seems great for beginners at least!
     
    #16
    • Like Like x 1
  17. Core is not a good main class name, it should be the name of your project for example if you made a paintball plugin it'd be Paintball. Also you should not recommend people to just "use net.<username>.<project>", you should use me. if you do not own a domain.
     
    #17
  18. Skaiz

    Skaiz Active Member

    skaizdoesmc
    MVP+
    Galex GALEX
    Member
    Messages:
    207

    [​IMG]
    [​IMG]

    Also, I personally own https://skaizdoesmc.net/
     
    #18
  19. Nice image, I can read you know. Do not suggest "Core" or "Main", they are bad practices and shouldn't happen as I said in my post. Thanks for the image though! So hard to read. Secondly, did I say you didn't? No. I simply said you shouldn't just say
    without saying they should own the domain and if they don't use me.

    Believe it or not, I am here to help, you responding with an image proving my point and a saying something in response to what I didn't even say isn't helpful and just makes me have to respond with the same thing.
     
    #19
  20. Skaiz

    Skaiz Active Member

    skaizdoesmc
    MVP+
    Galex GALEX
    Member
    Messages:
    207
    Hi, thank you for your feedback, I fixed package part.
     
    #20

Share This Page