Posted March 20, 201411 yr When mob attacked, call attackEntityFrom(DamageSource par1DamageSource, float par2) how to get all enchant levels and get id or itemstack of weapon(Bow, sword, axe etc.) which was attacked mob?
March 20, 201411 yr I'm sorry, but your question is totally vague and ambiguous as asked. Could you please state it in a common language, such as English? -S- (if I helped, please click Thank and applaud) http://6upnqa.dm2301.livefilestore.com/y2mtf-vG7Tqq1TiiVpIm53KWj7294NDPoHfSHHb4PzZiMAUfRCfK0UY0MwOu7Q3zTBNVTKqWjr2-xgBfFRpQT5p-QivtvknPpoABMNUw9br9WuZcBFkjePhnAbW500gVm-P/sequiturian.png[/img]
March 21, 201411 yr Author Sorry my English Ok, Player have enchanted weapon(sword, axe, bow or other). When Player attack zombie or skeleton, executing event: EntityZombie:attackEntityFrom(DamageSource par1DamageSource, float par2) I need know: weapon of player and all enchant lvl
March 21, 201411 yr Use the LivingHurtEvent. Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! | mah twitter This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.
March 21, 201411 yr Get the entity doing the damage and find the weapon they hold: [*]Get the type of damage [*]If damage instanceof EntityDamageSource [*] get ((EntityDamageSource)damageSource).getEntity().getHeldItem() [*] check for enchantments Read the nbtTagList from here: public NBTTagList ItemStack#getEnchantmentTagList() If the list has elements, they will be the enchantments -S- (if I helped, please click Thank and applaud) http://6upnqa.dm2301.livefilestore.com/y2mtf-vG7Tqq1TiiVpIm53KWj7294NDPoHfSHHb4PzZiMAUfRCfK0UY0MwOu7Q3zTBNVTKqWjr2-xgBfFRpQT5p-QivtvknPpoABMNUw9br9WuZcBFkjePhnAbW500gVm-P/sequiturian.png[/img]
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.