org.mozilla.javascript.WrappedException: Wrapped java.lang.ClassCastException: org.mozilla.javascript.UniqueTag cannot be cast to java.lang.Number (RPGWeapons.js#58)
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(Unknown Source)
at org.mozilla.javascript.FunctionObject.call(Unknown Source)
at org.mozilla.javascript.Interpreter.interpretLoop(Unknown Source)
at script(RPGWeapons.js:58)
at org.mozilla.javascript.Interpreter.interpret(Unknown Source)
at org.mozilla.javascript.InterpretedFunction.call(Unknown Source)
at org.mozilla.javascript.ContextFactory.doTopCall(Unknown Source)
at org.mozilla.javascript.ScriptRuntime.doTopCall(Unknown Source)
at org.mozilla.javascript.InterpretedFunction.exec(Unknown Source)
at net.zhuoweizhang.mcpelauncher.ScriptManager.initJustLoadedScript(ScriptManager.java:237)
at net.zhuoweizhang.mcpelauncher.ScriptManager$ParseThread.run(ScriptManager.java:163)
at java.lang.Thread.run(Thread.java:841)
Caused by: java.lang.ClassCastException: org.mozilla.javascript.UniqueTag cannot be cast to java.lang.Number
at net.zhuoweizhang.mcpelauncher.ScriptManager$NativeItemApi.addShapedRecipe(ScriptManager.java:2506)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
0
Ign:Behindthescreen
Exp:A couple of servers
Banned:No Bans
Servers:They were shut down,didn't have enough money
Youtube:Yes,but just to comment on videos
Age:why do you need to know this?
Sex:Now, why do you need to know this?!!!
Kik:if you accept it ill pm it
Skype:no Skype
Twitter:@B3HINDTH3SCR33N
0
I think it is
0
Ok thank you.
0
Like the title says I need help with custom mobs if anyone could show me how to make custom mobs attack the player on sight.
0
Port?
0
Why are you ignoring me?
0
Fine then just ignore me.
0
I could be a helper
0
Just go here
http://mcpeuniverse.com/maps/survive-on-a-tree/
0
Ok try it now
0
Hey nexus![B) B)](https://media.minecraftforum.net/avatars/0/10/635356669595621376.png)
Role:builder
Experience:I used to be builder for another server
Age:13
Skype:I only have kik and I'll pm it
0
As the title says you survive in a house
There is danger inside and outside![:) :)](https://media.minecraftforum.net/avatars/0/14/635356669596273706.png)
http://adf.ly/1FfGfs
0
Here is the error
org.mozilla.javascript.WrappedException: Wrapped java.lang.ClassCastException: org.mozilla.javascript.UniqueTag cannot be cast to java.lang.Number (RPGWeapons.js#58)
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(Unknown Source)
at org.mozilla.javascript.FunctionObject.call(Unknown Source)
at org.mozilla.javascript.Interpreter.interpretLoop(Unknown Source)
at script(RPGWeapons.js:58)
at org.mozilla.javascript.Interpreter.interpret(Unknown Source)
at org.mozilla.javascript.InterpretedFunction.call(Unknown Source)
at org.mozilla.javascript.ContextFactory.doTopCall(Unknown Source)
at org.mozilla.javascript.ScriptRuntime.doTopCall(Unknown Source)
at org.mozilla.javascript.InterpretedFunction.exec(Unknown Source)
at net.zhuoweizhang.mcpelauncher.ScriptManager.initJustLoadedScript(ScriptManager.java:237)
at net.zhuoweizhang.mcpelauncher.ScriptManager$ParseThread.run(ScriptManager.java:163)
at java.lang.Thread.run(Thread.java:841)
Caused by: java.lang.ClassCastException: org.mozilla.javascript.UniqueTag cannot be cast to java.lang.Number
at net.zhuoweizhang.mcpelauncher.ScriptManager$NativeItemApi.addShapedRecipe(ScriptManager.java:2506)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
... 11 more
And here is my code![:) :)](https://media.minecraftforum.net/avatars/0/14/635356669596273706.png)
/*/////////////////////////////////
//made by xXbehind_the_screenXx//
/////////////////////////////////
*/
/*variables*/
var item =ModPE.setItem
var craft =Item.addCraftRecipe
var shaped =Item.addShapedRecipe
var cook =Item.addFurnaceRecipe
var player =Player.getEntity();
var X =Player.getX();
var Y =Player.getY();
var Z =Player.getZ();
/*items*/
//Wizard
item(500,"stick",0,"Aprentice wand");
item(501,"fishing_rod_cast",0,"Master Wand");
item(502,"blaze_rod",0,"Grand master Wand");
//Thief
item(503,"sword",2,"Dagger");
item(504,"feather",0,"Super jump");
//Fighter
item(507,"sword",2,"Better iron sword");
item(508,"sword",4,"Better diamond sword");
//Healer
item(509,"stick",0,"Healer wand");
item(510,"blaze_rod",0,"Master healer Wand");
//Craft
item(506,"flint",0,"Sharping stone");
item(511,"ruby",0,"Uncooked magic gem");
item(505,"ruby",0,"Magic gem");
/*blocks*/
/*Recipes*/
cook(505,0,511);
craft(512,1,0,[318,1,0]);
shaped(511,1,0,[
"rgr",
"rdr",
"rgr"],
["r",331,0,"g",266,0,"d",264,0]);
//wizard
shaped(500,1,0,[
" g ",
"ggg",
" s "],
["g",505,0,"s",280,0]);
shaped(501,1,0,[
" g ",
"ggg",
" a "],
["g",505,0,"a",500,0]);
shaped(502,1,0,[
" g ",
"ggg",
" m "],
["g",505,0,"m",501,0]);
//thief
shaped(503,1,0,[
"SiS",
"SgS",
" s "],
["S",512,0,"i",,0,"g",505,0,"s",280,0]);
shaped(504,1,0,[
"fff",
"fgf",
"fff"],
["f",288,0,"g",505,0]);
//fighter
shaped(507,1,0,[
"fif",
"fif",
" s "],
["f",512,0,"i",42,0,"s",280,0]);
shaped(508,1,0,[
"fdf",
"fdf",
" s "],
["f",512,0,"d",57,0,"s",280,0]);
//healer
shaped(509,1,0,[
"ppp",
"pgp",
" s "],
["p",320,0,"g",505,0,"s",280,0]);
shaped(510,1,0,[
"sss",
"sgs",
" h "],
["s",364,0,"g",505,0,"h",509,0]);
/*functionality*/
function attackHook(a,v) {
if(Player.getCarriedItem() == 509) {
Entity.setHealth(v,Entity.getHealth(v)+20);
Entity.setHealth(a,Entity.getHealth(a)+20);
}
}
function attackHook(a,v) {
if(Player.getCarriedItem() == 510) {
Entity.setHealth(v,Entity.getHealth(v)+40);
Entity.setHealth(a,Entity.getHealth(a)+40);
}
}
function attackHook(a,v) {
if(Player.getCarriedItem() == 503) {
Entity.setHealth(v,Entity.getHealth(v)-99);
}
}
function attackHook(a,v) {
if(Player.getCarriedItem() == 507) {
Entity.setHealth(v,Entity.getHealth(v)-14);
}
}
function useItem(x,y,z,b,i) {
if(i==504) {
Entity.setPosition(player,X,Y+3,Z);
}
}
0
How do you do it for items
0
Do you know how to do that for items?