Plugin JoinMessage problem

Discussion in 'Spigot Plugin Help' started by Deiutz, May 27, 2017.

Thread Status:
Not open for further replies.
  1. when i join on server don`t give me the message... and i don`t have bugs in console... why?

    Code (Text):

    package ro.deiutz.joinmessage;


    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.entity.Player;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.plugin.java.JavaPlugin;

    public class Main extends JavaPlugin implements Listener {
       
        @Override
        public void onEnable() {
           
            getLogger().info("JoinMessage has been Enabled");
           
            Bukkit.getPluginManager().registerEvents(this, this);
            getConfig().options().copyDefaults(true);
            saveConfig();
           
        }
       
        @Override
        public void onDisable() {
           
            getLogger().info("JoinMessage has been Disabled");
           
           
        }
        public void JoinPlayer(PlayerJoinEvent e) {
           
            Player p = e.getPlayer();
            p.sendMessage(getConfig().getString(ChatColor.translateAlternateColorCodes('&', "Message")));
        }

    }

     
    help me plz!
     
  2. oh i forget ... i will place now and i will test it
     
  3. Now i have this bug in console i think is from config but i don`t know what is wrong



    Code (Text):

    [15:25:51 INFO]: [JoinMessage] Enabling JoinMessage v1.0
    [15:25:51 INFO]: [JoinMessage] JoinMessage has been Enabled
    [15:25:51 ERROR]: [JoinMessage] Cannot load configuration from jar
    org.bukkit.configuration.InvalidConfigurationException: Top level is not a Map.
            at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlCo                    nfiguration.java:59) ~[spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
            at org.bukkit.plugin.java.JavaPlugin.reloadConfig(JavaPlugin.java:214) [                    spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
            at org.bukkit.plugin.java.JavaPlugin.getConfig(JavaPlugin.java:162) [spi                    got-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
            at ro.deiutz.joinmessage.Main.onEnable(Main.java:20) [WelcomeMessage.jar                    :?]
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) [sp                    igot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader                    .java:340) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManage                    r.java:405) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
            at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.jav                    a:357) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
            at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.                    java:317) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
            at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:4                    14) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
            at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:3                    78) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
            at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:3                    33) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
            at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.jav                    a:263) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
            at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java                    :525) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]

     
     
  4. Change the color translate color to replace method with & to ChatColor.char_symbol or something like that

    Envoyé de mon SM-G530W en utilisant Tapatalk
     
  5. org.bukkit.configuration.InvalidConfigurationException: Top level is not a Map.
    Can we see your plugin.yml?
     
Thread Status:
Not open for further replies.