I'm making a new mod that adds weapons and it has its own texture, but I'm not able to get the item to work please help, if you want me to send you the code its right here:
I'm making a new mod that adds weapons and it has its own texture, but I'm not able to get the item to work please help, if you want me to send you the code its right here:
ModPE.setitem(500, map_empty, 0, "Cleaver");
function attackHook(a,v){
if(a == getPlayerEnt() && getCarriedItem() ==500){
var dmg = 5;
Entity.setHealth(v, Entity.getHealth(v) - dmg);
}
}
mob = victim
after
if(a == getPlayerEnt() && getCarriedItem == 500){
chance that first líne for ModPE.setItem with capital I.
or try replacing a with attacker
and v with victim.
function attackHook(a,v){
if(a == getPlayerEnt() && getCarriedItem() ==500){
var dmg = 5;
Entity.setHealth(v, Entity.getHealth(v) - dmg);
}
}
Map empty is string,you must start it using ' " ' and close it using ' " '
var init = false; function selectLevelHook() { if(!init) { ModPE.setitem(460, "map_empty", 0, "Cleaver"); init = true; } } function attackHook(a,v) { if(a == Player.getEnt() && Player.getCarriedItem() == 460) { var dmg = Entity.getHealth(v)-5; Entity.setHealth(v, dmg); } }