Is There Any Way To Detect Which Food A Player Has Eaten ?Like Eating Golden Apple Can Give You Regeneration Using function modTick() and functionsetPlayerHealth(halfHearts);
I found a way, but it's buggy:
1) If the last piece of bread in your hand get's eaten, it doesn't return the clientMessage
2) If your held item is bread, and you put one in a chest, it says you have eaten one
3) if you put more than one in the chest, and then eat one, it doesn't return the clientMessage
var active = 0;
var heldItemAmount = 0;
function modTick() {
if(Player.getCarriedItem() == 297) {//bread
if(active == 0) {
heldItemAmount = Player.getCarriedItemCount();
active = 1;
return;
} if(active == 1) {
if(heldItemAmount - 1 == Player.getCarriedItemCount()) {
clientMessage("Bread has been eaten!");
active = 0;
}
}
}
}
Thanks
I Think I Will Have To Use This For Now In My Mod Because Its The Only Way To Do It
I Can Add Lots Of Food If I Can Know How To Detect Which Food The Player Has Eaten
Thanks
Thanks
I Think I Will Have To Use This For Now In My Mod Because Its The Only Way To Do It
I Don't Know
Ummmm
I Know How To Add Custom Food But I Want To Give A Regeneration Effect To The Player When He Eats A Golden Apple...