Solved Command Code Issue

Discussion in 'Plugin Development' started by SilverCoin3, Apr 24, 2014.

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

    SilverCoin3

    Hi,
    I have this error in game saying: Internal Error Has Occured.
    In the command code in the "spawn " part it is the only thing in the plugin code that has a error how do I fix that it says this: The left-hand side of an assignment must be a variable what do i do to fix this error?
    Please get back to me as soon as you can.
     
  2. Offline

    BillyBobJoe168

  3. Offline

    SilverCoin3

    This is part of the command code:
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    if(sender instanceof Player) {
    Player player = (Player) sender;
    if(cmd.getName().equalsIgnoreCase("zing")){
    String Zing = "spawn " = player.getName();
    Bukkit.dispatchCommand(Bukkit.getConsoleSender(), Zing);
    player.sendMessage(ChatColor.AQUA + "Returning to Hub!");

    Any ideas i have been trying to work it out for more than 4+hours

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  4. Offline

    BillyGalbreath

    Here is issue:

    String Zing = "spawn " = player.getName();

    More specifically, this part:

    "spawn " = player.getName();

    I assume you meant to put + instead of =
     
    SilverCoin3 likes this.
  5. Offline

    SilverCoin3

    Thankyou so much you fixed it
     
  6. Offline

    BillyGalbreath

    Now that I've pointed it out did you learn what the error was saying?
     
  7. Offline

    SilverCoin3

    Yes it was right in front of me
     
    BillyGalbreath likes this.
Thread Status:
Not open for further replies.

Share This Page