求助
minecraftpejs吧
全部回复
仅看楼主
level 6
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]);
求大神帮看看哪里错了
2017年02月25日 14点02分 1
level 6
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
2017年02月25日 14点02分 2
level 11
应该这样写![滑稽]
function addABlock(id,name,tex,model,tm,m){
Block.defineBlock(id,name,
[[tex, m[0]], //下
[tex, m[1]], //上
[tex, m[2]], //后
[tex, m[3]], //前
[tex, m[4]], //左
[tex, m[5]], //右
[tex, m[0]], //下
[tex, m[1]], //上
[tex, m[2]], //后
[tex, m[3]], //前
[tex, m[4]], //左
[tex, m[5]]
], model,tm,0);
Block.setDestroyTime(id,1);
Player.addItemCreativeInv(id,64,0);
}
addABlock(36,"屠宰机","tzj",54,false,1,[0,1,0,0,0,0]);
2017年03月13日 09点03分 20
level 12
[滑稽]马上10级了
2017年03月14日 04点03分 25
1