Item.addCraftRecipe(414, 1, 0, [49, 9, 0]); //se usa para crear espadas etc
Item.addCraftRecipe(450, 1, 0, [414, 2, 0, 280, 1, 0]); //jamas se rompe tiene un ataque de 5.5
function attackHook(attacker, victim) {function hurt(health) {if(Entity.getHealth(victim) > health) Entity.setHealth(victim, Entity.getHealth(victim) - health);
else {
Entity.setHealth(victim, 1);
}
}
var x = Entity.getX(victim);
var y = Entity.getY(victim);
var z = Entity.getZ(victim);
if(attacker == Player.getEntity()) switch(Player.getCarriedItem()) {
case 450:
hurt(5.5);
break;
}
// bIENVENIDO
clientMessage((ChatColor.WHITE +"Gracias por Probrar mi MOD")+(ChatColor.BLACK +"Drex360YT Survival!")+(ChatColor.WHITE
+ " DISFRUTALO!"));
ModPE.setItem(414, "coal", 0, "Obsidian Piece");
ModPE.setItem(450, "record_11", 0, "Obsidean Sword");
Item.addCraftRecipe(414, 1, 0, [49, 9, 0]); //se usa para crear espadas etc
Item.addCraftRecipe(450, 1, 0, [414, 2, 0, 280, 1, 0]); //jamas se rompe tiene un ataque de 5.5
function attackHook(attacker, victim) {function hurt(health) {if(Entity.getHealth(victim) > health) Entity.setHealth(victim, Entity.getHealth(victim) - health);
else {
Entity.setHealth(victim, 1);
}
}
var x = Entity.getX(victim);
var y = Entity.getY(victim);
var z = Entity.getZ(victim);
if(attacker == Player.getEntity()) switch(Player.getCarriedItem()) {
case 450:
hurt(5.5);
break;
}
// bIENVENIDO
clientMessage((ChatColor.WHITE +"Gracias por Probrar mi MOD")+(ChatColor.BLACK +"Drex360YT Survival!")+(ChatColor.WHITE
+ " DISFRUTALO!"));
Try moving function hurt (health)
{}
Out of function attackHook
Want Custom ModPE functions? Look here -> WolfyPE ModPE functions
Thanks can you fix it?