Console can't broadcast messages?

Discussion in 'Spigot Help' started by Carson740, Jun 17, 2018.

  1. No matter what plugin I use, what command I use, the console cannot broadcast a message to the server. Announcer doesn't work, ChatManager doesn't work, even /broadcast doesn't work. I'll post the log for when I do try to broadcast through the console and hopefully someone can help me out with this?

    >broadcast test
    [00:45:00 WARN]: Unexpected exception while parsing console command "broadcast test"
    org.bukkit.command.CommandException: Unhandled exception executing command 'broadcast' in plugin ChatManager v7.0
    at org.bukkit.command.PluginCommand.execute( ~[spigot-1.12.2.jar:git-Spigot-2086bb0-2f3ed3b]
    at org.bukkit.command.SimpleCommandMap.dispatch( ~[spigot-1.12.2.jar:git-Spigot-2086bb0-2f3ed3b]
    at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand( ~[spigot-1.12.2.jar:git-Spigot-2086bb0-2f3ed3b]
    at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchServerCommand( [spigot-1.12.2.jar:git-Spigot-2086bb0-2f3ed3b]
    at net.minecraft.server.v1_12_R1.DedicatedServer.aP( [spigot-1.12.2.jar:git-Spigot-2086bb0-2f3ed3b]
    at net.minecraft.server.v1_12_R1.DedicatedServer.D( [spigot-1.12.2.jar:git-Spigot-2086bb0-2f3ed3b]
    at net.minecraft.server.v1_12_R1.MinecraftServer.C( [spigot-1.12.2.jar:git-Spigot-2086bb0-2f3ed3b]
    at [spigot-1.12.2.jar:git-Spigot-2086bb0-2f3ed3b]
    at Source) [?:1.8.0_131]
    Caused by: java.lang.ClassCastException: org.bukkit.craftbukkit.v1_12_R1.command.ColouredConsoleSender cannot be cast to org.bukkit.entity.Player
    at me.SgtBud.ChatManager.Commands.Broadcast.onCommand( ~[?:?]
    at org.bukkit.command.PluginCommand.execute( ~[spigot-1.12.2.jar:git-Spigot-2086bb0-2f3ed3b]
    ... 8 more​
  2. foncused

    Moderator Patron

    Looks like someone forgot to do an instanceof check on the sender before casting to Player.
    Code (Java):
    if(sender instanceof Player) {
        Player player = (Player) sender;
  3. I actually just went through my files and deleted some unused plugins and when I restarted the server it worked perfectly fine. Not sure what plugin caused it, but I'm definitely glad that headache is over