Thread Contributor: Blessings
Programming with Blessings! Java | Episode 1 | Minecraft: Hello World!
Hello everyone! Today I will be explaining how to make a very simple, hello world Minecraft plugin!


1. Add extends JavaPlugin and import JavaPlugin.
[Image: eC3NMOj.png]

2. Replace "Hello World!" with HelloWorld
[Image: 7fA9LrR.png]

3. Replace "p.getCustomName()" with "p.getName()"
[Image: sI6njmX.png]

Getting Started:

1. Head over to HERE and download Eclipse IDE for Java Developers. (This is what we will be using to program our plugins.)
2. Head over to HERE and hit download. This file is an extension to use Minecraft codes.

Time to Code:

1. Go to File > New > Java Project
[Image: Yjy9d1e.png?1]

2. For this tutorial, Name the project HelloWorld and select Next
 [Image: 9tWwnSL.png]

3. Select Libraries > Add External JARs. This is where we import the craftbukkit libraries.
 [Image: jbEEfsS.png]

4. Find your file, Double click it to open and then hit Finish
[Image: CYjmvJw.png]

5. Right click "src" > New > Package
 [Image: Qnc0Rb0.png]

6. Change the Name: to me.yourname.helloworld (You can replace yourname with whatever)
[Image: xh3tdeB.png]

7. Right click on helloworld > New > Class
 [Image: 1xYiEZp.png]

8. Change the Name to "Hello" and hit Finish
 [Image: EN9gUBe.png]

9. This is the code for the HelloWorld Plugin. Read the grey to understand. The lines represent the imports it leads to.[Image: Vxf5G4l.png]

10. Right Click on HelloWorld > New > File
 [Image: 1qCJ3dP.png]

11. Name the File "plugin.yml" and then hit Finish
 [Image: VXXZhSW.png]

12. Double click plugin.yml and then enter the following: (Remember where it says yourname  is whatever you put.)
 [Image: Khxb59E.png]

13. Right click on the HelloWorld > Export
[Image: Z3JT0d3.png]

14. Select Java > JAR File > Next
[Image: wFeuv2j.png]

15. Check the same boxes and then hit Next
[Image: 00rVisu.png]

16. Wherever you place your JAR file, move it into your Minecraft > Plugins folder and then start up your server!

17. If you copied correctly, you should see this in this console!

[Image: sqGxbkn.png]

18. Once in-game, type /help to see that your plugin is there and /help helloworld to see the commands!
[Image: 8hlVp6M.png]

19. Now you are ready! Type in /hello and see your plugin in action!
[Image: r7RH6AR.png]

Hello World Finished!:

That comes to the end of this tutorial! If you have any plugin tutorials then please let me know below!]
- I am currently working on Chat Channels.

Wow this is incredible! as well as very well written and detailed! I'll possibly attempt this at some point, thanks for sharing!
If you need assistance with anything, feel free to message me.

I am NOT a robot or am I?

(06-11-2016, 10:31 AM)Sir Twisted Wrote: Wow this is incredible! as well as very well written and detailed! I'll possibly attempt this at some point, thanks for sharing!

I am glad you like it!

Users browsing this thread: 1 Guest(s)