Hey I have a similar question and didnt want to go make a duplicate thread, but im trying to use the attack hook function (for blazes.) I want it to be set to where when I attack it with anything (sword, bare hands, etc...) that I take fire damage just like in pc? I have just about everything else good except that. Any help on functions would be greatly appreciated. Ive been reading alot online but most of the lists I come across are outdated or missing information....
I don't have an idea of how Jessey251. I am barely starting to learn, so I'm starting by making a simple food, weapon and decoration mod ( as shown on my signature XD ). By the way, if you have ever played PC Minecraft (played twice at a freind's house, then I got PE), you'll know that Blazes only do damage by TOUCHING YOU or SHOOTING FIREBALLS.
DiegoGTRRatty, thanks for the quick response, and I have never played pc but I imagine they havent implimented all the functions of pc into PE.....yet......but eventually they might. I will just keep trying different snips of codes until I get it right I guess.
DiegoGTRRatty, thanks for the quick response, and I have never played pc but I imagine they havent implimented all the functions of pc into PE.....yet......but eventually they might. I will just keep trying different snips of codes until I get it right I guess.
Here ya go
var fireTicks = 10; //Change this to how log you wan the player to be burning for
function attackHook(a, v){
if(Entity.getMobSkin(v) == "mob/blaze.png"){
Entity.setFireTicks(Player.getEntity(), fireTicks);
}
}
+1 if I helped!
Rollback Post to RevisionRollBack
Please give me an Internet. Please. Pretty Please with sprinkles on top
I have a twitter!! Follow me for regular updates on my mods! https://twitter.com/DamienMiller11
Please give me an Internet. Please. Pretty Please with sprinkles on top
I have a twitter!! Follow me for regular updates on my mods! https://twitter.com/DamienMiller11
To post a comment, please login or register a new account.
function attackhook(a, v) { attack1 = 9; if (a == getPlayerEnt() && getCarriedItem() == 502) { Entity.setHealth(v, Entity.getHealth()-attack1); } }
So:
function attackHook(a, v) {
var attack1 = 9;
if(a == getPlayerEnt() && Player.getCarriedItem () == 502){
Entity.setHealth (v, Entity.getHealth(v) - attack1)
}
}
Here ya go
var fireTicks = 10; //Change this to how log you wan the player to be burning for function attackHook(a, v){ if(Entity.getMobSkin(v) == "mob/blaze.png"){ Entity.setFireTicks(Player.getEntity(), fireTicks); } }+1 if I helped!
I have a twitter!! Follow me for regular updates on my mods!
https://twitter.com/DamienMiller11
I have a twitter!! Follow me for regular updates on my mods!
https://twitter.com/DamienMiller11