
ModPE.setItem(456,"合金",0,"合金",64);
ModPE.setItem(455,"能源碎片",0,"能源碎片",64);
ModPE.setItem(454,"能源核心",0,"能源核心",64);
//熔炉配方
Item.addFurnaceRecipe(255,455,0);
//方块定义
Block.defineBlock(254,"make电源",[["电源面",0],["电源",0],["电源面",0],["电源面",0],["电源面",0],["电源面",0]],15,true,0);
Block.defineBlock(255,"Energy mineral",["能源矿",0],1,true,0);
//添加创造背包区
Player.addItemCreativeInv(255,1,0);
Player.addItemCreativeInv(254,1,0);
Player.addItemCreativeInv(450,1,0);
Player.addItemCreativeInv(451,1,0);
Player.addItemCreativeInv(452,1,0);
Player.addItemCreativeInv(453,1,0);
Player.addItemCreativeInv(454,1,0);
Player.addItemCreativeInv(455,1,0);
Player.addItemCreativeInv(456,1,0);
Player.addItemCreativeInv(449,1,0);
Player.addItemCreativeInv(448,1,0);
Player.addItemCreativeInv(447,1,0);
Player.addItemCreativeInv(446,1,0);
//盔甲
Item.defineArmor(450,"马克头盔",0,"马克头盔","armor/马克盔甲_1.png",5,1000,ArmorType.helmet);
Item.defineArmor(451,"马克胸甲",0,"马克胸甲","armor/马克盔甲_1.png",5,1000,ArmorType.chestplate);
Item.defineArmor(452,"马克裤腿",0,"马克裤腿","armor/马克盔甲_2.png",5,1000,ArmorType.leggings);
Item.defineArmor(453,"马克靴子",0,"马克靴子","armor/马克盔甲_1.png",5,1000,ArmorType.boots);
Item.defineArmor(449,"mark1头盔",0,"mark1头盔","armor/mark1_1.png",3,600,ArmorType.helmet);
Item.defineArmor(448,"mark1胸甲",0,"mark1胸甲","armor/mark1_1.png",5,600,ArmorType.chestplate);
Item.defineArmor(447,"mark1裤腿",0,"mark1裤腿","armor/mark1_2.png",5,600,ArmorType.leggings);
Item.defineArmor(446,"mark1靴子",0,"mark1靴子","armor/mark1_1.png",6,600,ArmorType.boots);


//合成配方
Item.addShapedRecipe(456, 4, 0, ["aaa","bbb","   "], ["a",266,0,"b",265,0]);
Item.addShapedRecipe(454, 1, 0, [" a ","a a","   "], ["a",455,0])
Item.addShapedRecipe(254,1,0,[" a ","aba"," a "],["a",265,0,"b",264,0]);
//合成盔甲
Item.addShapedRecipe(450, 1, 0, ["aaa","a a","b b"], ["a",456,0,"b",331,0])
Item.addShapedRecipe(451, 1, 0, ["c c","aba","aaa"], ["a",456,0,"b",454,0,"c",331,0])
Item.addShapedRecipe(452, 1, 0, ["aaa","a a"," b "], ["a",456,0,"b",331,0])
Item.addShapedRecipe(453, 1, 0, ["a a","a a"," b "], ["a",456,0,"b",331,0])
Item.addShapedRecipe(449, 1, 0, [" a ","b b","b b"], ["a",456,0,"b",265,0])
Item.addShapedRecipe(448, 1, 0, ["a a","aaa","aba"], ["a",265,0,"b",456,0])
Item.addShapedRecipe(447, 1, 0, ["aaa","a a","b b"], ["a",265,0,"b",456,0])
Item.addShapedRecipe(446, 1, 0, ["a a","a a"," b "], ["a",265,0,"b",456,0])

//随机生成矿物
function modTick(){
var TX,TZ,Tx,Tz,TY,Ty;
TX=Math.round(256*Math.random()+getPlayerX());
TZ=Math.round(256*Math.random()+getPlayerZ());
tx=Math.round(getPlayerX()-256*Math.random());
tz=Math.round(getPlayerZ()-256*Math.random());
TY=Math.round(Math.random()*50);
Ty=Math.round(Math.random()*20);
var 宏仔
if(宏仔=0){
 if(Math.random()*100<10){
setTile(tx,Ty,TZ,255)}
}
}
//声音
//矿物破坏掉落
function destroyBlock(x, y, z, side){
if(getTile(x,y,z)==255){
Level.destroyBlock(x,y,z,false);
Level.dropItem(x+0.2,y,z,0,455,4,0);
}}

//设定方块破坏时间
Block.setDestroyTime(255,1.2);


//装备效果
function modTick(){
if
(Player.getArmorSlot(0)==450&&Player.getArmorSlot(1)==451&&Player.getArmorSlot(2)==452&&Player.getArmorSlot(3)==453)
 {
Entity.addEffect(getPlayerEnt(),MobEffect.damageResistance ,20,3, false,true);
Entity.addEffect(getPlayerEnt(),MobEffect.fireResistance ,20,3, false,true);
 Entity.addEffect(getPlayerEnt(),MobEffect.waterBreathing,20,3, false,true);

 }
}
//空手打怪效果
//实体保存

function useItem(x,y,z,itemId,blockId)
{
if(itemId==280)
{
var mark= Level.spawnMob(x, y + 1, z,15 , "mob/钢铁侠.png");
Entity.setRenderType(mark, 3);
Entity.setHealth(mark, 200);
Entity.setNameTag(mark,"§2mark");
}
}
function entityAddedHook(e){
var x=Entity.getX(e);var y=Entity.getY(e);
var z=Entity.getZ(e);
if(Entity.getNameTag(e)=="§2mark"){
Entity.setMobSkin(e,"mobs/钢铁侠.png");
Entity.setRenderType(e,3)
;
Entity.setCollisionSize(e,0.5,2);
}
}
//显示GUI
function selectLevelHook(){


var ctx=com.mojang.minecraftpe.MainActivity.currentMainActivity.get();
ctx.runOnUiThread(new java.lang.Runnable({run:function(){try{
var $1=new android.widget.LinearLayout(ctx);
$1.setGravity(17);
var $2=new android.widget.TextView(ctx);
$2.setText("欢迎使用宏仔制作的钢铁侠js!\n材质贴图由星空菌提供\n贴吧id:yyh2zkk\nqq:2505811377\n有bug欢迎指出哦！\n暴风雨工作室,雪鱼笔工作室出品\n( ･ิω･)ﾉ ิ ");
$2.setTextSize(20);
$2.setPadding(0,0,0,0);
var $2_params=new android.widget.LinearLayout.LayoutParams(-2,-2);
$2_params.setMargins(0,0,0,0);
$2.setLayoutParams($2_params);
$1.addView($2);
var $=new android.widget.PopupWindow(ctx);
$.setFocusable(true);
$.setContentView($1);
$.setWidth(500);
$.setHeight(251);
$.setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(1526770943));
$.showAtLocation(ctx.getWindow().getDecorView(),0,209,0);
}catch(e){print(e)}}}));
}
