var mob;
function useItem(x,y,z,itemId,blockId,side){
if(itemId==280){
var mob = Level.spawnMob(x,y,z,32,"mob/creeper");
Entity.setHealth(mob,100);
}
}
Maybe just use the same mob dropping code and enter the custom item id.
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! ---------------->
var mob;
function useItem(x,y,z,itemId,blockId,side){
if(itemId==280){
var mob = Level.spawnMob(x,y,z,32,"mob/creeper");
Entity.setHealth(mob,100);
}
}
But wouldnt that apply to all of the zombies? (Zombie ID's are 32, if you were planning on making a creeper it should be 33)
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! ---------------->
var creep;
function useItem(x,y,z,itemId,blockId,side){
if(blockId==49){
var creep= Level.spawnMob(x+2,y+3,z,33,"mob/zombie.png");
Entity.setHealth(creep,125);
}
}
function deathHook(murderer, victim){
if(victim==creep){
clientMessage("some random text");
}
}
Works but not anymore if there are two.
My suggestion is arrays. (dzaima you know the joke in our pm)
//var mob;
var mobs=[];
function useItem(x,y,z,itemId,blockId,side){
if(itemId==280){
var mob = Level.spawnMob(x,y,z,32,"mob/creeper.png");// you forgot .png
//push to array
mobs[mobs.length]=mob;//I think there is a push function for arrays forgot it nevermind
Entity.setHealth(mob,100);
}
}
function deathHook(e){
for(var i=0;i<mobs.length;i++){
var mob=mobs[i];
if(e==mob){
doDrop(e);
break;
}
}
}
function doDrop(mob){
//Your code here --------- Treebl's quote (many people at first loved to add this in their scripts)
}
Rollback Post to RevisionRollBack
I can be found on Freenode IRC channels #pocketmine, #ModPEScripts, #LegendOfMCPE, #pmplugins or #BeaconMine.
I am a PocketMine-MP plugin developer. I hate it when people think that I love stupid admin positions. Being an admin is nothing compared to being a plugin developer.
I am also a main developer of BlockServer, a work-in-progress MCPE server software. You are welcome to download it, but it so far onlly spawns you in the upther (above the world). You can chat, though.
I do not own this server but I just love to put this banner here:
How Can I Make The Mob Drop Custom Item ?
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! ---------------->
Here
+ 1 if I helped.
+1 Me If I Helped You!
Follow Me On Twitter: @shadowdude246
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! ---------------->
He are right
http://www.twitter.com/AuthenticPixel
Still +1
Nothing happens
client message is not appearing. ..
Works but not anymore if there are two.
My suggestion is arrays. (dzaima you know the joke in our pm)
if (Entity.getEntityTypeId(victim) == 32) {
//your code
}
}