Minecraft / Blogs

Creating Your Own Bukkit Plugin in 10 Easy Steps!

  • 2 Diamonds
  • 315 views, 0 today
  • 0 comments
  • 0 favorites
  • 2
  • 0
  • comment
  • playlist_add
  • share
  • more_horiz
avatar adam561
Level 39 : Artisan Modder
12
Hello! Welcome to the coding school of Adam (School, ikr)



Okay lets get into it, (this is my first tutorial...ever. Dont blame me if its bad :P)

A litle background and vocab list of bukkit plugin making:
- JAVA is a programming language that is used for making plugins, most likley because minecraft and bukkit are made with it.
- IDE (Integrated development environment) is what you use to turn your meaningless text into a JAR file. I use Intellij IDEA is what I use: LINK. You can also use ECLIPSE
- OOP (Object Oriented Programming) What Java is, an Object Oriented Language. Different from scripting and markup languages.
- API (Application Programming Interface) Application = Bukkit (in this case), Programming (thats what we are doing), Interface = Ability to interact with. In short its what we use to interact with bukkit and program with it.

Now into the sweet sweet code.

This tutorial will be a bit easyer if you have programming expierance, but It isnt exaclty required. 
      0. Download and place the version of bukkit you would like to develop for on your desktop, found HERE
      1. In your IDE make a new project and call it "MyFirstPlugin"
      2. Create a new folder(s) by right clicking and selecting the "new" button under "src" (where all of your source is) 

       undefined
     3. Name the new package "me.(your name here).myfirstplugin"
     4. Create a new class called "Main" in you new "myfirstplugin" folder/package.
     5. Import the Bukkit API:
     
Intellij IDEA
Eclipse
     6. You should have something like this:





      undefined

    7. Add "extends JavaPlugin" to the end of public class Main. What this does is tells bukkit that this file is a plugin! (It might ask to import "org.bukkit.plugin.java.JavaPlugin", say yes. If a redline appears below the "JavaPlugin" text you need to manually import it by pressing Alt+Enter and selecting "Import Class" then select "org.bukkit.plugin.java.JavaPlugin".

    8. Make a space between the brackets ( These: { }) and add the following code:
undefined
    
All of the green text can be changed, other than the "s. Just something to catch your eye.

    9. Create a new file called "plugin.yml". YML files are very picky in spacing, but are perfect for formatting. This file is the description file for your plugin. Here is the following code that is required to go in the plugin.yml file:

     main: me.YOURNAME.myfirstplugin.Main
     name: MyFirstPlugin
     version: 0.1
     author: YOURNAME

    10. You are almost done! All you need to do is turn your text into a JAR file.
Intellij IDEA

Once you have compiled your code you are finished! Run your server and watch the magic in the console!
undefined

Thanks for reading, hope you learned something! Leave a like or whatever PMC has for support :P

If this tutorial is useful and people want more I will be glad do make more for advanced and basic topics!
Questions? Comment and I will reply!

Check out my plugins to see what is possible with the Bukkit API!!
Tags

Comments : 0

star Login or register to post a comment.

Planet Minecraft

Browse

Site

© 2010 - 2019
planetminecraft.com

Welcome