Well I'm pretty new to Java but I've programmed in some similar languages and would like to try Java too & try to create a little plugin even if it just echo's back a message. Some (noobish) questions I already had: I've seen stuff like Java, Java SE, Java EE, what's the difference? Also on the wiki it said Bukkit uses an older version? So what my question basically is, what is the right download I will need to start developing plugins for CraftBukkit? And maybe does anyone know a good tutorial for plugins with lots of examples? (I learn best with experimenting on examples, so any example would be really helpful ) Very much times thank you if you guys could give me a push in the right direction
Java SE (Standard Edition) is the base Java API. Java ME is the mobile edition and is a reduced subset of SE. Java EE is the enterprise edition and has additional APIs
I've read through that but that one question still remains: Java or Java EE? So you're saying.. Java Se? Thank you (I thought it would be better to post here again then make a new thread so...) I'm getting an error from Eclipse but don't get why. and It's from this line: Code: public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) Why doesn't it recognize the types? Note, i do have the latest bukkit library imported & made the class extend JavaPlugin. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Yes, all the files in the project is saved. Edit: I haven't compiled anything yet, Eclipse shows this error in the problems view.
The incremental compiler is what is used to check syntax. It is fired automatically. And you are sure Bukkit is on your build path?
I've done exactly as it says here http://wiki.bukkit.org/Plugin_Tutorial#Reference_the_Bukkit_API and my current code looks like Code: package com.gmail.ricardovermeltfoort.TestPlugin; import org.bukkit.plugin.java.JavaPlugin; public class TestPlugin extends JavaPlugin { public void onEnable() { getLogger().info("TestPlugin has been enabled."); } public void onDisable() { getLogger().info("TestPlugin has been disabled."); } public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if(cmd.getName().equalsIgnoreCase("rvtestplugin")) { // If the player typed /rvtestplugin then do the following... // doSomething return true; } //If this has happened the function will break and return true. if this hasn't happened the a value of false will be returned. return false; } }
You're going to hit this problem with almost every class you use. Hover your mouse over the red line and a yellow box will appear. On of the options (usually the first one unless it's a common name) will be to import the right namespace automatically.
CTRL + SHIFT + O (organize imports) (add used ones, remove unused ones) CTRL + SHIFT + F (format file) CTRL + SHIFT + S (save all open files) The magic combinations