Package net.minecraft.entity

Examples of net.minecraft.entity.EntityLivingBase


    public void applyEntityCollision(Entity entity) {
        if (Game.isHost(worldObj)) {
            if (entity.isDead)
                return;
            if (entity != this.riddenByEntity && (cartVelocityIsGreaterThan(0.2f) || getEntityData().getBoolean("HighSpeed")) && MiscTools.isKillabledEntity(entity)) {
                EntityLivingBase living = (EntityLivingBase) entity;
                if (RailcraftConfig.locomotiveDamageMobs())
                    living.attackEntityFrom(DamageSourceTrain.INSTANCE, getDamageToRoadKill(living));
                if (living.getHealth() > 0) {
                    float yaw = (rotationYaw - 90) * (float) Math.PI / 180.0F;
                    living.addVelocity(-MathHelper.sin(yaw) * KNOCKBACK * 0.5F, 0.2D, MathHelper.cos(yaw) * KNOCKBACK * 0.5F);
                }
                return;
            }
            if (entity instanceof EntityLocomotive) {
                LinkageManager lm = LinkageManager.instance();
View Full Code Here


        if ( pos.typeOfHit == MovingObjectType.ENTITY )
        {
          int dmg = (int) Math.ceil( penetration / 20.0f );
          if ( pos.entityHit instanceof EntityLivingBase )
          {
            EntityLivingBase el = (EntityLivingBase) pos.entityHit;
            penetration -= dmg;
            el.knockBack( p, 0, -direction.xCoord, -direction.zCoord );
            // el.knockBack( p, 0, vec3.xCoord,
            // vec3.zCoord );
            el.attackEntityFrom( dmgSrc, dmg );
            if ( !el.isEntityAlive() )
              hasDestroyedSomething = true;
          }
          else if ( pos.entityHit instanceof EntityItem )
          {
            hasDestroyedSomething = true;
View Full Code Here

                    InventoryManipulator.get(invInput).addStack(stack);
                    item.setDead();
                    useMasterEnergy(SUCKING_POWER_COST, true);
                }

                EntityLivingBase entity = MiscTools.getEntityAt(worldObj, EntityLivingBase.class, xCoord, yCoord + 1, zCoord);
                if (entity != null && useMasterEnergy(KILLING_POWER_COST, false))
                    if (entity.attackEntityFrom(DamageSourceCrusher.INSTANCE, 10))
                        useMasterEnergy(SUCKING_POWER_COST, true);
            }

            if (isMaster()) {
                if (clock % 16 == 0)
View Full Code Here

                double k = getZAhead(posZ, 3.3);
                double size = 0.8;
                List entities = worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getBoundingBox(i - size, posY, k - size, i + size, posY + 2, k + size));
                for (Object e : entities) {
                    if (e instanceof EntityLivingBase) {
                        EntityLivingBase ent = (EntityLivingBase) e;
                        ent.attackEntityFrom(DamageSourceBore.INSTANCE, 2);
                    }
                }
            }

            setMoving(hasFuel() && getDelay() == 0);
View Full Code Here

            AxisAlignedBB box = AxisAlignedBB.getBoundingBox(getX(), getY(), getZ(), getX() + 1, getY() + 1, getZ() + 1);
            box = box.expand(a, a, a);
            List entities = getWorld().getEntitiesWithinAABB(EntityLivingBase.class, box);

            if (entities.size() > 0) {
                EntityLivingBase entity = (EntityLivingBase) entities.get(MiscTools.getRand().nextInt(entities.size()));

                if (entity instanceof EntityPlayer) {
                    EntityPlayer player = (EntityPlayer) entity;
                    if (player.isSneaking()) {
                        return;
                    }

                    ItemStack current = player.getCurrentEquippedItem();
                    if (current != null && current.getItem() instanceof IToolCrowbar) {
                        return;
                    }
                } else if (excludedEntities.contains(entity.getClass())) {
                    return;
                } else if (entity instanceof EntitySlime) {
                    EntitySlime slime = (EntitySlime) entity;
                    if (slime.getSlimeSize() >= 100)
                        return;
                }

                if (entity.ridingEntity == null) {
                    EffectManager.instance.teleportEffect(entity, cart.posX, cart.posY, cart.posZ);
                    entity.mountEntity(cart);
                }
            }
        }
    }
View Full Code Here

            partialTick);
    float pitch;
    final float zeropointsixtwofive = 0.0625F;

    if (player.isRiding() && player.ridingEntity instanceof EntityLivingBase) {
      EntityLivingBase entitylivingbase1 = (EntityLivingBase) player.ridingEntity;
      yawOffset = this.interpolateRotation(entitylivingbase1.prevRenderYawOffset,
          entitylivingbase1.renderYawOffset, partialTick);
      pitch = MathHelper.wrapAngleTo180_float(yawRotation - yawOffset);

      if (pitch < -85.0F) {
View Full Code Here

    }

    @Override
    public void renderItem (ItemRenderType type, ItemStack item, Object... data)
    {
        EntityLivingBase living = (EntityLivingBase) data[1];
        ItemRenderer renderer = RenderManager.instance.itemRenderer;
        for (int i = 0; i < item.getItem().getRenderPasses(item.getItemDamage()) + 1; i++)
            renderItem(living, item, i, type);
    }
View Full Code Here

            break;
        case 3:
            type = "four.";
            break;
        }
        EntityLivingBase entityliving1 = par1EntityLiving.func_94060_bK();
        String s = "death." + type + this.damageType;
        String s1 = s + ".player";
        return entityliving1 != null && StatCollector.canTranslate(s1) ? new ChatComponentTranslation(s1, new Object[] { par1EntityLiving.func_145748_c_(), entityliving1.func_145748_c_() }) : new ChatComponentTranslation(s, new Object[] { par1EntityLiving.func_145748_c_() });
    }
View Full Code Here

                {
                    Iterator iterator = list1.iterator();

                    while (iterator.hasNext())
                    {
                        EntityLivingBase entityliving = (EntityLivingBase) iterator.next();
                        double d0 = this.getDistanceSqToEntity(entityliving);

                        if (d0 < 16.0D)
                        {
                            double d1 = 1.0D - Math.sqrt(d0) / 4.0D;

                            if (entityliving == par1MovingObjectPosition.entityHit)
                            {
                                d1 = 1.0D;
                            }

                            Iterator iterator1 = list.iterator();

                            while (iterator1.hasNext())
                            {
                                PotionEffect potioneffect = (PotionEffect) iterator1.next();
                                int i = potioneffect.getPotionID();

                                if (Potion.potionTypes[i].isInstant())
                                {
                                    Potion.potionTypes[i].affectEntity(this.getThrower(), entityliving, potioneffect.getAmplifier(), d1);
                                }
                                else
                                {
                                    int j = (int) (d1 * (double) potioneffect.getDuration() + 0.5D);

                                    if (j > 20)
                                    {
                                        entityliving.addPotionEffect(new PotionEffect(i, j, potioneffect.getAmplifier()));
                                    }
                                }
                            }
                        }
                    }
View Full Code Here

            return entity instanceof EntityTameable;
        }

        @Override
        public void addInfo(Entity entity, List<String> curInfo){
            EntityLivingBase owner = ((EntityTameable)entity).getOwner();
            if(owner != null) {
                curInfo.add("Owner: " + owner.getCommandSenderName());
            } else {
                curInfo.add("This animal can be tamed");
            }
        }
View Full Code Here

TOP

Related Classes of net.minecraft.entity.EntityLivingBase

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.