Results 1 to 1 of 1
  1. #1
    Bot Bot's Avatar
    Join Date
    Aug 2011
    Posts
    2,671
    Points
    7,720
         User Info     Contact     Gamer ID
    Join Date
    Aug 2011
    Posts
    2,671
    Points
    7,720

    Default Minecraft Bukkit Plugin Tutorial - Tutorial 2 - Testing Plugins

    Minecraft Server

    So having created the basics of our plugin we now need to be able to test it and make sure it works. So to do this we will need to run a server, presuming you don't have your own rented server then you can set one up on your localhost.

    Get the latest recommended version of CraftBukkit and place this .jar file where you'd like your server files to be kept. Now open Notepad, or a similar application, and create a file called run.bat with the following code inside:

    Code:
    java -Xms1024M -Xmx1024M -jar craftbukkit.jar -o true
    PAUSE
    If you didn't pay for your Minecraft and are using a hacked launcher then you must change -o true to -o false to be able to join your server.

    Now all you have to do is double click your run.bat to start the server.

    Joining Your Server

    To join your Minecraft server all you should need to do is enter localhost as the IP when trying to connect. If this fails then you can try using a range of alternatives, including your external IP as well as your internal IP.

    Exporting Plugins

    Now we have a running server it is possible to test any plugins we want. So first we need to stop the server, either by simply closing the window or entering stop into the console.

    Now in Eclipse right click your project and click Export.... Chose JAR file, which is found under Java and then press Next. Make sure all files of the project you want to export are ticked, and only the project you want to export is ticked. Now finally for the JAR File field you need to browse to your Minecraft server folder from earlier and select the plugins folder. Now click finish and your plugin will be compiled in the plugins folder for your Minecraft server.

    Load Server With Plugin

    Now go back to your Minecraft server folder and run the run.bat file to start up your server. Once loaded your server should be loaded with your new plugin. Look in the console for any errors, but otherwise you should see something like [{$PluginName}] Enabling {$PluginName} v{$PluginVersion}. If you've followed the previous tutorial you will have a blank plugin so you won't get this message. But for when you start coding you need to make sure the console runs the code as you intended to program it.

    It is wise to regular test your plugins when working on them, if not just save each version of your plugin in case something breaks or stops working.

    /////////////////////////////////////////////////////////////////////////////////////////////


    0 Not allowed! Not allowed!
    Last edited by Bot; 06-13-2013 at 11:14 PM.








Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -10. The time now is 05:04 PM.
Powered by vBulletin®
Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.