i am fairly new to modding and i was making a star wars mod but for some reason i am have trouble put my item textures in to pe and i am hoping someone can help. anyways i am hoping someone can fix it, here is the code:
i'm making a full mod for star wars the clone wars here is the full code:
function newLevel() {
clientMessage("MCPE Star Wars food and holocrons mod");
clientMessage("Creator oakensheild");
clientMessage("some items are based off of base 327 from tylerplaceproductions");
}
/*items*/
ModPE.setItem(509,"magma_cream",0,"Talisman of Finding ");
function useItem(x, y, z, i, b, s){
if(i==509){
clientMessage("Brother I am an unworthy apprentice I'm not like you I never was");
function addDemonGolemToRenderer(renderer) {//the model function
var model = renderer.getModel();//creates a new variable to get the model
var bipedBody = model.getPart("body").clear();//a variable gets the body and clears it
bipedBody.setTextureOffset(3, 6);//sets the texture offset for the body
bipedBody.addBox(-5.0, -3.0, 0.0, 15, 18, 8, 0);//the body
bipedBody.setTextureOffset(1, 1);//sets the texture offset for the head(I made the head part of the body)
bipedBody.addBox(-1.0, -1.0, -4.0, 7, 8, 4, 0);//the head
bipedBody.setTextureOffset(59, 0);//set the texture offset for the horns
//the bottom part of the horns
bipedBody.addBox(0.0, -4.0, -3.0, 1, 3, 1);
//the middle part of the horns
bipedBody.addBox(-1.0, -6.0, -3.0, 1, 3, 1);
//the top part of the horns
bipedBody.addBox(0.0, -8.0, -3.0, 1, 3, 1);
var bipedLeg = model.getPart("rightLeg").clear();//a variable that gets the right leg and clears it
bipedLeg.setRotationPoint(-2.0, 2.0, 1.5);//sets the rotation point for the right leg at where the right leg and body meet
bipedLeg.setTextureOffset(45, 16);//sets the texture offset for the right leg
bipedLeg.addBox(-2.0, 2.0, 1.5, 5, 10, 5, 0);//the right leg
var bipedLeg2 = model.getPart("leftLeg").clear();//a variable that gets the left leg and clears it
bipedLeg2.setRotationPoint(2.0, 2.0, 1.5);//sets the rotation point for the left leg at where the left leg and body meet
bipedLeg2.setTextureOffset(45, 16);//sets the texture offset for the left leg
bipedLeg2.addBox(2.0, 2.0, 1.5, 5, 10, 5, 0);//the left leg
var bipedhead = model.getPart("head").clear();//a variable that gets the head and clears it
var bipedarm = model.getPart("rightArm").clear();//a variable that gets the right arm and clears it
bipedarm.setRotationPoint(-4.0, -2.0, 1.5);//sets the rotation point at the top of the right arm
bipedarm.setTextureOffset(40, 0);//sets the texture offset for the right arm
bipedarm.addBox(-4.0, -2.0, 1.5, 4, 26, 4, 0);//the right arm
var bipedarm2 = model.getPart("leftArm").clear();//a variable that gets the left arm and clears it
bipedarm2.setRotationPoint(4.0, -2.0, 1.5);//sets the rotation point at the top of the left arm
bipedarm2.setTextureOffset(40, 0);//sets the texture offset for the left arm
bipedarm2.addBox(4.0, -2.0, 1.5, 4, 26, 4, 0);//the left arm
}
var DemonGolemRenderer = Renderer.createHumanoidRenderer();//creates a variable that equals a humanoid model
addDemonGolemToRenderer(DemonGolemRenderer);//merges the variable with the model function
function useItem(x, y, z, i, b, s){//when a block is tapped
if(i==397){//with item 397
DemonGolem = Level.spawnMob(x, y+1, z,32,"mob/DemonGolem.png");//a variable equals spawning zombie at the location of where the block was tapped with the GolemDemon skin
Entity.setRenderType(DemonGolem, DemonGolemRenderer.renderType);//sets the model of the mob spawned to the custom model
Entity.setNameTag(DemonGolem, "assassin droid");//gives the mob a nametag cause #yolo
Entity.setHealth(DemonGolem, 70);//sets the mobs health to 70
}
}
function attackHook(a, v){//when something attacks
if(Entity.getMobSkin(v)=="mob/DemonGolem.png"){//if the victim has that mob skin
Level.playSoundEnt(v, "mob.zombiepig.zpigangry", 100, 30);//plays a zpigman sound
}
}
function deathHook(a, v){//when a mob dies
if (Entity.getMobSkin(v)=="mob/DemonGolem.png"){//if the mob has that mob skin
Level.dropItem(Entity.getX(v),Entity.getY(v),Entity.getZ(v),1,265,2);//drops some fire and lava
Level.dropItem(Entity.getX(v),Entity.getY(v),Entity.getZ(v),1,99,2);
}
}
function entityRemovedHook(entity)
{
if(Entity.getEntityTypeId(entity)==81&&bar==true)
{
var x=Entity.getX(entity)
var y=Entity.getY(entity)
+1
var z=Entity.getZ(entity)
setTile(x,y,z,4)
setTile(x,y+1,z,4)
setTile(x,y-1,z,4)
setTile(x+1,y,z,4)
setTile(x-1,y,z,4)
setTile(x,y,z+1,4)
setTile(x,y,z-1,4)
bar=false
}
if(Entity.getEntityTypeId(entity)==81&&fir==true)
{
var x=Entity.getX(entity)
var y=Entity.getY(entity)
var z=Entity.getZ(entity)
setTile(x,y,z,51)
setTile(x,y+1,z,51)
setTile(x,y-1,z,51)
setTile(x+1,y,z,51)
setTile(x-1,y,z,51)
setTile(x,y,z+1,51)
setTile(x,y,z-1,51)
fir=false
}
if(Entity.getEntityTypeId(entity)==81&&fla==true)
{
var x=Entity.getX(entity)
var y=Entity.getY(entity)
var z=Entity.getZ(entity)
explode(x,y,z,6)
}
}
hello,
i am fairly new to modding and i was making a star wars mod but for some reason i am have trouble put my item textures in to pe and i am hoping someone can help. anyways i am hoping someone can fix it, here is the code:
var items_opaque = "https://dl.dropbox.com/s/rtfvkn5wor0jzu7/items-opaque.png?dl=0";
ModPE.overrideTexture("images/items-opaque.png", items_opaque);
ModPE.setItem(484,"quiver",0,"lightsaber");
Item.addCraftRecipe(484, 1, 0, [187, 1, 0, 265, 8, 0]);
Player.addItemCreativeInv(484, 1, 0);
function attackHook(a,v)
{
if(getCarriedItem()==484)
{
if(Player.getCarriedItemData() < 1700) Entity.setCarriedItem(a, 484, Player.getCarriedItemCount(), Player.getCarriedItemData() + 1);
else
{
Player.clearInventorySlot(Player.getSelectedSlotId());
}
Entity.setHealth(v, Entity.getHealth(v) -100);
}
}
i'm making a full mod for star wars the clone wars here is the full code:
function newLevel() {
clientMessage("MCPE Star Wars food and holocrons mod");
clientMessage("Creator oakensheild");
clientMessage("some items are based off of base 327 from tylerplaceproductions");
}
/*items*/
ModPE.setItem(509,"magma_cream",0,"Talisman of Finding ");
function useItem(x, y, z, i, b, s){
if(i==509){
clientMessage("Brother I am an unworthy apprentice I'm not like you I never was");
}
}
Item.addCraftRecipe(509,10,0,[99 ,8 , 0]);
Player.addItemCreativeInv(509, 1, 0);
ModPE.setItem(500,"camera",0,"credit");
Item.addCraftRecipe(500,10,0,[266 ,4 , 0]);
Player.addItemCreativeInv(500, 1, 0);
ModPE.setItem(911,"sword",0,"training sword");
Item.addCraftRecipe(911,10,0,[280 ,1 , 0]);
Player.addItemCreativeInv(911, 1, 0);
ModPE.setItem(501,"compass_item",0,"sith battle plans");
Item.addCraftRecipe(501,1,0,[266 ,4 , 0, 128, 2, 0]);
Player.addItemCreativeInv(501, 1, 0);
ModPE.setItem(502,"book_enchanted",0,"holodiary");
Item.addCraftRecipe(502,1,0,[288 ,1 , 0, 340, 2, 0]);
Player.addItemCreativeInv(502, 1, 0);
/*food*/
ModPE.setFoodItem(443,"record_wait",0,8,"Doughnut");
Item.addCraftRecipe(443, 2, 0, [353, 1, 0]);
Player.addItemCreativeInv(443, 1, 0);
ModPE.setFoodItem(444,"record_ward",0,8,"homer Doughnut");
Item.addCraftRecipe(444, 10, 0, [353, 6, 0]);
Player.addItemCreativeInv(444, 1, 0);
ModPE.setFoodItem(445,"brick",0,8,"ration");
Item.addCraftRecipe(445, 2, 0, [187, 1, 0]);
Player.addItemCreativeInv(445, 1, 0);
ModPE.setFoodItem(441,"sugar",0,8,"exited clone sugar ");
Item.addCraftRecipe(441, 2, 0, [353, 1, 0]);
Player.addItemCreativeInv(441, 1, 0);
ModPE.setFoodItem(442,"cookie",0,8,"wookie cookie ");
Item.addCraftRecipe(442, 2, 0, [187, 4, 0]);
Player.addItemCreativeInv(443, 1, 0);
ModPE.setFoodItem(446,"minecart_chest",0,8,"sith grub ");
Item.addCraftRecipe(446, 2, 0, [99, 1, 0]);
Player.addItemCreativeInv(446, 1, 0);
ModPE.setFoodItem(447,"beetroot_soup",0,8,"geonosis food");
Item.addCraftRecipe(447, 2, 0, [99, 4, 0]);
Player.addItemCreativeInv(447, 1, 0);
ModPE.setFoodItem(448,"beef_cooked",0,8,"trump steak");
Item.addCraftRecipe(448, 20, 0, [264, 5, 0]);
Player.addItemCreativeInv(448, 1, 0);
ModPE.setFoodItem(449,"potion_bottle_drinkable",8,8,"ale");
Item.addCraftRecipe(449, 20, 0, [296, 4, 0]);
Player.addItemCreativeInv(449, 1, 0);
ModPE.setFoodItem(450,"potion_bottle_drinkable",22,8,"blue shadow virus");
Item.addCraftRecipe(450, 2, 0, [99, 5, 0]);
Player.addItemCreativeInv(450, 1, 0);
ModPE.setFoodItem(451,"fish_raw_cod",0,8,"the fish that set base 327 on fire");
Item.addCraftRecipe(451, 20, 0, [349, 4, 0]);
Player.addItemCreativeInv(451, 1, 0);
/*candy*/
ModPE.setFoodItem(452,"dye_powder",5,8,"easter candy");
Item.addCraftRecipe(452, 2, 0, [353, 4, 0]);
Player.addItemCreativeInv(452, 1, 0);
ModPE.setFoodItem(453,"dye_powder",8,8,"easter candy");
Item.addCraftRecipe(453, 2, 0, [353, 4, 0]);
Player.addItemCreativeInv(453, 1, 0);
ModPE.setFoodItem(454,"dye_powder",9,8,"easter candy");
Item.addCraftRecipe(454, 2, 0, [353, 4, 0]);
Player.addItemCreativeInv(454, 1, 0);
ModPE.setFoodItem(455,"dye_powder",10,8,"easter candy");
Item.addCraftRecipe(455, 2, 0, [353, 4, 0]);
Player.addItemCreativeInv(455, 1, 0);
ModPE.setFoodItem(456,"dye_powder",12,8,"easter candy");
Item.addCraftRecipe(456, 2, 0, [353, 4, 0]);
Player.addItemCreativeInv(456, 1, 0);
ModPE.setFoodItem(457,"dye_powder",13,8,"easter candy");
Item.addCraftRecipe(457, 2, 0, [353, 4, 0]);
Player.addItemCreativeInv(457, 1, 0);
/*blocks*/
Block.defineBlock(128,"holoinfo","repeater_on", 0);
Item.addCraftRecipe(128,10,0,[500 ,6 , 0]);
Player.addItemCreativeInv(128, 1, 0);
Block.setShape(128, 0, 0, 0, 1, 1, 1);
Block.setLightLevel(128,15);
Block.setDestroyTime(128, 9);
Block.defineBlock(187,"holocron" ,"ice_packed", 0);
Item.addCraftRecipe(187,1,0,[355 ,4 , 0]);
Block.setShape(187, 0, 0, 0, 1/2, 1/2, 1/2);
Block.setLightLevel(187,15);
Player.addItemCreativeInv(187, 1, 0);
Block.defineBlock(99,"sith holocron","bed", 0);
Item.addCraftRecipe(99,1,0,[502 ,4 , 0]);
Block.setShape(99, 0, 0, 0, 1, 1/2, 1);
Player.addItemCreativeInv(99, 1, 0);
Block.setLightLevel(99,5);
Block.defineBlock(111,"base wall","anvil_base", 0);
Item.addCraftRecipe(111,64,0,[264 ,2 , 0]);
Player.addItemCreativeInv(111, 1, 0);
Block.setShape(111, 0, 0, 0, 1, 1, 1);
Block.setLightLevel(111,5);
Block.setDestroyTime(111, 50);
Block.defineBlock(127,"kamino base wall","stone_slab", 0);
Item.addCraftRecipe(127,10,0,[264 ,1 , 0]);
Player.addItemCreativeInv(127, 1, 0);
Block.setShape(127, 0, 0, 0, 1, 1, 1);
Block.setLightLevel(127,5);
Block.setDestroyTime(127, 50);
/* droid items*/
ModPE.setItem(397, "ender_eye", 0, "droid egg");//sets a item
Item.addCraftRecipe(397,10,0,[265 ,2 , 0, 501, 4, 0, 128, 1, 0]);
Player.addItemCreativeInv(397, 1, 0);
ModPE.overrideTexture("images/mob/DemonGolem.png","http://i.imgur.com/9Q1Z8C1.png");//downloads the texture
var DemonGolem;//a global variable
function addDemonGolemToRenderer(renderer) {//the model function
var model = renderer.getModel();//creates a new variable to get the model
var bipedBody = model.getPart("body").clear();//a variable gets the body and clears it
bipedBody.setTextureOffset(3, 6);//sets the texture offset for the body
bipedBody.addBox(-5.0, -3.0, 0.0, 15, 18, 8, 0);//the body
bipedBody.setTextureOffset(1, 1);//sets the texture offset for the head(I made the head part of the body)
bipedBody.addBox(-1.0, -1.0, -4.0, 7, 8, 4, 0);//the head
bipedBody.setTextureOffset(59, 0);//set the texture offset for the horns
//the bottom part of the horns
bipedBody.addBox(0.0, -4.0, -3.0, 1, 3, 1);
//the middle part of the horns
bipedBody.addBox(-1.0, -6.0, -3.0, 1, 3, 1);
//the top part of the horns
bipedBody.addBox(0.0, -8.0, -3.0, 1, 3, 1);
var bipedLeg = model.getPart("rightLeg").clear();//a variable that gets the right leg and clears it
bipedLeg.setRotationPoint(-2.0, 2.0, 1.5);//sets the rotation point for the right leg at where the right leg and body meet
bipedLeg.setTextureOffset(45, 16);//sets the texture offset for the right leg
bipedLeg.addBox(-2.0, 2.0, 1.5, 5, 10, 5, 0);//the right leg
var bipedLeg2 = model.getPart("leftLeg").clear();//a variable that gets the left leg and clears it
bipedLeg2.setRotationPoint(2.0, 2.0, 1.5);//sets the rotation point for the left leg at where the left leg and body meet
bipedLeg2.setTextureOffset(45, 16);//sets the texture offset for the left leg
bipedLeg2.addBox(2.0, 2.0, 1.5, 5, 10, 5, 0);//the left leg
var bipedhead = model.getPart("head").clear();//a variable that gets the head and clears it
var bipedarm = model.getPart("rightArm").clear();//a variable that gets the right arm and clears it
bipedarm.setRotationPoint(-4.0, -2.0, 1.5);//sets the rotation point at the top of the right arm
bipedarm.setTextureOffset(40, 0);//sets the texture offset for the right arm
bipedarm.addBox(-4.0, -2.0, 1.5, 4, 26, 4, 0);//the right arm
var bipedarm2 = model.getPart("leftArm").clear();//a variable that gets the left arm and clears it
bipedarm2.setRotationPoint(4.0, -2.0, 1.5);//sets the rotation point at the top of the left arm
bipedarm2.setTextureOffset(40, 0);//sets the texture offset for the left arm
bipedarm2.addBox(4.0, -2.0, 1.5, 4, 26, 4, 0);//the left arm
}
var DemonGolemRenderer = Renderer.createHumanoidRenderer();//creates a variable that equals a humanoid model
addDemonGolemToRenderer(DemonGolemRenderer);//merges the variable with the model function
function useItem(x, y, z, i, b, s){//when a block is tapped
if(i==397){//with item 397
DemonGolem = Level.spawnMob(x, y+1, z,32,"mob/DemonGolem.png");//a variable equals spawning zombie at the location of where the block was tapped with the GolemDemon skin
Entity.setRenderType(DemonGolem, DemonGolemRenderer.renderType);//sets the model of the mob spawned to the custom model
Entity.setNameTag(DemonGolem, "assassin droid");//gives the mob a nametag cause #yolo
Entity.setHealth(DemonGolem, 70);//sets the mobs health to 70
}
}
function attackHook(a, v){//when something attacks
if(Entity.getMobSkin(v)=="mob/DemonGolem.png"){//if the victim has that mob skin
Level.playSoundEnt(v, "mob.zombiepig.zpigangry", 100, 30);//plays a zpigman sound
}
}
function deathHook(a, v){//when a mob dies
if (Entity.getMobSkin(v)=="mob/DemonGolem.png"){//if the mob has that mob skin
Level.dropItem(Entity.getX(v),Entity.getY(v),Entity.getZ(v),1,265,2);//drops some fire and lava
Level.dropItem(Entity.getX(v),Entity.getY(v),Entity.getZ(v),1,99,2);
}
}
/*blasters*/
var bar=false;
var fir=false;
var fla=false;
ModPE.setItem(900,"gold_horse_armor",0,"SLI-28 rotary sniper rifle");
Item.setEnchantType(900, EnchantType.bow, 1);
ModPE.setItem(901,"fishing_rod",1,"DH-17 blaster");
Item.setEnchantType(902, EnchantType.bow, 1);
ModPE.setItem(902,"carrot_on_a_stick",0,"droid blaster");
Item.setEnchantType(902, EnchantType.bow, 1);
ModPE.setItem(903,"diamond_horse_armor",0,"66-p blaster");
Item.setEnchantType(903, EnchantType.bow, 1);
ModPE.setItem(904,"iron_horse_armor",0,"z-9 rotary blaster cannon");
Item.setEnchantType(904, EnchantType.bow, 1);
Player.addItemCreativeInv(900, 1, 0);
Player.addItemCreativeInv(901, 1, 0);
Player.addItemCreativeInv(902, 1, 0);
Player.addItemCreativeInv(903, 1, 0);
Player.addItemCreativeInv(904, 1, 0);
Item.setHandEquipped(900,1);
Item.setHandEquipped(901,1);
Item.addShapedRecipe(903,3,0,["ioi","iwi","ioi"],["w",331,0,"i",4,0,"o",1,0]);
Item.addShapedRecipe(904,3,0,["ioi","iwi","ioi"],["w",331,0,"i",4,0,"o",259,0]);
Item.addShapedRecipe(902,3,0,["ioi","iwi","ioi"],["w",331,0,"i",4,0,"o",46,0]);
Item.addShapedRecipe(901,1,0,["ioi","iwi","iwi"],["w",331,0,"i",265,0,"o",266,0]);
Item.addShapedRecipe(900,1,0,["ioi","iwi","ioi"],["w",331,0,"i",266,0,"o",264,0]);
function useItem(x,y,z,item,block,side)
{
var playerYaw = Entity.getYaw(Player.getEntity());
var playerPitch = Entity.getPitch(Player.getEntity());
if(Player.getCarriedItem()==900)
{
Level.playSoundEnt(Player.getEntity(), "random.fuse", 100, 100);
velY = Math.sin((playerPitch - 180) / 180 * Math.PI);
velX = 3.5 * (Math.sin(playerYaw / 180 * Math.PI) * Math.cos((playerPitch - 180) / 180 * Math.PI));
velZ = 3.5 * (-1 * Math.cos(playerYaw / 180 * Math.PI) * Math.cos((playerPitch - 180) / 180 * Math.PI));
var axe = Level.spawnMob(Player.getX() + Math.sin(playerYaw / 180 * Math.PI) * Math.cos((playerPitch - 180) / 180 * Math.PI) ,Player.getY()+0.1,Player.getZ() + -1 * Math.cos(playerYaw / 180 * Math.PI) * Math.cos((playerPitch - 180) / 180 * Math.PI) ,81);
Entity.setFireTicks(axe,1000);
addItemInventory(450,-1);
setVelX(axe,velX);
setVelY(axe,velY);
setVelZ(axe,velZ);
bar=true;
}
var playerYaw = Entity.getYaw(Player.getEntity());
var playerPitch = Entity.getPitch(Player.getEntity());
if(Player.getCarriedItem()==901)
{
Level.playSoundEnt(Player.getEntity(), "random.fuse", 100, 100);
velY = Math.sin((playerPitch - 180) / 180 * Math.PI);
velX = 3.5 * (Math.sin(playerYaw / 180 * Math.PI) * Math.cos((playerPitch - 180) / 180 * Math.PI));
velZ = 3.5 * (-1 * Math.cos(playerYaw / 180 * Math.PI) * Math.cos((playerPitch - 180) / 180 * Math.PI));
var axe = Level.spawnMob(Player.getX() + Math.sin(playerYaw / 180 * Math.PI) * Math.cos((playerPitch - 180) / 180 * Math.PI) ,Player.getY()+0.1,Player.getZ() + -1 * Math.cos(playerYaw / 180 * Math.PI) * Math.cos((playerPitch - 180) / 180 * Math.PI) ,81);
Entity.setFireTicks(axe,1000)
addItemInventory(451,-1)
setVelX(axe,velX);
setVelY(axe,velY);
setVelZ(axe,velZ);
fir=true
}
var playerYaw = Entity.getYaw(Player.getEntity());
var playerPitch = Entity.getPitch(Player.getEntity());
if(Player.getCarriedItem()==902)
{
Level.playSoundEnt(Player.getEntity(), "random.fuse", 100, 100);
velY = Math.sin((playerPitch - 180) / 180 * Math.PI);
velX = 3.5 * (Math.sin(playerYaw / 180 * Math.PI) * Math.cos((playerPitch - 180) / 180 * Math.PI));
velZ = 3.5 * (-1 * Math.cos(playerYaw / 180 * Math.PI) * Math.cos((playerPitch - 180) / 180 * Math.PI));
var axe = Level.spawnMob(Player.getX() + Math.sin(playerYaw / 180 * Math.PI) * Math.cos((playerPitch - 180) / 180 * Math.PI) ,Player.getY()+0.1,Player.getZ() + -1 * Math.cos(playerYaw / 180 * Math.PI) * Math.cos((playerPitch - 180) / 180 * Math.PI) ,81);
Entity.setFireTicks(axe,1000)
addItemInventory(452,-1)
setVelX(axe,velX);
setVelY(axe,velY);
setVelZ(axe,velZ);
fla=true
}
var playerYaw = Entity.getYaw(Player.getEntity());
var playerPitch = Entity.getPitch(Player.getEntity());
if(Player.getCarriedItem()==903)
{
Level.playSoundEnt(Player.getEntity(), "random.fuse", 100, 100);
velY = Math.sin((playerPitch - 180) / 180 * Math.PI);
velX = 5 * (Math.sin(playerYaw / 180 * Math.PI) * Math.cos((playerPitch - 180) / 180 * Math.PI));
velZ = 5 * (-1 * Math.cos(playerYaw / 180 * Math.PI) * Math.cos((playerPitch - 180) / 180 * Math.PI));
var axe = Level.spawnMob(Player.getX() + Math.sin(playerYaw / 180 * Math.PI) * Math.cos((playerPitch - 180) / 180 * Math.PI) ,Player.getY()+0.1,Player.getZ() + -1 * Math.cos(playerYaw / 180 * Math.PI) * Math.cos((playerPitch - 180) / 180 * Math.PI) ,80);
Entity.setFireTicks(axe,1000)
setVelX(axe,velX);
setVelY(axe,velY);
setVelZ(axe,velZ);
}
}
function entityRemovedHook(entity)
{
if(Entity.getEntityTypeId(entity)==81&&bar==true)
{
var x=Entity.getX(entity)
var y=Entity.getY(entity)
+1
var z=Entity.getZ(entity)
setTile(x,y,z,4)
setTile(x,y+1,z,4)
setTile(x,y-1,z,4)
setTile(x+1,y,z,4)
setTile(x-1,y,z,4)
setTile(x,y,z+1,4)
setTile(x,y,z-1,4)
bar=false
}
if(Entity.getEntityTypeId(entity)==81&&fir==true)
{
var x=Entity.getX(entity)
var y=Entity.getY(entity)
var z=Entity.getZ(entity)
setTile(x,y,z,51)
setTile(x,y+1,z,51)
setTile(x,y-1,z,51)
setTile(x+1,y,z,51)
setTile(x-1,y,z,51)
setTile(x,y,z+1,51)
setTile(x,y,z-1,51)
fir=false
}
if(Entity.getEntityTypeId(entity)==81&&fla==true)
{
var x=Entity.getX(entity)
var y=Entity.getY(entity)
var z=Entity.getZ(entity)
explode(x,y,z,6)
}
}
function modTick()
{
var playerYaw = Entity.getYaw(Player.getEntity());
var playerPitch = Entity.getPitch(Player.getEntity());
if(Player.getCarriedItem()==904)
{
Level.playSoundEnt(Player.getEntity(), "random.fuse", 100, 100);
velY = Math.sin((playerPitch - 180) / 180 * Math.PI);
velX = 4* (Math.sin(playerYaw / 180 * Math.PI) * Math.cos((playerPitch - 180) / 180 * Math.PI));
velZ = 4 * (-1 * Math.cos(playerYaw / 180 * Math.PI) * Math.cos((playerPitch - 180) / 180 * Math.PI));
var axe = Level.spawnMob(Player.getX() + Math.sin(playerYaw / 180 * Math.PI) * Math.cos((playerPitch - 180) / 180 * Math.PI) ,Player.getY()+0.1,Player.getZ() + -1 * Math.cos(playerYaw / 180 * Math.PI) * Math.cos((playerPitch - 180) / 180 * Math.PI) ,80);
setVelX(axe,velX);
setVelY(axe,velY);
setVelZ(axe,velZ);
}
}
/*lightsaber*/
ModPE.setItem(484,"blaze_rod",0,"asoka tano's lightsaber");
Block.setLightLevel(484,15);
Item.setEnchantType(484, EnchantType.weapon, 2);
Item.addCraftRecipe(484, 1, 0, [187, 1, 0, 265, 8, 0]);
Player.addItemCreativeInv(484, 1, 0);
function attackHook(a,v)
{
if(getCarriedItem()==484)
{
if(Player.getCarriedItemData() < 1700) Entity.setCarriedItem(a, 484, Player.getCarriedItemCount(), Player.getCarriedItemData() + 1);
else
{
Player.clearInventorySlot(Player.getSelectedSlotId());
}
Entity.setHealth(v, Entity.getHealth(v) -100);
}
}
/*axe*/
ModPE.setItem(485,"axe",3,"savage opress's axe");
Item.setEnchantType(485, EnchantType.weapon, 10);
Item.addCraftRecipe(485, 1, 0, [99, 3, 0, 265, 2, 0]);
Player.addItemCreativeInv(485, 1, 0);
function attackHook(a,v)
{
if(getCarriedItem()==485)
{
if(Player.getCarriedItemData() < 1700) Entity.setCarriedItem(a, 485, Player.getCarriedItemCount(), Player.getCarriedItemData() + 1);
else
{
Player.clearInventorySlot(Player.getSelectedSlotId());
}
Entity.setHealth(v, Entity.getHealth(v) -900);
}
}