Jump to content
  • 0
Sign in to follow this  
Red122

Error when adding custom item PI?

Question

Here is my itemdef with the int


switch (itemdef.id) {
case 11722:
itemDef.femaleEquip1 = itemDef.maleEquip1;
itemDef.femaleEquip2 = itemDef.maleEquip2;
break;

case 11740:
{
itemdef.modelID = 20087;
itemdef.name = "Owner Wings";
itemdef.modelZoom = 850;
itemdef.modelRotation1 = 252;
itemdef.modelRotation2 = 1020;
itemdef.modelOffset1 = -1;
itemdef.modelOffset2 = 24;
itemdef.anInt165 = 20086;
itemdef.anInt165 = 20086;
itemdef.groundActions = new String[5];
itemdef.groundActions[2] = "Take";
itemdef.itemActions = new String[5];
itemdef.itemActions[1] = "Wear";
itemdef.itemActions[4] = "Drop";
}



When i try and compile it i get this error




ItemDef.java:235: error: cannot find s
switch (itemde
^
symbol: variable itemdef
location: class ItemDef
ItemDef.java:235: error: illegal start
switch (itemde
^
ItemDef.java:243: error: cannot find s
itemdef.modelID = 20087;
^
symbol: variable itemdef
location: class ItemDef
ItemDef.java:244: error: cannot find s
itemdef.name = "Owner Wings";
^
symbol: variable itemdef
location: class ItemDef
ItemDef.java:245: error: cannot find s
itemdef.modelZoom = 850;
^
symbol: variable itemdef
location: class ItemDef
ItemDef.java:246: error: cannot find s
itemdef.modelRotation1 = 252;
^
symbol: variable itemdef
location: class ItemDef
ItemDef.java:247: error: cannot find s
itemdef.modelRotation2 = 1020;
^
symbol: variable itemdef
location: class ItemDef
ItemDef.java:248: error: cannot find s
itemdef.modelOffset1 = -1;
^
symbol: variable itemdef
location: class ItemDef
ItemDef.java:249: error: cannot find s
itemdef.modelOffset2 = 24;
^
symbol: variable itemdef
location: class ItemDef
ItemDef.java:250: error: cannot find s
itemdef.anInt165 = 20086;
^
symbol: variable itemdef
location: class ItemDef
ItemDef.java:251: error: cannot find s
itemdef.anInt165 = 20086;
^
symbol: variable itemdef
location: class ItemDef
ItemDef.java:252: error: cannot find s
itemdef.groundActions = new String[5];
^
symbol: variable itemdef
location: class ItemDef
ItemDef.java:253: error: cannot find s
itemdef.groundActions[2] = "Take";
^
symbol: variable itemdef
location: class ItemDef
ItemDef.java:254: error: cannot find s
itemdef.itemActions = new String[5];
^
symbol: variable itemdef
location: class ItemDef
ItemDef.java:255: error: cannot find s
itemdef.itemActions[1] = "Wear";
^
symbol: variable itemdef
location: class ItemDef
ItemDef.java:256: error: cannot find s
itemdef.itemActions[4] = "Drop";
^
symbol: variable itemdef
location: class ItemDef
Note: client.java uses unchecked or un
Note: Recompile with -Xlint:unchecked
16 errors
Press any key to continue . . .




Any help would be awesome thanks guys.

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0
anyone?

Share this post


Link to post
Share on other sites
  • 0
You have a few things going on here. Probably one error is contributing to all the others, but I'll try to outline the issue.

So the first one I see is it cannot find the symbol "itemdef". This means that while you have imported the file "ItemDef.java" you have not created an instance of that class.

Now in plain terms, you haven't created code like this:
[CODE]
ItemDef itemdef = new ItemDef();
[/code]

Above the code that it's printing out in the compiler/error log.

This piece:
[CODE]
new ItemDef();
[/code]

Is creating a new instance, off the constructor. Now I believe that that constructor should have a variable within it, so you need to check ItemDef.java to see what variables it's asking for (most likely an item id: new ItemDef(4151);)

Next you have an 'illegal start'. This most likely means you closed a bracket or left one open somewhere, which is causing all the other stuff to be off. Look over your code, it's most likely a small thing.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×