Development Assistance sender not working

Discussion in 'Plugin Help/Development/Requests' started by EthanB7272, Jan 28, 2015.

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

    EthanB7272

    Whenever i type a line of code with sender in it, it turns red, for instance. I type sender.sendMessage("Test"); and sender is underlined in red.. and wont fix.. help?
     
  2. Offline

    LordDarthBob

  3. Offline

    TGRHavoc

    Um.. Maybe "sender" doesn't exist...
     
  4. Offline

    EthanB7272

    I was trying to do sender.sendMessage("&l&cMniGame HG Help")
     
  5. @EthanB7272 Well one, no ";". Second, please post full class so we can see the issues and help you correct them.
     
  6. Offline

    LordDarthBob

    When adding color to messages, rather than using the "&" symbol, use "ยง" or "ChatColor."
    Code:
    sender.sendMessage(ChatColor.RED + ChatColor.BOLD + "Minigame HG Help");
    
    If it's any help to you, the onCommand method should look something like this:
    Code:
    public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
    if(cmd.getName().equals("command")){
    sender.sendMessage("Testing");
    }
    return true;
    }
    
    You can use this as a reference when creating your plugin if you'd like, although I'd recommend that you post your entire block of code so that people can give you more helpful information.
     
    Last edited: Jan 29, 2015
  7. Offline

    EthanB7272

    Ok i fixed it but now i get this error in console when i try to load it


    [16:41:52 WARN]: Plugin `Explosive_Arrows v1.0' uses the space-character (0x20)
    in its name `Explosive Arrows' - this is discouraged
    [16:41:52 INFO]: Set PluginClassLoader as parallel capable
    [16:41:53 ERROR]: Could not load 'plugins\ExplosiveArrows.jar' in folder 'plugin
    s'
    org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError
    : com/EthanPlayz/ExplosiveArrows/Core : Unsupported major.minor version 52.0
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:133) ~[spigot.jar:git-Spigot-1649]
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:341) ~[spigot.jar:git-Spigot-1649]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:263) [spigot.jar:git-Spigot-1649]
    at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadPlugins(CraftServer.ja
    va:369) [spigot.jar:git-Spigot-1649]
    at org.bukkit.craftbukkit.v1_7_R4.CraftServer.reload(CraftServer.java:86
    4) [spigot.jar:git-Spigot-1649]
    at org.bukkit.Bukkit.reload(Bukkit.java:301) [spigot.jar:git-Spigot-1649
    ]
    at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:
    23) [spigot.jar:git-Spigot-1649]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:18
    1) [spigot.jar:git-Spigot-1649]
    at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchCommand(CraftServe
    r.java:767) [spigot.jar:git-Spigot-1649]
    at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchServerCommand(Craf
    tServer.java:753) [spigot.jar:git-Spigot-1649]
    at net.minecraft.server.v1_7_R4.DedicatedServer.aB(DedicatedServer.java:
    326) [spigot.jar:git-Spigot-1649]
    at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:2
    90) [spigot.jar:git-Spigot-1649]
    at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:5
    84) [spigot.jar:git-Spigot-1649]
    at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java
    :490) [spigot.jar:git-Spigot-1649]
    at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:6
    28) [spigot.jar:git-Spigot-1649]
    Caused by: java.lang.UnsupportedClassVersionError: com/EthanPlayz/ExplosiveArrow
    s/Core : Unsupported major.minor version 52.0
    at java.lang.ClassLoader.defineClass1(Native Method) ~[?:1.7.0_75]
    at java.lang.ClassLoader.defineClass(Unknown Source) ~[?:1.7.0_75]
    at java.security.SecureClassLoader.defineClass(Unknown Source) ~[?:1.7.0
    _75]
    at java.net.URLClassLoader.defineClass(Unknown Source) ~[?:1.7.0_75]
    at java.net.URLClassLoader.access$100(Unknown Source) ~[?:1.7.0_75]
    at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.7.0_75]
    at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.7.0_75]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_
    75]
    at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.7.0_75]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:101) ~[spigot.jar:git-Spigot-1649]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:86) ~[spigot.jar:git-Spigot-1649]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.7.0_75]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.7.0_75]
    at java.lang.Class.forName0(Native Method) ~[?:1.7.0_75]
    at java.lang.Class.forName(Unknown Source) ~[?:1.7.0_75]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.jav
    a:64) ~[spigot.jar:git-Spigot-1649]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:129) ~[spigot.jar:git-Spigot-1649]
    ... 14 more
     
  8. Offline

    timtower Administrator Administrator Moderator

    @EthanB7272 That is compiling with java 8 and running with 7
     
  9. Offline

    EthanB7272

    this is a seperate plugin.. but i use it for the HG Plugin and its working.. but i have this error in console with the other plugin
     
  10. Offline

    nverdier

    @EthanB7272

    What could you do to change that?
     
Thread Status:
Not open for further replies.

Share This Page