I m new to this plugin thing.. so help me allitle :P

Discussion in 'Plugin Development' started by Cr4zy[Box], Sep 13, 2012.

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

    Cr4zy[Box]

    How can i get what the player writes.. like if he writes "/trol" somthing happends?

    plz guys...

    its the only thing i ask!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  2. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı Retired Staff

  3. Offline

    Woobie

    That is the basic code for commands..
    Code:
        public boolean onCommand(CommandSender sender, Command cmd, String commandText, String[] args) {
            Player p = (Player)sender;
            if(cmd.getName().equalsIgnoreCase("trol)){
                //do something
    

    This is just a simple code that sends a message if someones types /trol
    Code:
        public boolean onCommand(CommandSender sender, Command cmd, String commandText, String[] args) {
            Player p = (Player)sender;
            if(cmd.getName().equalsIgnoreCase("trol")){
                sender.sendMessage(ChatColor.YELLOW +"trolololololololololo"());
            }
        }
     
    }
    
     
  4. Offline

    Cr4zy[Box]

    hmm, it needs to return.. what to return?..

    HTML:
    public class TestPluginListener implements Listener {
     
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args, Player p){
    if(cmd.getName().equalsIgnoreCase("build")){ 
    p.getPlayer();
    p.setFlying(true);
    p.setGameMode(GameMode.CREATIVE);
    Bukkit.getServer().broadcastMessage(p.getDisplayName() + ChatColor.YELLOW +" is now in contruction mod!");
    return true;
    }
    return false;
    }
    why that dont work?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  5. Offline

    A3O2

    check that you registered it in your plugin.yml
     
  6. Offline

    TCWilliford

    you need to know java to make plugins..
     
  7. Offline

    Cr4zy[Box]

    hmm .. how to doo that :p

    keep that for you, i dont need somthing soo obviouse as that. -_-

    if u think you are the best and the others are some kinda of a noobs and dont start learning the programming lenguage , then you r soo wrong.. i learned c++ by starting codding cheats for a game...

    and dont even think talking about my English :) -.-

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  8. Offline

    TCWilliford

    Just saying... :'(
     
  9. Offline

    Cr4zy[Box]

    I m also just saying that i hate that :)
     
  10. Offline

    XepherLink

    Cr4zy people rarely will help you because they don't know how to code themselves so I suggest just looking for a answer on google, or ask in the TEAM AVO forums because they have more mature experienced coders.
     
    Cr4zy[Box] likes this.
  11. Offline

    skore87

    Cr4zy[Box] You continually reply to my posts on other member's threads to do a simple search but fail to recognize that you too need to do one. Going to another source such as the AVO forums will yield the same results. There are numerous tutorials for the beginning plugin developer that people spend their time writing so that you do not have to ask these questions and be bombarded with the "Use the search" kind replies that you are getting.
     
  12. Offline

    Cr4zy[Box]

    I doo suggest you to read my newest reply and i still didnt made it after shearching, and after this thread...
     
  13. Offline

    Squish000

    Its been posted before, but ill rephrase it.

    1. Learn Java
    2. Read this http://wiki.bukkit.org/Plugin_Tutorial
    3. Go through the bukkit javadocs to familiarize with the system+events
     
    devilquak and zack6849 like this.
  14. Offline

    Cr4zy[Box]

    maybe just a fast tutorial and i m done! ... omg
     
  15. Offline

    skore87

    At least it only took two people to post the same link for you to look at it....
     
  16. Offline

    Sagacious_Zed Bukkit Docs

    If at first they don't learn, try and try again.
     
  17. Offline

    skore87

    ... to hit your head on a brick wall. :p
     
  18. Offline

    Squish000

    And you'll be done until you run into another small problem 5 seconds later, so you'll post another thread asking 'Help mee wth this smal prooblem pls!!!'.
    You need to learn how to do independent research instead of being spoon fed all time, otherwise you'll get nowhere in life.
     
    zack6849 and skore87 like this.
  19. Offline

    Cr4zy[Box]

    well, thx for the help, i wil try to post my stuff without commands needed .. [pig]
     
  20. Offline

    XepherLink

    Why did you put your java listener in the same file as the onCommand put it in the main java file
     
  21. Offline

    Jnorr44

    Incorrect. Almost everyone in the Plugin Development section knows Java. It's just that we get like 3 of these "new dev" posts every day, and we have our own plugins to write.

    And why would TEAM AVO have more experienced "coders" (programmers/devs btw) than the dev forums? Some of the best developers on Bukkit come here. (Bukkit staff, Icyene, desht, ferrybig, hawkfalcon, etc, and me :D)
     
    zack6849 likes this.
  22. Offline

    Odie680

    Jnorr,
    One of the huge plugin devs are from Team aVo... I don't know who though. It was from last year July. That developer gets the NoCheatPlus or NoCheat code and finds exploits to it. How else do you think they made their NoCheatBypass stuff... Sorry for going off topic here :p
    ~Odie680
     
  23. Offline

    Jnorr44

    This would be the place to look though for help with bukkit. If it's Java help in general, StackOverflow is an amazing tool.
     
  24. Offline

    A3O2

    click this ClickMe it should help you. :)
     
  25. Offline

    wacossusca34

    [​IMG]

    Let me tell you a little tip: Learning how to code a completely different language from modifying your video games will result in bad code habits and a limited knowledge.

    If you didn't actually learn Java and you are basing your currently knowledge on Java from C++, then you will have issues. Java is an Object Orientated language, and many things are different in it. A transition from C++ and Java is not as easy as you think, especially when you learned C++ from modding games.

    My advice is to actually learn Java first, working from the bottom up. Learning the whole languages from Oracle's documentation will allow you to have a full understanding of the language, and you will be able to code a little more than small edits to games.
     
    zack6849 likes this.
Thread Status:
Not open for further replies.

Share This Page