Getting started with Bukkit and CraftBukkit

Discussion in 'Bukkit Help' started by Oslarathos, Jan 4, 2011.

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

    AnonymousJohn

    Mmk, so Windows can't find java.exe. Your batch file is fine, and is in the same directory, Win7 64-bit shouldn't make a difference, I'm running the same thing. Good that Java is up to date, but not necessary (I don't think?). Hmmm... Alright, here we go:
    1. Remove '\java.exe' from the path name you added to the PATH variable and try again. It's supposed to be a path to a folder, not a file. Still doesn't work? Next step.
    2. Check the location you added to the PATH variable. Are you sure that's exactly where your java.exe file is stored? I know that in mine (also Win7 64-bit), there's another folder under 'java' called something like 'java6' (I need to re-check). Not working? One more step.
    3. Make sure you've separated the entries in the PATH variable by semicolons. If this doesn't work, post your entire PATH variable. Yes, all of it. There may be an error in there you need to correct for it to parse right.
     
  2. Offline

    D00M.7RA1N

    Haha lol yeah removing the java.exe worked. Also it was located at 'java\jre6\bin' or something like that my bad lol.

    Weird thou how I need to add it the the PATH environment when the .bat file i use for hMod works fine.

    Any who cheers mate knew I was overlooking something.
     
  3. Offline

    Dgauss

    2 things...sorry Im pretty illiterate when it comes to this type of thing

    1.Alright the server seems to be up and running in the cmd window but when I try and log into localhost i get Connection Lost

    Intenal exception: java.io.UTFData FormatException:malformed input around byte 2

    2.What would be the best way to go about get IConomy and ICShop pluggins working?
     
  4. Offline

    Snowl

    Thanks for the tut. The pos and debug comands work, but if I add the Block Listener it royally breaks. I get this error when I try and place a Cactus:If I try and add the Sand falling part, it keeps on sending me errors
    In eclipse Cactus is underlined in red, but if I put in CACTUS it turns italic blue. It doesn't work either.
    Also, I can place Cactus on Snow and Water :S
     
  5. Offline

    Nickname97

    Could I have some Mac instructions please?
     
  6. Offline

    Zenolijo

    I tried to install bukkit with maven and eclipse, but didn't make it.
    So i installed it the easy way (Like they say on the forums FAQ), i have mac so i can't use sudo and i can't use .bat files, so i combined the Linux and the Windows installation and it worked :)
    But every plugin i install it came an error, i searched at google and found this thread :confused:

    Its just the same like hansudo has, but instead of sampleplugin.jar its all the plugins .jar files
    Is it possible that its similar?
     
  7. Offline

    Bloq

    I have no idea what to do with coding, but can anyone tell me where to download (Craft)Bukkit and/or give me a download of all the files ready?
     
  8. Offline

    AnonymousJohn

    *ahem*

    Second post.
     
  9. Offline

    timmystwin

    ^there is no download link that i found on them unless you are a member,which caused me to give up instantly. Im fed up with tying to install it, ive tried 9 times with 8 tutorials and drawn the same error.

    Exception in thread "main" java.lang.NoClassDefFoundError: org/bukkit/craftbukki​
    t/Main​
    Caused by: java.lang.ClassNotFoundException: org.bukkit.craftbukkit.Main​
    at java.net.URLClassLoader$1.run(Unknown Source)​
    at java.security.AccessController.doPrivileged(Native Method)​
    at java.net.URLClassLoader.findClass(Unknown Source)​
    at java.lang.ClassLoader.loadClass(Unknown Source)​
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)​
    at java.lang.ClassLoader.loadClass(Unknown Source)​
    Could not find the main class: org.bukkit.craftbukkit.Main. Program will exit.​
    Press any key to continue . . .​

    and my start.bat is​

    @echo off​
    "%ProgramFiles(x86)%\Java\jre6\bin\java.exe" -Xms512M -Xmx512M -jar craftbukkit.jar​
    pause​

    And i have a copy of craftbukkit.jar in that directory.​

    I even tried with the original name. Nada.​
     
  10. Offline

    Motsols

    I followed the video tut but when I download SampleProject and draw the com folder to src in the project, I get a lot of errors in the code. The error messages are mainly "Player cannot be resolved to a type" and "Block cannot be resolved to a type".

    In bukkit repos there is no such thing as org.bukkit.Player and org.bukkit.Block. Is this broken because of some update?
     
  11. Offline

    Morris1927

    i keep getting an error in "private final SamplePlugin plugin;" where it says plugin there is a squiggly orange line under it
     
  12. Offline

    poter333

    can someone give me a link where i can download bukkit and how to install it properly
     
  13. Offline

    Metamist

    I can't download Bukkit because i keep getting bad gateway or there's no download link there :O
    This didn't happen some days ago. I guess they've changed it. Anyone knows where i can get it now or is this gonna fix or something?
     
  14. Offline

    jor956

    The link is not working, if somebody could try to fix this, it would be greatly appreciated.
     
  15. Offline

    hawx

    Links are dead
     
  16. Offline

    Plague

  17. Offline

    Astro MacGuffin

    Noob question, hopefully of the semi-competent variety. My (first) plugin compiles, but I think I've packaged the jar file wrong. As briefly as possible:

    What I did (open)
    Code:
    ~/src/bukkit/HelloBukkit$ ls com/AstroMacGuffin/Hullo/HulloCitizen/
    HulloCitizen.class  HulloCitizenCustomListener.class  HulloCitizenCustomListener.java  HulloCitizen.java
    
    ~/src/bukkit/HelloBukkit$ cat plugin.yml
    name: HulloCitizen
    
    main: com.AstroMacGuffin.Hullo.HulloCitizen
    version: 0.1
    
    ~/src/bukkit/HelloBukkit$ jar cvf HulloCitizen.jar plugin.yml com/AstroMacGuffin/Hullo/HulloCitizen/*.class
    
    I copy to the plugins folder and let 'er rip, but she complains about stuff. After that I open the .jar in file-roller and move the folder HulloCitizen, and the file plugin.yml, to the root folder. Then I copy the jar file to my server's plugins folder and let 'er rip again.

    Code:
    [SEVERE] Could not load plugins/HulloCitizen.jar in plugins: null
    org.bukkit.plugin.InvalidPluginException
    	at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:80)
    	at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:130)
    	at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:95)
    	at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:59)
    	at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:204)
    	at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:191)
    	at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:131)
    	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:246)
    	at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.lang.ClassNotFoundException: com.AstroMacGuffin.Hullo.HulloCitizen
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    	at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:30)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
    	at java.lang.Class.forName0(Native Method)
    	at java.lang.Class.forName(Class.java:264)
    	at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:72)
    	... 8 more
    


    Unfortunately, I still have errors. I suspect the problem is my folder structure; but I'm just now learning Java, so this is my first mod, and my 2nd day with Java at all.

    Tips? Halp?

    EDIT: In case anyone's just chomping at the bit to help me...

    HulloCitizen.java source (open)

    Code:
    package com.AstroMacGuffin.Hullo.HulloCitizen;
    
    import java.io.File;
    import java.util.HashMap;
    import org.bukkit.entity.Player;
    import org.bukkit.Server;
    import org.bukkit.event.Event.Priority;
    import org.bukkit.event.Event;
    import org.bukkit.plugin.PluginDescriptionFile;
    import org.bukkit.plugin.PluginLoader;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.plugin.PluginManager;
    import com.fullwall.Citizens.Citizens;
    
    /**
     * HulloCitizen plugin for Bukkit
     *
     * @author Astro MacGuffin
     * Based on the sample by Dinnerbone (thank you)
     * Imports fullwall's Citizens and hopefully does something with it.
     */
    
    public class HulloCitizen extends JavaPlugin {
        private final HulloCitizenCustomListener customListener = new HulloCitizenCustomListener(this);
        private final HashMap<Player, Boolean> debugees = new HashMap<Player, Boolean>();
    
        // NOTE: There should be no need to define a constructor any more for more info on moving from
        // the old constructor see:
        // http://forums.bukkit.org/threads/too-long-constructor.5032/
    
        public void onDisable() {
            // TODO: Place any custom disable code here
    
            // NOTE: All registered events are automatically unregistered when a plugin is disabled
    
            // EXAMPLE: Custom code, here we just output some info so we can check all is well
            System.out.println("Goodbye world!");
        }
    
        public void onEnable() {
            PluginManager pm = getServer().getPluginManager();
            // Register our events
            pm.registerEvent(Event.Type.CUSTOM_EVENT, customListener, Priority.Normal, this);
    
            // EXAMPLE: Custom code, here we just output some info so we can check all is well
            PluginDescriptionFile pdfFile = this.getDescription();
            System.out.println( pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!" );
        }
        public boolean isDebugging(final Player player) {
            if (debugees.containsKey(player)) {
                return debugees.get(player);
            } else {
                return false;
            }
        }
    
        public void setDebugging(final Player player, final boolean value) {
            debugees.put(player, value);
        }
    }
    

    HulloCitizenCustomListener.java source (open)

    Code:
    package com.AstroMacGuffin.Hullo.HulloCitizen;
    import java.io.File;
    import java.util.HashMap;
    import org.bukkit.entity.Player;
    import org.bukkit.Server;
    import org.bukkit.event.Event.Priority;
    import org.bukkit.event.Event;
    import org.bukkit.event.CustomEventListener;
    import org.bukkit.plugin.PluginDescriptionFile;
    import org.bukkit.plugin.PluginLoader;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.plugin.PluginManager;
    import com.fullwall.Citizens.Citizens;
    import com.fullwall.Citizens.events.CitizensBasicNPCEvent;
    
    public class HulloCitizenCustomListener extends CustomEventListener {
      private HulloCitizen plugin;
      public HulloCitizenCustomListener( HulloCitizen plugin ) {
        this.plugin = plugin;
      }
    
      @Override
      public void onCustomEvent(Event ev) {
        if (!ev.getType().equals(Event.Type.CUSTOM_EVENT)) {
          return;
        }
        if (!ev.getEventName().equals("CitizensBasicNPCEvent")) {
          return;
        }
        CitizensBasicNPCEvent e = (CitizensBasicNPCEvent) ev;
    
        System.out.println( "Hullo, Citizen!" );
      }
    
    }
    

    [MERGETIME="1299959985"][/MERGETIME]
    I'm happy to say, nevermind my previous post :D Figured it out - was compiling from /above/ the src folder the whole time, making the flags like it but leaving PluginLoader unable to find it.
     
  18. Offline

    EdGruberman Retired Staff

    Thank you for this tutorial, it helps!

    How do I use egit to set my local src files to a certain commit?
    Also how do I revert a commit locally so I can build without a specific commit?
     
  19. Offline

    Mosh Mage

    Forgive me for the dumbest of questions, i just woke up but here it goes, but is the proccess of making a plugin in NetBeans IDE 7 excatly the same as in Eclipse?

    Because i couldnt get Eclipse to work, god knows why
     
  20. Offline

    Penguinator

    Whenever I try to run the server I get the following error:
    Untitled.png
    according to Eclipse, it's a problem with the main SamplePlugin class.
    Can someone help?
     
Thread Status:
Not open for further replies.

Share This Page