This is a work in progress mod so I am adding more functionality to this mob e.g. able to shoot fireballs, drops but heres what I have: (to get the spawner get item 439 and the script downloads the texture for you)
var ghast;
var truth=false;
var health=10;
ModPE.setItem(439,"ghast_tear", 0, "ghast spawner");
function newLevel()
{
ModPE.overrideTexture("images/font/glyph_39.png", "http://novask.in/20842791.png");
}
function modTick(){
Entity.setHealth(ghast, health);
if(getTile(Entity.getX(ghast)+1,Entity.getY(ghast)+1,Entity.getZ(ghast))>0|| getTile(Entity.getX(ghast)-1,Entity.getY(ghast)+1,Entity.getZ(ghast))>0||getTile(Entity.getX(ghast),Entity.getY(ghast)+1,Entity.getZ(ghast)+1)>0||getTile(Entity.getX(ghast),Entity.getY(ghast)+1,Entity.getZ(ghast)-1)>0){
truth=true;
}
if(truth==true){
Entity.setVelY(ghast, 0.5, 0.5, 0.5);
truth=false;
}
}
function leaveGame(){
ModPE.resetImages();
}
function deathHook(a, v){
if(Entity.getMobSkin(v)=="font/glyph_39.png"){
health=20;
}
}
function attackHook(a, v){
if(Entity.getMobSkin(v)=="font/glyph_39.png"&&getCarriedItem()!=276){
preventDefault();
}
if(Entity.getMobSkin(v)=="font/glyph_39.png"&&getCarriedItem()==276){
health=health-7;
}
if(Entity.getMobSkin(a)=="font/glyph_39.png"){
preventDefault();
}
}
function addGhastToRenderer(renderer) {
var var2 = 0;
var model = renderer.getModel();
var bipedBody = model.getPart("body").clear();
bipedBody.addBox(0.0, -60.0, 0.0, 16, 16, 16, var2);
bipedBody.addBox(1.0, -45.0, 6.0, 2, 10, 2, var2);
bipedBody.addBox(0.3, -45.0, 0.0, 2, 10, 2, var2);
bipedBody.addBox(1.3, -45.0, 13.0, 2, 10, 2, var2);
bipedBody.addBox(6.5, -45.0, 0.0, 2, 12, 2, var2);
bipedBody.addBox(13.4, -45.0, 0.0, 2, 10, 2, var2);
bipedBody.addBox(13.0, -45.0, 6.0, 2, 10, 2, var2);
bipedBody.addBox(6.5, -45.0, 13.0, 2, 12, 2, var2);
var bipedLeg = model.getPart("rightLeg").clear();
bipedBody.addBox(13.0, -45.0, 12.0, 2, 10, 2, var2);
var bipedLeg2 = model.getPart("leftLeg").clear();
var bipedhead = model.getPart("head").clear();
var bipedarm = model.getPart("rightArm").clear();
var bipedarm2 = model.getPart("leftArm").clear();
}
var ghastRenderer = Renderer.createHumanoidRenderer();
addGhastToRenderer(ghastRenderer);
function useItem(x,y,z,itemId,block,side){
if(itemId==439){
ghast = Level.spawnMob(x, y, z, 32, "font/glyph_39.png");
clientMessage(ghastRenderer.renderType);
Entity.setRenderType(ghast, ghastRenderer.renderType);
}
}
function entityRemovedHook(e){
if(e==ghast){
health=20;
}
}
Ta da a ghast mod. Currently its a invisible zombie that has a ghast flying above it. The ghast can only die by a diamond sword (you have to hit the invisible zombie currently i will make it in the future where you can kill shoot the ghast with an arrow) and only a diamond sword and nothing else like fire fall damage etc. When the the ghast (invisible zombie) has any block except air 2 blocks high in front of it it would still be able to go over it. You must only have one ghast at a time in the world or somethings wont work. Again its a work in progress.
don't work Nd How Do u Make Custom Entity Rendertypes??
0
0
0
0
1
0
0
0
0
0
Umm I Checked the version ummmm Total Derp
0
0
https://www.dropbox.com/s/ewc9rekub54dvlz/20140415133504.png
0
0
0