getCarriedItem () //you forgot (), because it is a function
Entity.getEntityTypeId (victim) //how should it get the mobid, if you didnt used a parameter ;). So for that: "victim"
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
the selected mob not valid
i need the fumction of that
i use function attack hook and selected mob = chicken,but makes chicken hurt(doesnt work)
this is an invalid mod
function attackHook(attacker,victim) { if(getCarriedItem == 295 && Entity.getEntityTypeId == 10&&chick==0) { preventDefault(); chick=1; addItemInventory(295,-1); print("1 more seed to a chicken!"); } else if(getCarriedItem == 295 && Entity.getEntityTypeId == 10&&chick==1) { preventDefault(); chick=0; addItemInventory(295,-1); Level.spawnMob(getPlayerX(),getPlayerY()+1,getPlayerZ()-1,10, "mob/chicken.png"); print("Chicken Breeding was completed"); } }i hope you can fix it!
function attackHook(attacker,victim) {
if(getCarriedItem == 295 && Entity.getEntityTypeId == 10&&chick==0) {
preventDefault();
chick=1;
addItemInventory(295,-1);
print("1 more seed to a chicken!");
} else if(getCarriedItem == 295 && Entity.getEntityTypeId == 10&&chick==1) {
preventDefault();
chick=0;
addItemInventory(295,-1);
Level.spawnMob(getPlayerX(),getPlayerY()+1,getPlayerZ()-1,10, "mob/chicken.png");
print("Chicken Breeding was completed");
}
}
why,this is right,but still not work(doesnt have any effect)
Entity.getEntityTypeId (victim) //how should it get the mobid, if you didnt used a parameter ;). So for that: "victim"