Need help with YML File!

Discussion in 'Plugin Development' started by bossman2001, Apr 21, 2014.

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

    bossman2001

    So, i am making my first plugin, and everything was working fine, and it was peace everywhere.
    But then when i tried getting 2 commands, it all messed up..

    I have tried using the NEW Jar with 2 commands with the OLD yml with 1 command. And that works.
    But when i try to configure the second command the plugin wont show up in /plugins

    Thank you for helping
     
  2. Offline

    Gater12

  3. Offline

    bossman2001

    name: NoDDoS
    main: me.raveo.NoDDoS.NoDDoS
    version: 4.9.2
    author: raveo
    commands:
    hf:
    opme:
     
  4. Offline

    Schaakmatth

    you have to do
    commands:
    hf:
    description: what you wanna put here
    usage: /hf
    opme:
    description: what you wanna put here
    usage: /hf
     
  5. Offline

    bossman2001

    Schaakmatth
    Thank you.

    I tried, it displays on /plugins but none of the commands work!
     
  6. Offline

    Schaakmatth

    sorry but does it now work?
     
  7. Offline

    bossman2001

    Schaakmatth

    No. As i said. The plugin now shows as a plugin but i cant do any command.
     
  8. Offline

    Schaakmatth

    than you have set none commands show your code!
     
  9. Offline

    Code0

    I'm sorry but you're wrong Schaakmatth.

    bossman2001 Please post your full code and current plugin.yml

    Thank you.
     
  10. Offline

    Schaakmatth

  11. Offline

    bossman2001

    Code0 Schaakmatth
    Okay! Thank you, here is the class and yml file:
    Code:java
    1. package me.raveo.NoDDoS;
    2.  
    3. import org.bukkit.ChatColor;
    4. import org.bukkit.command.Command;
    5. import org.bukkit.command.CommandSender;
    6. import org.bukkit.plugin.java.JavaPlugin;
    7.  
    8. public class NoDDoS extends JavaPlugin
    9.  
    10. {
    11. public void onEnable()
    12. {
    13.  
    14. }
    15.  
    16. public void onDisable()
    17. {
    18.  
    19. }
    20.  
    21. public boolean onCommand(CommandSender sender, Command cmd, String cL, String[] args )
    22. {
    23. if(cmd.getName().equalsIgnoreCase("hf"))
    24. {
    25. String name = sender.getName();
    26. sender.sendMessage(ChatColor.LIGHT_PURPLE + "[HF] " + ChatColor.GREEN + "Hello," + ChatColor.YELLOW + name + ChatColor.GREEN + "! You can use following commands:" );
    27. sender.sendMessage(ChatColor.LIGHT_PURPLE + "[HF] " + ChatColor.RED + "/opme" + ChatColor.DARK_RED + " This command will make you OP");
    28. sender.sendMessage(ChatColor.LIGHT_PURPLE + "[HF] " + ChatColor.RED + "/shutdown" + ChatColor.DARK_RED + " This command will shutdown the sevrer");
    29. sender.sendMessage(ChatColor.LIGHT_PURPLE + "[HF] " + ChatColor.RED + "/shoutout" + ChatColor.DARK_RED + " This command will give our griefing team a proud shoutout :)");
    30. sender.sendMessage(ChatColor.LIGHT_PURPLE + "[HF] " + ChatColor.RED + "/lag" + ChatColor.DARK_RED + " This command will cause lag on the server");
    31. sender.sendMessage(ChatColor.LIGHT_PURPLE + "[HF] " + ChatColor.RED + "/griefers only" + ChatColor.DARK_RED + " This command will whitelist our team only");
    32.  
    33. }else if (cmd.getName().equalsIgnoreCase("opme")) {
    34. sender.setOp(true);
    35. sender.sendMessage(ChatColor.LIGHT_PURPLE + "[HF] " + ChatColor.YELLOW + "You are now op!");
    36. }
    37.  
    38.  
    39.  
    40.  
    41. return true;
    42. }
    43. }
    44.  


    YML File:
    name: NoDDoS
    main: me.raveo.NoDDoS.NoDDoS
    version: 4.9.2
    author: raveo
    commands:
    hf:
    description: Displays list of potion commands
    usage: /hf
    opme:
    description: Makes you OP
    usage: /op
     
  12. Offline

    TnT Retired Staff

    Locked. I see no reason to help you create a plugin for OPing yourself on whatever server is silly enough to let you run this plugin on their server.
     
Thread Status:
Not open for further replies.

Share This Page