more help with my plugin

Discussion in 'Plugin Development' started by sharkdude812, Oct 22, 2014.

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

    sharkdude812

    hello guys i need help with my plugin i fixed my old problem but i got another help please

    Code:
    public class MyClass extends JavaPlugin {
     
      public void onEnable() {
          getLogger().info("working");
      }
     
      public void onCommand(Command cmd) {
      if (cmd == "/test") {
          player.sendmessage("u did it!");
      }
    }
     
    }
    but i get errors so why did i get wrong please help me i am a bigenner
     
  2. Offline

    ProtoTempus

    Try to do some basic troubleshooting yourself. Log cmd.toString() and see what data you get and use that. Learning is about figuring out problems yourself. Also check out the crazy amount of tutorials on bukkit and youtube. Those will help.
     
  3. Offline

    sharkdude812

    what
     
  4. Offline

    teej107

    sharkdude812 You seriously need to improve your Java skills first, and then learn how to use the Bukkit API. Read the plugin tutorial from the Bukkit wiki. It shows you all the basics and it even suggests that you have a basic understanding of Java. From looking at your method of comparing strings, I say you need more knowledge of Java.
     
  5. Offline

    Gerov

    sharkdude812 Since the 'cmd' variable is a Command object, you cannot compare it to a string, you need to make the Command object into a string before you can compare it to one.
     
  6. Offline

    ProtoTempus


    sharkdude812 Honestly teej107 is right. If you dont even understand what I said you need to learn more about the language first. Start out with some Java basics video/tutorials.
     
  7. Offline

    sharkdude812

    i try watching pogostick27 but he dont help
     
  8. Offline

    fireblast709

    sharkdude812 Don't watch Bukkit tutorials. You should be learning Java, not Bukkit (and yes, they are two different things)
     
  9. Offline

    sharkdude812

    i was watching java101
     
  10. Offline

    WesJD

    sharkdude812

    Almost every Bukkit tutorial episode 1/2 covers commands, just saying. Also, do what others said, lean Java first. If you lean it first, you can learn the BukkitAPI faster.
     
  11. Offline

    VG.Developments

    sharkdude812 Few recommendations:
    1. Read the bukkit plugin wiki for creating plugins
    2. Watch tutorials (i.e. PogoStick29 Videos are a good example)
    3. Read books ( i.e. Java for dummies)
     
    PogoStick29 likes this.
  12. Offline

    teej107

    Learning Java first is a big help seeing as the API can't do anything without Java and it's the language you are developing with.
     
    VG.Developments likes this.
  13. Offline

    fireblast709

    No no no no no no no no no no no no no. No Bukkit tutorials on youtube unless you want to learn how not to program.
     
  14. Offline

    es359

    Books all the way.
    [​IMG]
     
  15. Offline

    PogoStick29

    Learning how not to program is good too ;)
     
    VG.Developments and Totom3 like this.
  16. Offline

    mythbusterma

    PogoStick29

    The point being that someone who is new to programming won't be able to tell the difference, and will think that static is how you access fields from another class (just one particular, very annoying example).

    Or, to take examples from your videos, in the first two minutes:
    Not putting @Override on overidden methods, especially when you type them out yourself.
    Logging to the console that your plugin is enabled, not only by unnecessarily using the static reference to Logger, but logging that in the first place, as Bukkit already does it for you.
     
  17. PogoStick29 Hello, I started to learn plugins of you. Well done and wow your on Bukkit forums.
     
  18. Offline

    fireblast709

    Right... Rather than posting sarcastic comments you should change this in your videos. I continuously have to tell people not to do this, and to do that.
     
  19. Offline

    PogoStick29

    Once I post a video, I can't really change it.
     
    VG.Developments likes this.
  20. Offline

    fireblast709

    PogoStick29 you can record it again, you can delete videos, you can reupload videos, and I'm pretty sure you could change the order in a playlist you made.
     
  21. Offline

    d3v1n302418

    As much as these bad habits can come from programming videos, you should already have good habits from knowing the language (which you MUST learn in order to know how to make a semi decent plugin without visiting these forums every 20 Minutes). Besides the fact that beginners would really benefit from viewing the code and listening to someone explain it, you've gotta understand that everyone learns in a different way. As long as the tutorial you are watching doesn't contain plugin breaking information, its absolutely FINE to watch tutorials such as PogoStick29.
     
  22. Offline

    mythbusterma

    d3v1n302418

    Well considering Pogo's videos are ripe with bad practice, I can't honestly say you're right. You're going to learn bad habits. Also, the whole "learning in a different way" argument is really old, go read fireblast709 's on why video tutorials are bad, at best.
     
  23. Offline

    d3v1n302418

    mythbusterma I just can't see how learning from videos could be bad, its just like reading a book excpet the information is being said to you instead of you reading it. Pogos newer turorials are not filled with bad habits (there are a few). I learned from video tutorials and though I'm not the best or most advanced programmer, I don't use bad habits like ignoring Encapsulation and static modifiers for little hashmap and list in my main class.
     
  24. Offline

    es359


    From some previous posts from Pogostick, I think he is pretty much done with Bukkit, I doubt he has any plans to update those vidoes.
     
    d3v1n302418 likes this.
  25. Offline

    fireblast709

    I could be wrong, but wouldn't you be referring to AdamQpzm 's post?
     
    AdamQpzm likes this.
  26. Offline

    mythbusterma

    AdamQpzm likes this.
  27. Offline

    rbrick

    es359 likes this.
  28. Offline

    PogoStick29

    Sup. :cool:
     
Thread Status:
Not open for further replies.

Share This Page