I made a mod that makes mobs drop items like the pc version. For example, skeletons would drop bows with the mod installed. An error pops up when I enable it, and I just can't find out the problem. Here is the error.
}
org.mozilla.javascript.EvaluatorException: missing { before function body (Mo'MobDrops.js#6)
Please give me an Internet. Please. Pretty Please with sprinkles on top
I have a twitter!! Follow me for regular updates on my mods! https://twitter.com/DamienMiller11
Please give me an Internet. Please. Pretty Please with sprinkles on top
I have a twitter!! Follow me for regular updates on my mods! https://twitter.com/DamienMiller11
}
org.mozilla.javascript.EvaluatorException: missing { before function body (Mo'MobDrops.js#6)
(I obviously can't post all because its too long)
can anyone help me? Here is the code for my mod:
ModPE.setItem(368,"ender_pearl",0,"Ender Pearl");
ModPE.setItem(426,"rotten_flesh",0,"Rotten Flesh");
ModPE.setItem(427,"spider_eye",0,"Spider Eye");
{
function deathHook(murderer, victim)
}
{
if(Entity.getMobSkin(victim)=="mob/enderman.png")
{
Level.dropItem(
Your code is ModPE.setItem (368,"ender_pearl",0,"Ender Pearl");
And your trying to make a mob drop it right?
https://www.dropbox.com/s/uhnoqx0fjaqux8w/zombie drop ender pearl.js?dl=0
It means when you type /zombie you turn into a zombie and get a ender pearl. With the ender pearl you can tap it on the ground and teleport there.
ModPE.setItem(368,"ender_pearl",0,"Ender Pearl"); ModPE.setItem(426,"rotten_flesh",0,"Rotten Flesh"); ModPE.setItem(427,"spider_eye",0,"Spider Eye"); function deathHook(murderer, victim){ if(Entity.getMobSkin(victim)=="mob/enderman.png"){ //Your Drops } }So, what I saw wrong:
First of all, you don't need a bracket here:
{ function deathHook(murderer, victim)It needs to be like this, cos thats how it works with all hook functions:
function deathHook(murderer, victim){Then, with this:
if(Entity.getMobSkin(victim)=="mob/enderman.png") {This bit is right, and so is the rest!
+1 if I helped
I have a twitter!! Follow me for regular updates on my mods!
https://twitter.com/DamienMiller11
Or with "mob/zombie.png" mob/pig zombie.png" mob/skeleton.png" mob/spider.png" and so on....
I have a twitter!! Follow me for regular updates on my mods!
https://twitter.com/DamienMiller11
ModPE.setItem(368,"ender_pearl",0,"Ender Pearl");
ModPE.setItem(426,"rotten_flesh",0,"Rotten Flesh");
ModPE.setItem(427,"spider_eye",0,"Spider Eye");
{
function deathHook(murderer, victim)
}
{
if(Entity.getMobSkin(victim)=="mob/enderman.png")
{
Level.dropItem(Entity.getX(victim), Entity.getY(victim) + 1, Entity.getZ(victim), 0.5, 368, 1, 0);
}
{
function deathHook(murderer, victim)
}
{
if(Entity.getMobSkin(victim)=="mob/skeleton.png")
{
Level.dropItem(Entity.getX(victim), Entity.getY(victim) + 1, Entity.getZ(victim), 0.5, 261, 1, 0);
}
{
function deathHook(murderer, victim)
}
{
if(Entity.getMobSkin(victim)=="mob/zombie.png")
{
Level.dropItem(Entity.getX(victim), Entity.getY(victim) + 1, Entity.getZ(victim), 0.5, 426, 1, 0);
}
{
function deathHook(murderer, victim)
}
{
if(Entity.getMobSkin(victim)=="mob/spider.png")
{
Level.dropItem(Entity.getX(victim), Entity.getY(victim) + 1, Entity.getZ(victim), 0.5, 427, 1, 0);
}
}
ModPE.setItem(426,"rotten_flesh",0,"Rotten Flesh");
ModPE.setItem(427,"spider_eye",0,"Spider Eye");
function deathHook(murderer, victim){
if(Entity.getMobSkin(victim)=="mob/enderman.png")
{
//your code
}
}
Dude the reason the error is } is because youre missing one at the end of the script