Minecrave holy smokes i just corrected your mistake i was messing with your script trying to fix it but i couldnt then i fixed it
[Code]
var mob = null;
function deathHook(murderer, victim)
{
if(Entity.getEntityTypeId(victim) == 36)
{
clientMessage("A Villager Has Died.");
}
}
[\code]
I fixed where it use to say if (victim==mob)
{
ok well guys please i need mor help can you guys keep replieng i need help cuz i already have it so that i can hit a zombiePigman with diamond itll say New Trade Has Started and i also have it so when a zombie pigman dies itll say a Villager has died¡!now i need help on defining the murderer so can i mak it so that i can say the playr killed it and if its tru than itll spawn villager cops to get you
var vill;
var tick=400;
function modTick(){
tick--;
{
if(tick==0){
var yyy= Math.floor((Math.random()*75)+50);
var xxx= Math.floor(Math.random()*256);
var zzz= Math.floor(Math.random()*256);
vill= Level.spawnMob(xxx,yyy,zzz,11,"mob/char.png");
Entity.setNameTag(vill,"Villager");
Entity.setRenderType(vill, 3);
tick=400;
}
}
This will spawn a mob that looks like you and have a nametag that says "Villager". It will spawn every 20 seconds and where it spawns is random. Untested.
var vill;
var tick=400;
function modTick(){
tick--;
{
if(tick==0){
var yyy= Math.floor((Math.random()*75)+50);
var xxx= Math.floor(Math.random()*256);
var zzz= Math.floor(Math.random()*256);
vill= Level.spawnMob(xxx,yyy,zzz,11,"mob/char.png");
Entity.setNameTag(vill,"Villager");
Entity.setRenderType(vill, 3);
tick=400;
}
}
This will spawn a mob that looks like you and have a nametag that says "Villager". It will spawn every 20 seconds and where it spawns is random. Untested.
holy smokes thx alot ok ill try to test it.so if i change vartick to 36000 that is half an hourand the set render type whatever number that is is how many can be spawned at a time?
so if i change vartick to 36000 that is half an hour
and the set render type whatever number that is is how many can be spawned at a time?
What ever is in modTick happens every 1/20 of a second so that could work. The number in the Entity.setRenderType makes the mob look like like you. To see tghe rest of the rendertypes go to: https://github.com/Connor4898/ModPE-Scripts/wiki/Render-types
var vill;
var tick=400;
function modTick(){
tick--;
{
if(tick==0){
var yyy= Math.floor((Math.random()*75)+50);
var xxx= Math.floor(Math.random()*256);
var zzz= Math.floor(Math.random()*256);
vill= Level.spawnMob(xxx,yyy,zzz,11,"mob/char.png");
Entity.setNameTag(vill,"Villager");
Entity.setRenderType(vill, 3);
tick=400;
}
}
This will spawn a mob that looks like you and have a nametag that says "Villager". It will spawn every 20 seconds and where it spawns is random. Untested.
works, but... there's something wrong. missing a } at the end
Correction:
var vill;
var tick=400;
function modTick(){
tick--;
{
if(tick==0){
var yyy= Math.floor((Math.random()*75)+50);
var xxx= Math.floor(Math.random()*256);
var zzz= Math.floor(Math.random()*256);
vill= Level.spawnMob(xxx,yyy,zzz,11,"mob/char.png");
Entity.setNameTag(vill,"Villager");
Entity.setRenderType(vill, 3);
tick=400;
}
}
}
i tested it, working. they are Cows with a different Render Type and Skin!
works, but... there's something wrong. missing a } at the end
Correction:
var vill;
var tick=400;
function modTick(){
tick--;
{
if(tick==0){
var yyy= Math.floor((Math.random()*75)+50);
var xxx= Math.floor(Math.random()*256);
var zzz= Math.floor(Math.random()*256);
vill= Level.spawnMob(xxx,yyy,zzz,11,"mob/char.png");
Entity.setNameTag(vill,"Villager");
Entity.setRenderType(vill, 3);
tick=400;
}
}
}
i tested it, working. they are Cows with a different Render Type and Skin!
Whoops said untested but you should get rid of the { all together like this:
var vill;
var tick=400;
function modTick(){
tick--;
if(tick==0){
var yyy= Math.floor((Math.random()*75)+50);
var xxx= Math.floor(Math.random()*256);
var zzz= Math.floor(Math.random()*256);
vill= Level.spawnMob(xxx,yyy,zzz,11,"mob/char.png");
Entity.setNameTag(vill,"Villager");
Entity.setRenderType(vill, 3);
tick=400;
}
}
Herobrine mod (Zombie Pigman-textured Herobrine lol)
var vill;
var tick=400;
function modTick(){
tick--;
if(tick==0){
var yyy= Math.floor((Math.random()*75)+50);
var xxx= Math.floor(Math.random()*256);
var zzz= Math.floor(Math.random()*256);
vill= Level.spawnMob(xxx,yyy,zzz,36,"mob/pigzombie.png");
Entity.setNameTag(vill,"Herobrine");
Entity.setCarriedItem(vill, 278, 1, 0);
Entity.setHealth(vill, 30);
tick=400;
}
}
Herobrine will have 30 health and will be holding a diamond pickaxe.
ok i have natual spawn i have death messege i have trading messege and i have their steve skins ok now i need to add them holding a sword pick or shovel spawning randomly so basically one would spawn with either a shovel a pick or swordare u following my post cuz u answered quick?i can do that using a randomizer cuz threres a way for the computer to make a number between 0-1 an i can do
var randomizer = //whatever code is for rNdomizer
if(randomizer >0,<0.33){
//then this will be pick then so on
var vill;
var tick=400;
function modTick(){
tick--;
if(tick==0){
var yyy= Math.floor((Math.random()*75)+50);
var xxx= Math.floor(Math.random()*256);
var zzz= Math.floor(Math.random()*256);
vill= Level.spawnMob(xxx,yyy,zzz,11,"mob/char.png");
Entity.setNameTag(vill,"Villager");
Entity.setRenderType(vill, 3);
Entity.setCarriedItem(vill, 177, 1, 0);
tick=400;
}
}
They will appear with a shovel in hands. untested but might not work because cows can't hold items.
but if i change the cowsmob id to zombiepigman would that work?
why is some coding so complicated lol like what does the tick--; part do
]
tick--; Starts the countdown. So:
var tick = 60; //3 seconds
function modTick(){
tick--; //Start the countdown
if(tick == 0){ //If finished
clientMessage("Times Up!"); //print in chat log "Times Up!"
}
}
Rollback Post to RevisionRollBack
Make sure you follow me on twitter! @DarkDiaMiner IF I post a mod download it and give me a +1 if you appreciate.
Make sure you give me a suggestion at my WIP topic darkPE
Make sure you click on that +1 button if I help you! ---------------->
To post a comment, please login or register a new account.
[Code]
var mob = null;
function deathHook(murderer, victim)
{
if(Entity.getEntityTypeId(victim) == 36)
{
clientMessage("A Villager Has Died.");
}
}
[\code]
I fixed where it use to say if (victim==mob)
{
function newLevel{
spawn(zombiePigman x, y+1, z) or sumthing like that
var vill; var tick=400; function modTick(){ tick--; { if(tick==0){ var yyy= Math.floor((Math.random()*75)+50); var xxx= Math.floor(Math.random()*256); var zzz= Math.floor(Math.random()*256); vill= Level.spawnMob(xxx,yyy,zzz,11,"mob/char.png"); Entity.setNameTag(vill,"Villager"); Entity.setRenderType(vill, 3); tick=400; } }This will spawn a mob that looks like you and have a nametag that says "Villager". It will spawn every 20 seconds and where it spawns is random. Untested.
Link:
http://www.minecraft.../#entry29816329
holy smokes thx alot ok ill try to test it.so if i change vartick to 36000 that is half an hourand the set render type whatever number that is is how many can be spawned at a time?
What ever is in modTick happens every 1/20 of a second so that could work. The number in the Entity.setRenderType makes the mob look like like you. To see tghe rest of the rendertypes go to: https://github.com/Connor4898/ModPE-Scripts/wiki/Render-types
Link:
http://www.minecraft.../#entry29816329
works, but... there's something wrong. missing a } at the end
Correction:
var vill; var tick=400; function modTick(){ tick--; { if(tick==0){ var yyy= Math.floor((Math.random()*75)+50); var xxx= Math.floor(Math.random()*256); var zzz= Math.floor(Math.random()*256); vill= Level.spawnMob(xxx,yyy,zzz,11,"mob/char.png"); Entity.setNameTag(vill,"Villager"); Entity.setRenderType(vill, 3); tick=400; } } }i tested it, working. they are Cows with a different Render Type and Skin!
Where i can see the Mob IDs?
EDIT: Found the Mob IDs, http://minecraft.gamepedia.com/Data_values_(Pocket_Edition)#Entity_IDs
Game dev and Minecraft modder.
Twitter: @jv110br_
Whoops said untested but you should get rid of the { all together like this:
var vill; var tick=400; function modTick(){ tick--; if(tick==0){ var yyy= Math.floor((Math.random()*75)+50); var xxx= Math.floor(Math.random()*256); var zzz= Math.floor(Math.random()*256); vill= Level.spawnMob(xxx,yyy,zzz,11,"mob/char.png"); Entity.setNameTag(vill,"Villager"); Entity.setRenderType(vill, 3); tick=400; } }Link:
http://www.minecraft.../#entry29816329
Link:
http://www.minecraft.../#entry29816329
Game dev and Minecraft modder.
Twitter: @jv110br_
var vill; var tick=400; function modTick(){ tick--; if(tick==0){ var yyy= Math.floor((Math.random()*75)+50); var xxx= Math.floor(Math.random()*256); var zzz= Math.floor(Math.random()*256); vill= Level.spawnMob(xxx,yyy,zzz,36,"mob/pigzombie.png"); Entity.setNameTag(vill,"Herobrine"); Entity.setCarriedItem(vill, 278, 1, 0); Entity.setHealth(vill, 30); tick=400; } }Herobrine will have 30 health and will be holding a diamond pickaxe.
Game dev and Minecraft modder.
Twitter: @jv110br_
Game dev and Minecraft modder.
Twitter: @jv110br_
Ask as many as you want for me. I like helping
Game dev and Minecraft modder.
Twitter: @jv110br_
var randomizer = //whatever code is for rNdomizer
if(randomizer >0,<0.33){
//then this will be pick then so on
var vill; var tick=400; function modTick(){ tick--; if(tick==0){ var yyy= Math.floor((Math.random()*75)+50); var xxx= Math.floor(Math.random()*256); var zzz= Math.floor(Math.random()*256); vill= Level.spawnMob(xxx,yyy,zzz,11,"mob/char.png"); Entity.setNameTag(vill,"Villager"); Entity.setRenderType(vill, 3); Entity.setCarriedItem(vill, 177, 1, 0); tick=400; } }They will appear with a shovel in hands. untested but might not work because cows can't hold items.
Game dev and Minecraft modder.
Twitter: @jv110br_
tick--; Starts the countdown. So:
var tick = 60; //3 seconds function modTick(){ tick--; //Start the countdown if(tick == 0){ //If finished clientMessage("Times Up!"); //print in chat log "Times Up!" } }IF I post a mod download it and give me a +1 if you appreciate.
Make sure you give me a suggestion at my WIP topic darkPE
Make sure you click on that +1 button if I help you! ---------------->