Package net.minecraft.entity

Examples of net.minecraft.entity.EntityLivingBase


    if(!worldObj.isRemote) {
      Entity entity = null;
      List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.addCoord(motionX, motionY, motionZ).expand(1.0D, 1.0D, 1.0D));
      double d0 = 0.0D;
      EntityLivingBase entitylivingbase = getThrower();

      for(int j = 0; j < list.size(); ++j) {
        Entity entity1 = (Entity) list.get(j);

        if(entity1.canBeCollidedWith() && (entity1 != entitylivingbase || ticksInAir >= 5)) {
View Full Code Here


    setType(type);
  }

  @Override
  protected void updateEntityActionState() {
    EntityLivingBase target = getAttackTarget();
    if(target != null) {
      double d0 = target.posX + target.width / 2 - posX;
      double d1 = target.posY + target.height / 2 - posY;
      double d2 = target.posZ + target.width / 2 - posZ;
      double d3 = d0 * d0 + d1 * d1 + d2 * d2;

      float mod = 0.45F;
      if(getType() == 1)
        mod = 0.1F;

      motionX += d0 / d3 * mod;
      motionY += d1 / d3 * mod;
      motionZ += d2 / d3 * mod;

      if(Math.sqrt(d3) < 1F) {
        if(summoner != null) {
          if(summoner instanceof EntityPlayer)
            target.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) summoner), damage);
          else {
            target.attackEntityFrom(DamageSource.causeMobDamage(summoner), damage);
          }
        } else target.attackEntityFrom(DamageSource.causeMobDamage(this), damage);
        die();
      }
    }

    renderYawOffset = rotationYaw = -((float)Math.atan2(motionX, motionZ)) * 180.0F / (float)Math.PI;
View Full Code Here

  {
    for(Object obj : worldObj.loadedEntityList)
    {
      if(obj instanceof EntityLivingBase)
      {
        EntityLivingBase entity = (EntityLivingBase)obj;

        if(entity.getUniqueID().equals(cachedEntityUUID))
        {
          latchedEntity = entity;
        }
      }
    }
View Full Code Here

  }

  @SubscribeEvent
  public void onEntityAttacked(LivingAttackEvent event)
  {
    EntityLivingBase base = event.entityLiving;

    if(base.getEquipmentInSlot(1) != null && base.getEquipmentInSlot(1).getItem() instanceof ItemFreeRunners)
    {
      ItemStack stack = base.getEquipmentInSlot(1);
      ItemFreeRunners boots = (ItemFreeRunners)stack.getItem();

      if(boots.getEnergy(stack) > 0 && event.source == DamageSource.fall)
      {
        boots.setEnergy(stack, boots.getEnergy(stack)-event.ammount*50);
 
View Full Code Here

  }

  @SubscribeEvent
  public void onEntityAttacked(LivingAttackEvent event)
  {
    EntityLivingBase base = event.entityLiving;

    if(base.getEquipmentInSlot(4) != null && base.getEquipmentInSlot(4).getItem() instanceof ItemGasMask)
    {
      ItemGasMask mask = (ItemGasMask)base.getEquipmentInSlot(4).getItem();

      if(base.getEquipmentInSlot(3) != null && base.getEquipmentInSlot(3).getItem() instanceof ItemScubaTank)
      {
        ItemScubaTank tank = (ItemScubaTank)base.getEquipmentInSlot(3).getItem();

        if(tank.getFlowing(base.getEquipmentInSlot(3)) && tank.getGas(base.getEquipmentInSlot(3)) != null)
        {
          if(event.source == DamageSource.magic)
          {
            event.setCanceled(true);
          }
View Full Code Here

     * Returns whether the EntityAIBase should begin execution.
     */
    @Override
    public boolean shouldExecute()
    {
        EntityLivingBase entitylivingbase = this.entityHost.getAttackTarget();

        if (entitylivingbase == null)
        {
            return false;
        }
View Full Code Here

        {
            this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.getMaxHealthSlimeling());

            if (this.getOwnerUsername().isEmpty())
            {
                EntityLivingBase owner = this.getOwner();

                if (owner != null)
                {
                    this.setOwnerUsername(owner.getCommandSenderName());
                }
            }
        }
    }
View Full Code Here

            {
                return false;
            }
            else
            {
                EntityLivingBase entitylivingbase = this.theEntity.getOwner();
                return entitylivingbase == null ? true : (this.theEntity.getDistanceSqToEntity(entitylivingbase) < 144.0D && entitylivingbase.getAITarget() != null ? false : this.isSitting);
            }
        }
View Full Code Here

        this.entityFlagDummy.ticksExisted = (int) FMLClientHandler.instance().getWorldClient().getTotalWorldTime();
        this.entityFlagDummy.setType(item.getItemDamage());

        if (type == ItemRenderType.EQUIPPED)
        {
            EntityLivingBase entityHolding = (EntityLivingBase) data[1];

            if (entityHolding instanceof EntityPlayer)
            {
                String playerName = ((EntityPlayer) entityHolding).getGameProfile().getName();
View Full Code Here

    public static void orientCamera(float partialTicks)
    {
        EntityClientPlayerMP player = ClientProxyCore.mc.thePlayer;
        GCPlayerStatsClient stats = GCPlayerStatsClient.get(player);

        EntityLivingBase entityLivingBase = ClientProxyCore.mc.renderViewEntity;
       
        if (player.ridingEntity instanceof EntityTieredRocket && ClientProxyCore.mc.gameSettings.thirdPersonView == 0)
        {
            EntityTieredRocket entity = (EntityTieredRocket) player.ridingEntity;         
            float offset = entity.getRotateOffset();
            GL11.glTranslatef(0, -offset, 0);
            float anglePitch = entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks;
            float angleYaw = entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks;
            GL11.glRotatef(-anglePitch, 0.0F, 0.0F, 1.0F);
            GL11.glRotatef(angleYaw, 0.0F, 1.0F, 0.0F);

            GL11.glTranslatef(0, offset, 0);
        }

        if (entityLivingBase.worldObj.provider instanceof WorldProviderOrbit && !entityLivingBase.isPlayerSleeping())
        {
            float f1 = entityLivingBase.yOffset - 1.62F;
            float pitch = entityLivingBase.prevRotationPitch + (entityLivingBase.rotationPitch - entityLivingBase.prevRotationPitch) * partialTicks;
            float yaw = entityLivingBase.prevRotationYaw + (entityLivingBase.rotationYaw - entityLivingBase.prevRotationYaw) * partialTicks + 180.0F;
            float eyeHeightChange = entityLivingBase.yOffset - entityLivingBase.width / 2.0F;
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.