I dont know the function who use parameter and return to entity health,example : Player
so this the code
function attackHook(a,v) {
if(Entity.getHealth(getPlayerEnt())==-1){
Level.setTime(0);
}}
this mean,(I think) if player get damage,time will set to day,but doesn't happened
another problem
function useItem(x,y,z,I,b,s){
if(I==280&&Level.getHealth(getPlayerEnt()) < 20){
Entity.setHealth(getPlayerEnt(),Entity.getHealth(getPlayerEnt())+2));
}}
this mean(I think) if we tap a block with a stick and player health smaller than 20(full health),give two health to player,but bugged,not happened
I wish you can help me fix this problem,if work,I will give +1 for you who can fix this problem
I dont know the function who use parameter and return to entity health,example : Player
so this the code
function attackHook(a,v) {
if(Entity.getHealth(getPlayerEnt())==-1){
Level.setTime(0);
}}
this mean,(I think) if player get damage,time will set to day,but doesn't happened
another problem
function useItem(x,y,z,I,b,s){
if(I==280&&Level.getHealth(getPlayerEnt()) < 20){
Entity.setHealth(getPlayerEnt(),Entity.getHealth(getPlayerEnt())+2));
}}
this mean(I think) if we tap a block with a stick and player health smaller than 20(full health),give two health to player,but bugged,not happened
I wish you can help me fix this problem,if work,I will give +1 for you who can fix this problem
before that,sorry for my bad english :0
1. If you want it so that the player is damaged use:
function attackHook(a,v)
{
if(v==Player.getEnt())
{
Level.setTime(0);
}
}
This code will give you +2 health if you are low and tap it anything with a stick.
function useItem(x,y,z,itemId,blockId,side)
{
if(itemId==280&&Player.getHealth()<20)
{
Player.setHealth(Player.getHealth()+2);
}
}
1. If you want it so that the player is damaged use:
function attackHook(a,v)
{
if(v==Player.getEnt)
{
Level.setTime(0);
}
}
This code will give you +2 health if you are low and tap it anything with a stick.
function useItem(x,y,z,itemId,blockId,side)
{
if(itemId==280&&Player.getHealth()<20)
{
Player.setHealth(Player.getHealth()+2);
}
}
Hope this helps!
Enjoy!
~Matt
the function Player get damage still not work,tested some times ago.but +2 health work if:
function useItem(x,y,z,i,b,s){
}if(i==280&&Entity.getHealth(Player.getEntity())<20){
Entity.setHealth(Player.getEntity(),Entity.getHealth(Player.getEntity())+2);
}}
because when I tap a block with a stick,error:Cannot find function getHealth in object Player(),so I change that to Entity,use Player.getEntity(),work!
thanks for helping before that,by the way can you fix the 1st problem again?(2nd completed)
the function Player get damage still not work,tested some times ago.but +2 health work if:
function useItem(x,y,z,i,b,s){
}if(i==280&&Entity.getHealth(Player.getEntity())<20){
Entity.setHealth(Player.getEntity(),Entity.getHealth(Player.getEntity())+2);
}}
because when I tap a block with a stick,error:Cannot find function getHealth in object Player(),so I change that to Entity,use Player.getEntity(),work!
thanks for helping before that,by the way can you fix the 1st problem again?(2nd completed)
so this the code
function attackHook(a,v) { if(Entity.getHealth(getPlayerEnt())==-1){ Level.setTime(0); }}this mean,(I think) if player get damage,time will set to day,but doesn't happened
another problem
function useItem(x,y,z,I,b,s){ if(I==280&&Level.getHealth(getPlayerEnt()) < 20){ Entity.setHealth(getPlayerEnt(),Entity.getHealth(getPlayerEnt())+2)); }}this mean(I think) if we tap a block with a stick and player health smaller than 20(full health),give two health to player,but bugged,not happened
I wish you can help me fix this problem,if work,I will give +1 for you who can fix this problem
before that,sorry for my bad english :0
1. If you want it so that the player is damaged use:
function attackHook(a,v) { if(v==Player.getEnt()) { Level.setTime(0); } }This code will give you +2 health if you are low and tap it anything with a stick.
function useItem(x,y,z,itemId,blockId,side) { if(itemId==280&&Player.getHealth()<20) { Player.setHealth(Player.getHealth()+2); } }Hope this helps!
Enjoy!
~Matt
the function Player get damage still not work,tested some times ago.but +2 health work if:
function useItem(x,y,z,i,b,s){ }if(i==280&&Entity.getHealth(Player.getEntity())<20){ Entity.setHealth(Player.getEntity(),Entity.getHealth(Player.getEntity())+2); }}because when I tap a block with a stick,error:Cannot find function getHealth in object Player(),so I change that to Entity,use Player.getEntity(),work!
thanks for helping before that,by the way can you fix the 1st problem again?(2nd completed)
Fixed it