Results 1 to 9 of 9
Like Tree1Likes
  • 1 Post By gimbal2

Thread: Minecraft Plugin Help

  1. #1
    Join Date
    Sep 2013
    Posts
    4
    Rep Power
    0

    Default Minecraft Plugin Help

    Hey guys,

    I am quite new to java and i am trying to learn to code effectively so i figured that theres no better place to start than making a plugin for minecraft. I am trying to make a plugin that will allow users to enjoy a government style gameplay such as a president etc. I am trying to set up my starting class that will be the president. Here is my code so for,

    main class code;
    package dckillerman123.realms;

    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerLoginEvent;
    import org.bukkit.plugin.java.JavaPlugin;

    public class realms extends JavaPlugin {

    @Override
    public void OnEnable(){
    getLogger().info("Realms v.1.0 has been enabled");
    getServer().getPluginManager().registerEvents(new playerlogin(), this);
    }
    @Override
    public void OnDisable(){
    getLogger().info("Realms v.1.0 has been disabled");
    getServer().getPluginManager().registerEvents(new playerlogin(), this);
    }
    }

    Will this achieve what im trying to do. Im trying to get the plugin to log a message to the console saying the plugin is activated. I am then trying to get the plugin to register the event in a listener that ill show further down.

    Listener/Playerlogin code;

    package dckillerman123.realms;

    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerLoginEvent;

    public class playerlogin implements Listener {


    @EventHandler
    public void onPlayerLogin(PlayerLoginEvent event) {
    System.out.println("Welcome to Minecraft");

    }

    }

    Will this send a message that only the player can see when he logs in saying "Welcome to Minecraft". Will this work as a listener or how will i go about setting it up.

    President class code;
    package dckillerman123.realms;

    import org.bukkit.plugin.java.JavaPlugin;

    public class president extends JavaPlugin{

    char president1;
    char law;
    char salary;




    }
    This is where my main question comes into play. How can i go about making ranks like thos in groupmanager or the likes. I want it to be that the president is a rank and he has certain commands which i know i use the OnCommand() function for along with a listener maybe to register the event ? How can i make this class have president features and let him control the other ranks/classes using commands in game. If i want to make it that the president has colour codes like &4 will i just use the default minecraft codes ??.


    Thanks for your help guys.

  2. #2
    gimbal2 is online now Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,750
    Rep Power
    5

    Default Re: Minecraft Plugin Help

    Eh no, this is the very worst place to start. Minecraft plugins are for people who already know Java through and through. Start with a good book to learn the actual language and object oriented programming concepts.
    KevinWorkman likes this.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,882
    Rep Power
    8

    Default Re: Minecraft Plugin Help

    What gimbal2 said.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  4. #4
    Join Date
    Sep 2013
    Posts
    4
    Rep Power
    0

    Default Re: Minecraft Plugin Help

    id like my question answered :P

  5. #5
    Join Date
    Sep 2013
    Posts
    4
    Rep Power
    0

    Default Re: Minecraft Plugin Help

    i already code php and javascript and i have a fair understanding of c++

  6. #6
    gimbal2 is online now Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,750
    Rep Power
    5

    Default Re: Minecraft Plugin Help

    Nothing changes.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  7. #7
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,882
    Rep Power
    8

    Default Re: Minecraft Plugin Help

    Quote Originally Posted by dckillerman123 View Post
    id like my question answered :P
    Your question was answered.

    It's like you asking how to replace the engine in a race car. The correct answer is to work on another car first for practice, get good at changing tires and replacing oil, then move on to more complicated stuff like replacing the engine. Even if you have practice with motorcycles, you're going to have to learn the basics before doing anything else.

    There isn't a shortcut. If you don't know the basics, you aren't going to get very far.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  8. #8
    Join Date
    Sep 2013
    Posts
    4
    Rep Power
    0

    Default Re: Minecraft Plugin Help

    That wasnt the question i asked. I asked was i taking the right steps in the code above. How can i learn if you refuse to help me with my queston. I will learn to code my own way like i have done for php and javascript.

  9. #9
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,882
    Rep Power
    8

    Default Re: Minecraft Plugin Help

    The short answer to your question is we don't know without seeing an SSCCE. You've only shown us an incomplete snippet, so we have no idea what this code does. It's a bit like showing us a car door and asking us how fast the car it was originally attached to is going.

    But you presumably understand the context of this program, so you should be able to pretty easily step through the code and see what it does. If you can't do that, it suggests that you might be biting off more than you can chew.

    We are trying to help, and you'll get the same "creating minecraft mods is not a good way to learn Java" advice everywhere you go. Good luck though.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Minecraft dev needed, will pay $$
    By nate252 in forum Jobs Offered
    Replies: 0
    Last Post: 09-04-2012, 01:45 AM
  2. Java - Plugin for Minecraft
    By Modz in forum New To Java
    Replies: 1
    Last Post: 08-19-2012, 02:33 PM
  3. Help with minecraft and Java
    By Lipton in forum New To Java
    Replies: 0
    Last Post: 03-28-2011, 09:22 PM
  4. Replies: 0
    Last Post: 12-16-2010, 10:14 AM
  5. AnyEdit Plugin For Eclipse Plugin
    By JavaForums in forum Eclipse
    Replies: 0
    Last Post: 05-18-2007, 12:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •