Solved Newbie Dev In Need of Support

Discussion in 'Plugin Development' started by Qisol, Dec 21, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Qisol

    Hello everyone,

    Coding is the only satisfying thing for me right now, if I get the code to work. I want to be able to create unique plugins and mods for Minecraft to enhance my experience because I wish to create things in order to feel that I'm contributing to the improvement of communities. After sitting through 13 frustrating completely different Bukkit plugin development tutorials on YouTube, I was on the brink of tears many times. I don't want to make this an off topic thread, so I just need some guidance or else I don't know what else to do with my life.

    please help:'(
     
  2. Offline

    xTrollxDudex

    Qisol
    Well, you gotta learn java and how to make a plugin from a reliable source

    Important: Learn java. Right, if you need help, you're gonna have to post some code.
     
    Gater12 likes this.
  3. Offline

    Gater12

    Qisol Yeah. If ya wanna make plugins you gotta learn HOW to make em. You can start off by learning the basics of good ol' Java. There are TONS of tutorials in various forms (JavaDocs, books, random pages on Google... etc.) and you can find one that you are most comfortable with. Once you think you are ready and have this what I call "programmer's logic", you can start working with the Bukkit API. You can find documentation of the Bukkit API here: http://jd.bukkit.org/rb/apidocs/
    Maybe when you are older, you can start making games in Java and start getting buttloads of money.[/b][/b]
     
  4. Offline

    w84u2cy

    Hi,
    First, try and find something more reliable and social than coding to satisfy you. I don't know what you're going through but try your best. ;) It's nice though that you want to help people!
    But, here are some very helpful resources that are good:
    http://www.thenewboston.org - great for learning java and lots of other things too!
    http://www.youtube.com/pogostick29dev - fantastic bukkit tutorials that are great for starting off.

    Have fun learning :)
     
  5. Offline

    Qisol

    w84u2cy I've already done tons of thenewboston tutorials a couple years ago, and every YouTube tutorial I've seen just confuses me more.

    Gater12 I've checked those many times, and it just overwhelms me, like math, which I have a learning disorder in.

    xTrollxDudex
    Code:java
    1. package me.Qisol.Flexipe;
    2.  
    3. import org.bukkit.Bukkit;
    4. import org.bukkit.Material;
    5. import org.bukkit.inventory.ItemStack;
    6. import org.bukkit.inventory.ShapedRecipe;
    7. import org.bukkit.plugin.java.JavaPlugin;
    8.  
    9. public class main extends JavaPlugin {
    10.  
    11. public void onEnable() {
    12.  
    13. // Skeleton Skull
    14. ShapedRecipe skskull = new ShapedRecipe(new ItemStack(Material.SKULL_ITEM));
    15. skskull.shape(new String[]{"///","/&/","///"}).setIngredient('/', Material.BONE).setIngredient('&', Material.GOLD_INGOT);
    16. Bukkit.getServer().addRecipe(skskull);
    17.  
    18. // Zombie Skull
    19. ShapedRecipe zoskull = new ShapedRecipe(new ItemStack(Material.SKULL_ITEM));
    20. zoskull.shape(new String[]{"###","#&#","###"}).setIngredient('#', Material.ROTTEN_FLESH).setIngredient('&', Material.GOLD_INGOT);
    21. Bukkit.getServer().addRecipe(zoskull);
    22.  
    23. // Creeper Skull
    24. ShapedRecipe crskull = new ShapedRecipe(new ItemStack(Material.SKULL_ITEM));
    25. crskull.shape(new String[]{"%%%","%&%","%%%"}).setIngredient('%', Material.SULPHUR).setIngredient('&', Material.GOLD_INGOT);
    26. Bukkit.getServer().addRecipe(crskull);
    27.  
    28. // Wither Skull
    29. ShapedRecipe wiskull = new ShapedRecipe(new ItemStack(Material.SKULL_ITEM));
    30. wiskull.shape(new String[]{"$$$","$&$","$$$"}).setIngredient('$', Material.ENDER_PEARL).setIngredient('&', Material.GOLD_INGOT);
    31. Bukkit.getServer().addRecipe(wiskull);
    32.  
    33. // Steve Skull
    34. ShapedRecipe stskull = new ShapedRecipe(new ItemStack(Material.SKULL_ITEM));
    35. stskull.shape(new String[]{"@@@","@&@","@@@"}).setIngredient('@', Material.APPLE).setIngredient('&', Material.GOLD_INGOT);
    36. Bukkit.getServer().addRecipe(stskull);
    37.  
    38. }
    39.  
    40. public void onDisable() {
    41.  
    42. Bukkit.getServer().clearRecipes();
    43.  
    44. }
    45. }
    46.  

    >_>
     
  6. so whats wrong? Its hard to help someone when there seems to be no error.
    When you run the code are you getting an error?
    if so copy that(its called a stacktrace) and post that. It pinpoints you to the exact line where the error occurs.
     
  7. Offline

    Qisol

    Flaming Dragon Fist It's wrong because each recipe will only give me a Skeleton Skull because I don't know how to specify the Skulls' metadata.
     
  8. Offline

    xTigerRebornx

    Qisol
    Code:
    ItemStack(Material type, int amount, short damage)
              An item stack with the specified damage / durabiltiy
    You could make the new ItemStack like this, setting its damage value to that of each mob head
     
  9. Offline

    Qisol

    xTigerRebornx So...
    Code:java
    1. // For a Creeper Skull:
    2. ItemStack(Material.SKULL_ITEM, 1, 4)

    Thanks!
     
  10. Offline

    xTigerRebornx

    Qisol No problem, remember to set to solved :p
     
  11. Offline

    Qisol

    xTigerRebornx Eh, actually, take a look here.
    Code:java
    1. // Creeper Skull
    2. ShapedRecipe crskull = new ShapedRecipe(new ItemStack(Material.SKULL_ITEM, 1));

    That seems to work, but...
    Code:java
    1. // Creeper Skull
    2. ShapedRecipe crskull = new ShapedRecipe(new ItemStack(Material.SKULL_ITEM, 1, 4));

    That gives me an error stating that the 3rd argument is invalid. I'm confused.
     
  12. Offline

    xTigerRebornx

    Qisol Damage values are shorts, cast it to a short

    EX new ItemStack(Material.SKULL_ITEM, 1, (short) 4)
     
  13. Offline

    Qisol

    xTigerRebornx I don't know what that means, but okay. Does the space between the (short) and the value matter?

    EDIT: Also, it works! Thanks so much!
     
  14. Offline

    xTigerRebornx

    Qisol Yes, basically, 4 alone is an Integer. Putting the (short) infront of it is a simpler way of doing something like Short.parseShort(4)
     
  15. Offline

    xTrollxDudex

    No it's called a cast :)
     
  16. Offline

    xTigerRebornx

    xTrollxDudex xTrollxDudex I said "like" for a reason. I called a cast in the first post I made about it, and the OP didn't understand, so I put it in a way he could understand it
     
  17. Offline

    xTrollxDudex

  18. Offline

    Qisol

  19. Offline

    xTigerRebornx

    Qisol Original Poster (At least thats what I think it means)
    I am just referring to the person who created the post
     
  20. Offline

    AzubuSan

    Qisol Original Poster
     
  21. Offline

    Qisol

    xTigerRebornx Oh, okay. Would you like to play some survival with me tonight on my private server?
     
  22. Offline

    xTigerRebornx

    Qisol Nah, I am good. I have some coding to do :p
     
  23. Offline

    Qisol

    xTigerRebornx Oooh, well could we keep in touch because I'd like to learn from you :3
     
  24. Offline

    xTigerRebornx

    Qisol Feel free to tahg me or send me a message anytime :p
     
Thread Status:
Not open for further replies.

Share This Page