Entity.setHealth(victim, Entity.getHealth(victim)//Health Hear can be negative numbers too);
Rollback Post to RevisionRollBack
Make sure you follow me on twitter! @DarkDiaMiner IF I post a mod download it and give me a +1 if you appreciate.
Make sure you give me a suggestion at my WIP topic darkPE
Make sure you click on that +1 button if I help you! ---------------->
If you want a certain block to do damage you can do it like this.
+1 if i helped
function useItem(x,y,z,itemId,blockId,side)
{
if(itemId==267)//If your iron sword hits anything
{
addItemInventory(1,1);//Add one stone in your inventory
}
}
function attackHook(attacker, victim)
{
if(getCarriedItem() == 1)
{
Entity.setHealth(victim, Entity.getHealth(victim) -12);//stone does 6 hearts of damage
}
}
Make sure you follow me on twitter! @DarkDiaMiner IF I post a mod download it and give me a +1 if you appreciate.
Make sure you give me a suggestion at my WIP topic darkPE
Make sure you click on that +1 button if I help you! ---------------->
To post a comment, please login or register a new account.
Im just a tester (@[email protected])¿?¿?¿?
Want GUI Templates? Done!
https://github.com/BeATz-UnKNoWN/ModPE_Scripts/wiki/ModPE-Script-Templates
P.S. Feel free to follow me so you know when I post "awesome" content and make the MCForums a brighter place (totally).
If you need to contact me you can either shoot a Kik message to beatz_unknown or send an email to [email protected]
IF I post a mod download it and give me a +1 if you appreciate.
Make sure you give me a suggestion at my WIP topic darkPE
Make sure you click on that +1 button if I help you! ---------------->
+1 if i helped
function useItem(x,y,z,itemId,blockId,side) { if(itemId==267)//If your iron sword hits anything { addItemInventory(1,1);//Add one stone in your inventory } } function attackHook(attacker, victim) { if(getCarriedItem() == 1) { Entity.setHealth(victim, Entity.getHealth(victim) -12);//stone does 6 hearts of damage } }IF I post a mod download it and give me a +1 if you appreciate.
Make sure you give me a suggestion at my WIP topic darkPE
Make sure you click on that +1 button if I help you! ---------------->