The Meaning of Life, the Universe, and Everything.
Join Date:
6/30/2014
Posts:
51
Member Details
Hi everyone.. Im trying to do my first mod, call it "Mummy Villager", but i have three problems with the script. I need someone tell me how i can do that my MOB spawn randomly in the world, and what i have to change to do the spawn be rare or be comun?.. plus i want to add some REDSTONE PARTICLES to the mob (like a Blaze, but with redstone), what script should i have to use?
And third, how can i make that the MOB drop items be aleatory? for example 1, 2 or 3 Bones, randomly.. thanks!
Pd: Im a rookie, so please have patience!
Here is the script:
//Mod By Gonza Argll
function newLevel(){
clientMessage(ChatColor.GREEN+"Mummy Villager by Gonza Argll");
}
And third, how can i make that the MOB drop items be aleatory? for example 1, 2 or 3 Bones, randomly.. thanks!
Pd: Im a rookie, so please have patience!
Here is the script:
//Mod By Gonza Argll
function newLevel(){
clientMessage(ChatColor.GREEN+"Mummy Villager by Gonza Argll");
}
//Variaveis
var startGame=0;
var mummyvillager;
//Spawnadores
ModPE.setItem(448,"spawn_egg", 0, "Mummy Villager Spawn Egg");
ModPE.setFoodItem(451,"rotten_flesh", 0, -5, "Rotten Flesh");
Player.addItemCreativeInv(448,1,2);
//Spawn
function useItem(x,y,z,i,b,s){
if(i==448){
mummyvillager = Level.spawnMob(x,y+1,z,39,"mob/villager/mummyvillager.png");
Entity.setRenderType(mummyvillager,11);
Entity.setHealth(mummyvillager,40);
}
}
function modTick(){
if(startGame==0){
startGame = 1;
}
if(startGame==1){
var SpawnMob = Math.floor((Math.random()*7500)+1);
switch(SpawnMob){
case 1:
mummyvillager = Level.spawnMob( Entity.getX(mummyvillager), Entity.getY(mummyvillager)+2, Entity.getZ(mummyvillager)+10, 39,"mob/villager/mummyvillager.png");
Entity.setHealth(mummyvillager, 40);
break;
}
}
}
function deathHook(murderer, victim){
if(Entity.getMobSkin(victim)=="mob/villager/mummyvillager.png"){
Level.dropItem(Entity.getX(victim), Entity.getY(victim) + 1, Entity.getZ(victim), 0.5, 352, 3, 0);
}
if(Entity.getMobSkin(victim)=="mob/villager/mummyvillager.png"){
Level.dropItem(Entity.getX(victim), Entity.getY(victim) + 1, Entity.getZ(victim), 2, 451, 1, 0);
}
if(Entity.getMobSkin(victim)=="mob/villager/mummyvillager.png"){
Level.dropItem(Entity.getX(victim), Entity.getY(victim) + 1, Entity.getZ(victim), 1, 339, 2, 0);
}
}
function modTick(){
if(startGame==0){
startGame = 1;
}
if(startGame==1){
var SpawnMob = Math.floor((Math.random()*2400)+1);
switch(SpawnMob){
and isnt work