I get an error with this code:
ERROR: if ((goto == 791) || (!w.equals("Sugar"))) {
and error is:
1. ERROR 1,LINE 190: Syntax error on token "goto", invalid Expression
2. ERROR 2,LINE 231: Type mismatch: cannot convert from World to String
3. ERROR 3,LINE 238: The operator && is undefined for the argument type(s)int,boolean
what do I do?
Code: http://pastebin.com/vH4y2gTW sorry, couldn't post code here because the format doesn't show numbered lines..
ERROR 1,LINE 190: Syntax error on token "goto", invalid Expression
You can't call a variable goto, that is a reserved word in Java.
ERROR 2,LINE 231: Type mismatch: cannot convert from World to String
You have a variable that contains a World; and you want to turn that into a string (by casting, or passing in the wrong place). Try
worldObject.toString()
instead. But you know, programming is not about "stopping the compiler from complaining". It is about "doing the correct thing". So maybe you can just use that call to create a string representation of that World; but maybe you are doing something really wrong; and should be doing something else completely.
ERROR 3,LINE 238: The operator && is undefined for the argument type(s)int,boolean
Simple: you cant do
intVar && booleanVar
Simply because && is a the logical AND operator; and that only works with two boolean arguments. In Java, you can't use numbers for AND, OR, and so on!
The real answer here: these are absolut java basics. You should really not need to turn to other people in order to translate those already clear, human readable compiler error messages.
My personal recommendation here: spent some time studying such java basics. There is no point in trying to write code for Minecraft when you think you need to turn to us for such subtleties. In other words: learn to crawl before you try to run.