This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
How do I have it so if I eat steak or something it will activate a function?
You can built one:
var h1=0;
var h2=0;
function modTick(){
h2=Entity.getHealth(getPlayerEnt());
h1=h1-8; //A Steak gives 4 live = 8 half-hearts. This hook will always activate if you eat something healing you 8 life
if(h1==h2){
//Your Code
}else{
h1=h2;
}
Quote from Clagdriff» You can built one: var h1=0; var h2=0; function modTick(){ h2=Entity.getHealth(getPlayerEnt()); h1=h1-8; //A Steak gives 4 live = 8 half-hearts. This hook will always activate if you eat something healing you 8 life if(h1==h2){ //Your Code }else{ h1=h2; } }
but if the player has 19 health then the food will only heal 1 health and this function will not work...
Quote from Eaglerex» but if the player has 19 health then the food will only heal 1 health and this function will not work...
You can built one Version 2:
if(h1>12){
h1=12;
How do I have it so if I eat steak or something it will activate a function?
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumYou can built one:
var h1=0;
var h2=0;
function modTick(){
h2=Entity.getHealth(getPlayerEnt());
h1=h1-8; //A Steak gives 4 live = 8 half-hearts. This hook will always activate if you eat something healing you 8 life
if(h1==h2){
//Your Code
}else{
h1=h2;
}
}
but if the player has 19 health then the food will only heal 1 health and this function will not work...
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumYou can built one Version 2:
var h1=0;
var h2=0;
function modTick(){
h2=Entity.getHealth(getPlayerEnt());
h1=h1-8; //A Steak gives 4 live = 8 half-hearts. This hook will always activate if you eat something healing you 8 life
if(h1==h2){
//Your Code
}else{
h1=h2;
if(h1>12){
h1=12;
}
}
}