This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
I add a Sword. How can I take damage?
Sorry for my English
ModPE.setItem(1234, "stick", 0, "Test Sword", 1);
Item.setHandEquiped(1234, true);
function attackHook(m, v){
if(Entity.getEntityTypeId(v) < 60){
if(Player.getCarriedItem() == 1234){//Change 1234 to your sword ID
Entity.setHealth(v, Entity.getHealth(v) - 20);//Change 20 to your amount of damage
Entity.setCarriedItem(getPlayerEnt(), 1234, 1, Player.getCarriedItemData() + 1);
}
The heck is this for
Thank you very much :-D
I add a Sword. How can I take damage?
Sorry for my English
ModPE.setItem(1234, "stick", 0, "Test Sword", 1);
Item.setHandEquiped(1234, true);
function attackHook(m, v){
if(Entity.getEntityTypeId(v) < 60){
if(Player.getCarriedItem() == 1234){//Change 1234 to your sword ID
Entity.setHealth(v, Entity.getHealth(v) - 20);//Change 20 to your amount of damage
Entity.setCarriedItem(getPlayerEnt(), 1234, 1, Player.getCarriedItemData() + 1);
}
}
}
The heck is this for
Thank you very much :-D