!help command plugin

Discussion in 'Plugin Development' started by Richard101, Aug 3, 2014.

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

    Richard101

    Hello,

    I have seen on many servers where players say something in chat such as !help, and it will say something in chat. I have been looking everywhere on how to do this. How could I make something like this? Thanks!
     
  2. Offline

    JustinsCool15

  3. Offline

    ToPoEdiTs

  4. Offline

    Richard101

    JustinsCool15 Ok, I did that but now every time someone talks in chat it will say something when I want it to be so that when a player says only "!faq" it will say something. See my code:
    Code:java
    1. public class Main extends JavaPlugin {
    2.  
    3. public final Events ev = new Events();
    4.  
    5. @EventHandler
    6. public void onChat(AsyncPlayerChatEvent e){
    7. if(e.getMessage().toLowerCase().contains("!faq"));
    8. Bukkit.broadcastMessage("§c[§eFAQ§c] §aIt Worked!");
    9. }
    10.  
    11. public void onEnable() {
    12. getLogger().info("FAQ Enabled!");;
    13. PluginManager pm = getServer().getPluginManager();
    14. pm.registerEvents(ev, this);
    15. }
    16.  
    17. public void onDisable() {
    18. getLogger().info("FAQ Disabled!");
    19. }
    20. }
     
  5. Offline

    AoH_Ruthless

    Richard101
    1. Your if statement has a semicolon
    2. You aren't implementing listener
    3. Other issues
    4. Most importantly, you don't know Java. I would strongly advise you learn the language first before you proceed further. You are basically trying to learn how to ride a bicycle for the first time without learning how to walk first.
     
Thread Status:
Not open for further replies.

Share This Page