minecraftpejs吧 关注:18,899贴子:96,952
  • 1回复贴,共1
function addABlock(id,name,tex,model,tm,m){
Block.defineBlock(id,name,
[[tex, m[1]], //下
[tex, m[2]], //上
[tex, m[3]], //后
[tex, m[4]], //前
[tex, m[5]], //左
[tex, m[6]], //右
[tex, m[1]], //下
[tex, m[2]], //上
[tex, m[3]], //后
[tex, m[4]], //前
[tex, m[5]], //左
[tex, m[6]]
], model,tm,0);
Block.setDestroyTime(id,1);
Player.addItemCreativeInv(id,64,0);
}
addABlock(36,"屠宰机","tzj",54,false,1,[0,1,0,0,0,0]);
求大神帮看看哪里错了


IP属地:上海来自Android客户端1楼2017-02-25 22:12回复
    org.mozilla.javascript.WrappedException: Wrapped java.lang.ClassCastException: org.mozilla.javascript.Undefined cannot be cast to java.lang.Number (黯世之旅.js#2)
    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.addABlock(黯世之旅.js:2)
    at script(黯世之旅.js:19)
    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:271)
    at net.zhuoweizhang.mcpelauncher.ScriptManager$ParseThread.run(ScriptManager.java:196)
    at java.lang.Thread.run(Thread.java:818)
    Caused by: java.lang.ClassCastException: org.mozilla.javascript.Undefined cannot be cast to java.lang.Number
    at net.zhuoweizhang.mcpelauncher.ScriptManager.expandTexturesArray(ScriptManager.java:1355)
    at net.zhuoweizhang.mcpelauncher.ScriptManager$NativeBlockApi.defineBlockImpl(ScriptManager.java:4041)
    at net.zhuoweizhang.mcpelauncher.ScriptManager$NativeBlockApi.defineBlock(ScriptManager.java:4010)
    at java.lang.reflect.Method.invoke(Native Method)
    ... 11 more


    IP属地:上海来自Android客户端2楼2017-02-25 22:13
    回复