Beispiel #1
0
 @Override
 public void applyRepeatedEffect(PixelmonEntityHelper user, PixelmonEntityHelper target) {
   ChatHandler.sendChat(
       user.getOwner(), target.getOwner(), user.getName() + " is hurt by poison!");
   user.attackEntityFrom(
       DamageSource.causeMobDamage((EntityLiving) user.getEntity()),
       (int) (((float) user.getMaxHealth()) * poisonAmount));
   poisonAmount += 1 / 16;
 }
Beispiel #2
0
  /** Attacks all entities inside this list, dealing 5 hearts of damage. */
  private void attackEntitiesInList(List par1List) {
    for (int var2 = 0; var2 < par1List.size(); ++var2) {
      Entity var3 = (Entity) par1List.get(var2);

      if (var3 instanceof EntityLivingBase) {
        var3.attackEntityFrom(DamageSource.causeMobDamage(this), 10.0F);
      }
    }
  }
Beispiel #3
0
 @Override
 public void applyRepeatedEffect(PixelmonEntityHelper user, PixelmonEntityHelper target) {
   ChatHandler.sendChat(
       user.getOwner(),
       target.getOwner(),
       user.getName() + " is trapped in a vortex and takes damage!");
   user.attackEntityFrom(
       DamageSource.causeMobDamage((EntityLiving) user.getEntity()),
       (int) (((float) user.getMaxHealth()) / 16));
 }
  /** Called by a player entity when they collide with an entity */
  public void onCollideWithPlayer(EntityPlayer par1EntityPlayer) {
    if (canDamagePlayer()) {
      int i = getSlimeSize();

      if (canEntityBeSeen(par1EntityPlayer)
          && getDistanceSqToEntity(par1EntityPlayer)
              < 0.59999999999999998D * (double) i * (0.59999999999999998D * (double) i)
          && par1EntityPlayer.attackEntityFrom(
              DamageSource.causeMobDamage(this), getAttackStrength())) {
        worldObj.playSoundAtEntity(
            this, "mob.slimeattack", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);
      }
    }
  }
  public void damage(int amount, CraftEntity source) {
    net.minecraft.src.DamageSource reason = net.minecraft.src.DamageSource.generic;

    if (source instanceof CraftHumanEntity) {
      reason =
          net.minecraft.src.DamageSource.causePlayerDamage(
              ((CraftHumanEntity) source).getMCPlayer());
    } else if (source instanceof CraftLivingEntity) {
      reason =
          net.minecraft.src.DamageSource.causeMobDamage(
              ((CraftLivingEntity) source).getEntityLiving());
    }

    getEntityLiving().damageEntity(reason, amount);
  }
Beispiel #6
0
 protected boolean attackEntityAsMob(Entity entity) {
   return entity.attackEntityFrom(DamageSource.causeMobDamage(this), 8);
 }
Beispiel #7
0
 public boolean attackEntityAsMob(Entity par1Entity) {
   return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), 3);
 }
 public boolean attackEntityAsMob(Entity par1Entity) {
   byte byte0 = ((byte) (isTamed() ? 4 : 2));
   return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), byte0);
 }