예제 #1
0
 @SubscribeEvent
 public void livingAttack(LivingAttackEvent event) {
   if (event.source instanceof EntityDamageSourceIndirect) {
     EntityDamageSourceIndirect dmgSrc = (EntityDamageSourceIndirect) event.source;
     if (dmgSrc.getSourceOfDamage() instanceof EntityTippedArrow) {
       EntityTippedArrow tippedArrow = (EntityTippedArrow) dmgSrc.getSourceOfDamage();
       if (!tippedArrow.worldObj.isRemote)
         event.entityLiving.addPotionEffect(tippedArrow.getEffect());
     }
   }
 }