I'm trying to make a riding mod (+healing golden sword) but something went wrong in the code and i dont know what to do... the sword work but the other stuff dosn't work...
function useItem(x, y, z, itemId, blockId, side)
{
if(itemId==283)
{
halfHearts=Entity.getHealth(Player.getEntity());
halfHearts++;
Player.setHealth(halfHearts);
//(the sword)
}
else if(itemId==334) //leather
{
addItemInventory(329,1); // saddle
}
function attackHook(attacker, victim)
{
var ourItem = getCarriedItem();
if(ourItem==329)
{
preventDefault();
rideAnimal(attacker,victim);
}
}
function useItem(x, y, z, itemId, blockId, side) { if(itemId==283) { halfHearts=Entity.getHealth(Player.getEntity()); halfHearts++; Player.setHealth(halfHearts); //(the sword) } else if(itemId==334) //leather { addItemInventory(329,1); // saddle } function attackHook(attacker, victim) { var ourItem = getCarriedItem(); if(ourItem==329) { preventDefault(); rideAnimal(attacker,victim); } }Thanks for helpers!
function useItem(x, y, z, itemId, blockId, side) { if(itemId==283) { halfHearts=Entity.getHealth(Player.getEntity()); halfHearts++; Player.setHealth(halfHearts); //(the sword) } else if(itemId==334) //leather { addItemInventory(329,1); // saddle } } function attackHook(attacker, victim) { var ourItem = getCarriedItem(); if(ourItem==329) { preventDefault(); rideAnimal(attacker,victim); } }Tell me if it works.