Lol did not know preventDefault() can do that I thought in attackHook all it does was degate damage to the victim.
Exactly, preventDefault() does negate the damage to the victim. But when a zombie pigman is damaged it attacks you and moves. Therefore preventDefault() does more than just negate damage. It prevents the default!
function attackHook(attacker, victim) { if(Entity.getEntityTypeId(victim)==36) { if(getCarriedItem()==264) { clientMessage("Trade has started"); } } }Untested but should work.+1 me if I helped.
Link:
http://www.minecraft.../#entry29816329
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumfunction attackHook(attacker, victim) { if(Entity.getEntityTypeId(victim)==36) { if(getCarriedItem()==264) { preventDefault(); clientMessage("Trade has started"); } } }added preventDefault(); so the mob doesnt go running around like crazy. xD
Check out my game! It's an open-world, sandbox text adventure.
Follow @hexdro_
Hexdro © 2012-2015
Link:
http://www.minecraft.../#entry29816329
Exactly, preventDefault() does negate the damage to the victim. But when a zombie pigman is damaged it attacks you and moves. Therefore preventDefault() does more than just negate damage. It prevents the default!
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]
Game dev and Minecraft modder.
Twitter: @jv110br_
Notice how people who want help, only give a part of their code? They don't want their script to be stolen.
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]