The title is pretty much selfexplanatory. I need some kind of setAttack function or something like that for my mod. Its basiclly gonna add some more weapons(replaced by discs which have 1attack power which is the reason of this post), and food for experiencing a better survival mode (at least until a nether update for pe is released LOL).
function attackHook(a,v) {
if(a == getPlayerEnt() && getCarriedItem() == YourItemId) {
Entity.setHealth(v,Entity.getHealth=1);
}
}
A little help on setting a lĂmited amount of uses(durability).