»Java/Bukkit Tutorial 1

Discussion in 'Tutorials' started by KaliCode, Aug 28, 2017.

?

What should the next tutorial be on?

  1. More java basics

    12 vote(s)
    70.6%
  2. Creating a bukkit plugin

    5 vote(s)
    29.4%
  1. KaliCode

    KaliCode Zodiac Member

    Messages:
    228
    Ratings:
    +157 / -0
    INTRODUCTION: Hello I'm DiscoDuck, the head-admin of the creative server. A lot of staff members have requested that I do this tutorial series on Java/Bukkit development so here goes. In this series we will be learning the basics of Java and how to use the Bukkit library to create plugins for Minecraft servers.

    OUTLINE: In this tutorial we will be learning: how to download and use a Java IDE,
    the basics of Eclipse,
    and how to create a simple "Hello world" program.

    TUTORIAL: Okay now we are going to start off by downloading the Eclipse IDE to actually create Java programs. Go to this link https://www.eclipse.org/downloads/eclipse-packages/ and download "Eclipse IDE for Java Developers".

    Now that you have fully extracted and installed Eclipse, open it up and make your way to a screen that looks something like this:http://imgur.com/a/ZiDk3[​IMG] and click on where it says "create a new java project". Enter the project name at the top, mine is going to be called "HelloWorld", then click Finish. Once you've done that it should migrate you to a screen that looks something like this:[​IMG] http://imgur.com/a/by5iQ click on the file that has the name of your project, again mine is named "HelloWorld" then right click a folder called "src" and click on at the top where it says "New" and select the option called "Package" It should look like this:[​IMG] http://imgur.com/a/LYH7L once you've clicked the Package option you need to name it "me.yourname.helloworld" so I named mine "me.DiscoDuck.helloworld". now right click that package and again click New and then click on the "Class" option. Name it whatever you like, mine will be named "Core". After all that you should end up with a screen similar to this:[​IMG]http://imgur.com/a/tDQPw

    Now that you have your project set up we can begin to actually do some coding. We are going to be making a "Hello world" program so that when you run your code it will simply give u a message in the console saying "Hello world". Here is the code that will be used:http://imgur.com/a/hL2un [​IMG] then click on the green arrow towards the top left corner of the screen to run your code and if everything runs correctly it should say "Hello world" in the console:[​IMG]http://imgur.com/a/jAXiu

    CONCLUSION: Okay now you have successfully created your first Java program. I know this tutorial might have been a little bit confusing or boring, but it is essential that you get some knowledge of Eclipse and Java before attempting to create a Minecraft plugin.

    NEXT TUTORIAL: Alright depending on what gets the most votes, next tutorial will either be Option 1: more basics of Java OR Option 2: Implementing the Bukkit library into Eclipse and creating our first plugin. If your new to Java vote for Option 1. If you think you know enough Java already vote for Option 2. Peace.
     
    #1
  2. VlaDCarS

    VlaDCarS Member Member

    Messages:
    63
    Ratings:
    +9 / -0
    This is really nice, although I knew these basics from my recent experience of trying java, I really look forward for more Java tutorials and later Bukkit
     
    #2
  3. XxMasterMCxX

    XxMasterMCxX ULTRA NOOB Member

    Messages:
    721
    Ratings:
    +164 / -0
    This is well written. Would like to see more from you ;)
    Good job DiscoBuck, you know who I am ._.


    I didn't get half of it but it can be useful and interesting to many people who use java or want to learn more about it
     
    #3
  4. NinetyNine

    NinetyNine Jr Developer Member

    Messages:
    1,238
    Ratings:
    +185 / -0
    Same ^^

    Nice tutorial Disco!
    I hope you do this more often if you have time. Because even I, I'm confused about little things as I've been working on some plugins.
    This helped me, thanks!
     
    #4
  5. WilyWaldo

    WilyWaldo Honorary Poster Member

    Messages:
    443
    Ratings:
    +87 / -0
    #5
  6. KaliCode

    KaliCode Zodiac Member

    Messages:
    228
    Ratings:
    +157 / -0
    Yea IntelliJ is much more optimised for Java programming. I'm using Eclipse because i think its easier to set up and is more noob friendly.
     
    #6
  7. Lolo :O

    Lolo :O kek Member

    Messages:
    1,277
    Ratings:
    +965 / -0
    You're making java tutorials while a few months ago u didnt even format your code lol ok
     
    #7
  8. KaliCode

    KaliCode Zodiac Member

    Messages:
    228
    Ratings:
    +157 / -0
    What code are you referring to?
     
    #8
  9. IDeathCraftPvP

    IDeathCraftPvP Quick Digit Member

    Messages:
    228
    Ratings:
    +89 / -0
  10. Tarawa

    Tarawa Nimble Knuckle Member

    Messages:
    320
    Ratings:
    +136 / -0
    luv it
     
    #10
  11. Lolo :O

    Lolo :O kek Member

    Messages:
    1,277
    Ratings:
    +965 / -0
    Going to find it when i get on my pc

    [​IMG]

    7 empty lines that serve no purpose.

    You're also switching between code {
    and code
    {


    You're bothered to make comments but you're not bothered to give stuff decent names:
    [​IMG]
     
    Last edited: Aug 28, 2017
    #11
  12. Cervium

    Cervium Forum Veteran Member

    Messages:
    1,260
    Ratings:
    +1,341 / -0
  13. KaliCode

    KaliCode Zodiac Member

    Messages:
    228
    Ratings:
    +157 / -0
    Those empty lines and the {'s are a mistake i didnt see. As for the variables I really don't care what the names are if I know what it equals and if i only have 1 variable of that type.
     
    #13
  14. Lolo :O

    Lolo :O kek Member

    Messages:
    1,277
    Ratings:
    +965 / -0
    It's good practice to name things appropriately. Especially if you're going to make it open source.
     
    #14

Share This Page