How can my plugin.yml not be correct....

Discussion in 'Plugin Development' started by yewtree8, Feb 25, 2014.

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

    yewtree8

    The Name of the project is EffectSigns as it doesn't show it there, can someone tell me how to fix this?

    Plugin.yml :
    Code:
    name: EffectSigns
    main: me.mat.effectsigns.Main
    version: 0.1
    author: Mat 
    description: Use Signs To Give Players Potion Effects

    Main Class
    Code:java
    1. package me.mat.effectsigns;
    2.  
    3. import org.bukkit.plugin.PluginManager;
    4. import org.bukkit.plugin.java.JavaPlugin;
    5.  
    6. public class Main extends JavaPlugin {
    7.  
    8. public void onEnable() {
    9.  
    10. System.out.println("EffectSigns Enabled");
    11.  
    12. PluginManager pm = getServer().getPluginManager();
    13.  
    14. pm.registerEvents(new PlayerListener(), this);
    15. pm.registerEvents(new SignListener(), this);
    16.  
    17.  
    18. }
    19.  
    20.  
    21. public void onDisable() {
    22.  
    23. System.out.println("EffectSigns Disabled");
    24.  
    25. }
    26.  
    27.  
    28.  
    29. }



    PlayerListener:

    Code:java
    1. package me.mat.effectsigns;
    2.  
    3. import org.bukkit.Bukkit;
    4. import org.bukkit.ChatColor;
    5. import org.bukkit.Material;
    6. import org.bukkit.block.Sign;
    7. import org.bukkit.entity.Player;
    8. import org.bukkit.event.EventHandler;
    9. import org.bukkit.event.Listener;
    10. import org.bukkit.event.block.Action;
    11. import org.bukkit.event.player.PlayerInteractEvent;
    12.  
    13. public class PlayerListener implements Listener {
    14.  
    15. @EventHandler
    16. public void interact(PlayerInteractEvent event) {
    17. Player player = event.getPlayer();
    18. Action action = event.getAction();
    19. Material block = event.getClickedBlock().getType();
    20. if(action == Action.RIGHT_CLICK_BLOCK) {
    21. if(block == Material.SIGN_POST || block == Material.WALL_SIGN) {
    22. Sign sign = (Sign)(event.getClickedBlock().getState());
    23. String line1 = sign.getLine(0);
    24. String line2 = sign.getLine(1);
    25. if (player.hasPermission("effectsigns.speed")) {
    26. if (line1.contains("[EffectSigns]") && line2.contains("Speed")) {
    27.  
    28. Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(),"potion " + player.getName() + " speed 120 2");
    29.  
    30. player.sendMessage(ChatColor.GREEN + "You Were Given The Effect" + ChatColor.AQUA + " Speed" + ChatColor.GREEN + " For 2 Minutes");
    31. }
    32. } else {
    33. player.sendMessage(ChatColor.RED + "You Do Not Have Permission To Use A Speed Sign");
    34. }
    35.  
    36. }return; //return for block
    37.  
    38.  
    39. }return; //return for action
    40. }
    41.  
    42.  
    43.  
    44. }
    45.  
    46.  
    47.  



    Then There is the sign listener:

    Code:java
    1. package me.mat.effectsigns;
    2.  
    3. import org.bukkit.ChatColor;
    4. import org.bukkit.entity.Player;
    5. import org.bukkit.event.EventHandler;
    6. import org.bukkit.event.Listener;
    7. import org.bukkit.event.block.SignChangeEvent;
    8.  
    9. public class SignListener implements Listener {
    10.  
    11. @EventHandler
    12. public void Sign(SignChangeEvent event) {
    13. String line1= event.getLine(0);
    14. String line2 = event.getLine(1);
    15. Player player = event.getPlayer();
    16. if(player.hasPermission("effectsigns.admin.speed")) {
    17. if(line1.equalsIgnoreCase("[EffectSigns]")) {
    18. if(line2.equalsIgnoreCase("Speed")) {
    19. event.setLine(0, ChatColor.DARK_AQUA + "[" + ChatColor.LIGHT_PURPLE + "EffectSigns" + ChatColor.DARK_AQUA + "]");
    20. event.setLine(1, ChatColor.DARK_PURPLE + "Speed");
    21. } return;
    22. } return;
    23. } else {
    24. player.sendMessage(ChatColor.RED + "You Do Not Have The Permission " + ChatColor.GREEN + "effectsigns.admin.speed");
    25. }
    26.  
    27.  
    28. }
    29.  
    30.  
    31.  
    32.  
    33. }
    34.  



    and then when i startup the test server it throws up a huge error message, it says it is because of te plugin.yml? i am so confused
     
  2. Offline

    adam753

    Post the error message.
    Oh, also, you posted your SignListener twice instead of the main class.
     
  3. Offline

    yewtree8

  4. Surround the authors (so, in this case "Mat") with these [] (so like: "authors: [Mat]") I am not sure why this is required, but it should fix your problem.
     
  5. Offline

    adam753

    Datdenkikniet
    That's required for authors, not author.
    Code:
    author: Me
    authors: [Me, You]
    
    yewtree8
    Can you post the error message you get?
     
  6. Offline

    Sagacious_Zed Bukkit Docs

    Bukkit expects a single scalar value for author It expects a list of scalar values for authors
     
  7. Offline

    ninja_ace202

    Without seeing the error my best guess is you used an indent (Tab key) instead of a space somewhere in your plugin.yml you can't do that.
     
    yewtree8 likes this.
  8. Offline

    yewtree8




    And he solves it
     
Thread Status:
Not open for further replies.

Share This Page