net.minecraft.entity.monster.EntitySkeleton Java Examples

The following examples show how to use net.minecraft.entity.monster.EntitySkeleton. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BiomeGlacier.java    From CommunityMod with GNU Lesser General Public License v2.1 6 votes vote down vote up
public BiomeGlacier(boolean isSpikes) {
    super(getProperties(isSpikes));
    this.isSpikes = isSpikes;
    this.topBlock = Blocks.SNOW.getDefaultState();
    this.fillerBlock = Blocks.ICE.getDefaultState();
    decorator.treesPerChunk = 1;
    decorator.extraTreeChance = 4;
    this.spawnableCreatureList.clear();
    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityRabbit.class, 10, 2, 3));
    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityPolarBear.class, 1, 1, 2));

    this.spawnableMonsterList.removeIf(spawnentry -> spawnentry.entityClass == EntitySkeleton.class);

    this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntitySkeleton.class, 20, 4, 4));
    this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityStray.class, 80, 4, 4));
}
 
Example #2
Source File: BiomeGlacier.java    From Traverse-Legacy-1-12-2 with MIT License 6 votes vote down vote up
public BiomeGlacier(boolean isSpikes) {
    super(getProperties(isSpikes));
    this.isSpikes = isSpikes;
    this.topBlock = Blocks.SNOW.getDefaultState();
    this.fillerBlock = Blocks.ICE.getDefaultState();
    decorator.treesPerChunk = 1;
    decorator.extraTreeChance = 4;
    this.spawnableCreatureList.clear();
    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityRabbit.class, 10, 2, 3));
    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityPolarBear.class, 1, 1, 2));

    this.spawnableMonsterList.removeIf(spawnentry -> spawnentry.entityClass == EntitySkeleton.class);

    this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntitySkeleton.class, 20, 4, 4));
    this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityStray.class, 80, 4, 4));
}
 
Example #3
Source File: BiomeGenPumpkin.java    From AdvancedRocketry with MIT License 6 votes vote down vote up
public BiomeGenPumpkin(int biomeId, boolean register) {
	super(new BiomeProperties("Pumpkin").setBaseHeight(1f).setHeightVariation(0.1f).setTemperature(0.9f).setRainDisabled());
	
	//cold and dry
	registerBiome(biomeId, "Pumpkin", this);
	
	
	this.decorator.generateFalls=false;
	this.decorator.flowersPerChunk=0;
	this.decorator.grassPerChunk=5;
	this.decorator.treesPerChunk=0;
	this.fillerBlock = Blocks.DIRT.getDefaultState();
	this.topBlock = Blocks.PUMPKIN.getDefaultState();
	
	this.spawnableMonsterList.clear();
	this.spawnableWaterCreatureList.clear();
	this.spawnableCaveCreatureList.clear();
	this.spawnableCreatureList.clear();
	this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntitySkeleton.class, 10, 1, 10));
}
 
Example #4
Source File: MoCreatures.java    From mocreaturesdev with GNU General Public License v3.0 6 votes vote down vote up
public static void ClearVanillaMobSpawns()
{
    for (int i = 0; i < BiomeGenBase.biomeList.length; i++)
    {
        if (BiomeGenBase.biomeList[i] != null)
        {
            EntityRegistry.removeSpawn(EntityCreeper.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntitySkeleton.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityZombie.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntitySpider.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityEnderman.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityCaveSpider.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntitySlime.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityGhast.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityPigZombie.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityMagmaCube.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityOcelot.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
        }
    }
}
 
Example #5
Source File: SubModTightPants.java    From CommunityMod with GNU Lesser General Public License v2.1 5 votes vote down vote up
@SubscribeEvent
public static void onSpecialSpawn (SpecialSpawn event) {
	
	EntityLivingBase entity = event.getEntityLiving();
	if (Math.random() < (spawnChance * event.getWorld().getDifficulty().getId()) && (entity instanceof EntityZombie || entity instanceof EntitySkeleton)) {
		
		entity.setItemStackToSlot(EntityEquipmentSlot.LEGS, new ItemStack(tightPants));
	}
}
 
Example #6
Source File: Chickenificator.java    From CommunityMod with GNU Lesser General Public License v2.1 5 votes vote down vote up
@SuppressWarnings("deprecation")
@Override
public void onInit(FMLInitializationEvent event) {
	FMLLog.log.info("Chickenification is beginning...");
	//RenderingRegistry.registerEntityRenderingHandler(EntitySheep.class, new RenderStupidChicken());
	RenderingRegistry.registerEntityRenderingHandler(EntityCow.class, new RenderStupidChicken());
	RenderingRegistry.registerEntityRenderingHandler(EntityPig.class, new RenderStupidChicken());
	RenderingRegistry.registerEntityRenderingHandler(EntitySquid.class, new RenderStupidChicken());
	RenderingRegistry.registerEntityRenderingHandler(EntityZombie.class, new RenderStupidChicken());
	RenderingRegistry.registerEntityRenderingHandler(EntitySpider.class, new RenderStupidChicken());
	RenderingRegistry.registerEntityRenderingHandler(EntitySkeleton.class, new RenderStupidChicken());
	FMLLog.log.info("Chickenificated all the bois!");
}
 
Example #7
Source File: EntityAINearestAttackableTargetFiltered.java    From Wizardry with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Returns whether the EntityAIBase should begin execution.
 */
@SuppressWarnings("unchecked")
public boolean shouldExecute() {
	if (this.targetChance > 0 && this.taskOwner.getRNG().nextInt(this.targetChance) != 0) {
		return false;
	} else if (this.targetClass != EntityPlayer.class && this.targetClass != EntityPlayerMP.class) {
		List<T> list = this.taskOwner.world.getEntitiesWithinAABB(this.targetClass, this.getTargetableArea(this.getTargetDistance()), this.targetEntitySelector);

		if (list.isEmpty()) {
			return false;
		} else {
			list.sort(this.sorter);
			this.targetEntity = list.get(0);
			return true;
		}
	} else {
		this.targetEntity = (T) this.taskOwner.world.getNearestAttackablePlayer(this.taskOwner.posX, this.taskOwner.posY + (double) this.taskOwner.getEyeHeight(), this.taskOwner.posZ, this.getTargetDistance(), this.getTargetDistance(), new Function<EntityPlayer, Double>() {
			@Nullable
			public Double apply(@Nullable EntityPlayer p_apply_1_) {
				ItemStack itemstack = p_apply_1_.getItemStackFromSlot(EntityEquipmentSlot.HEAD);

				if (itemstack.getItem() == Items.SKULL) {
					int i = itemstack.getItemDamage();
					boolean flag = EntityAINearestAttackableTargetFiltered.this.taskOwner instanceof EntitySkeleton && i == 0;
					boolean flag1 = EntityAINearestAttackableTargetFiltered.this.taskOwner instanceof EntityZombie && i == 2;
					boolean flag2 = EntityAINearestAttackableTargetFiltered.this.taskOwner instanceof EntityCreeper && i == 4;

					if (flag || flag1 || flag2) {
						return Double.valueOf(0.5D);
					}
				}

				return Double.valueOf(1.0D);
			}
		}, (Predicate<EntityPlayer>) this.targetEntitySelector);
		return this.targetEntity != null;
	}
}
 
Example #8
Source File: AuraEffects.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void doBlockEffect(ChunkCoordinates originTile, ChunkCoordinates selectedBlock, World world) {
    EntityLiving mob = world.rand.nextBoolean() ? new EntitySkeleton(world) : new EntityZombie(world);
    if(setAndCheckPosition(mob, selectedBlock, world, true) && world.difficultySetting != EnumDifficulty.PEACEFUL) {
        for(int i = 0; i < 5; i++) {
            mob.setCurrentItemOrArmor(i, null);
        }

        int timeout = 40;
        int totalCount = (world.rand.nextInt(3) == 0 ? 1 : 0) + 2;
        do {
            int slot = mob.getEquipmentInSlot(0) == null ? 0 : (mob.getEquipmentInSlot(4) == null ? 4 : (world.rand.nextInt(3)+1));
            if(mob.getEquipmentInSlot(slot) == null) {
                ItemStack[] items = ITEMS_SOUL[slot];
                ItemStack stack = items[world.rand.nextInt(items.length)];
                if(stack.getItem() != Items.bow || mob instanceof EntitySkeleton) {
                    totalCount--;
                    mob.setCurrentItemOrArmor(slot, stack);
                    mob.setEquipmentDropChance(slot, 0);
                }
            }
            timeout--;
        } while (totalCount > 0 && timeout > 0);

        if(timeout > 0) {
            mob.addPotionEffect(new PotionEffect(Potion.invisibility.getId(), MiscUtils.ticksForMinutes(60*24*365), 1, true));

            ChunkCoordinates pos = new ChunkCoordinates((int) mob.posX, (int) mob.posY, (int) mob.posZ);
            pos = iterateDown(pos, world);
            mob.setPosition(pos.posX + 0.5, pos.posY, pos.posZ + 0.5);
            world.spawnEntityInWorld(mob);
        }
    }
}
 
Example #9
Source File: ServerEventHandler.java    From Et-Futurum with The Unlicense 5 votes vote down vote up
private int getHeadMetadata(EntityLivingBase entity) {
	if (entity.getClass() == EntityZombie.class)
		return 2;
	else if (entity.getClass() == EntitySkeleton.class && ((EntitySkeleton) entity).getSkeletonType() == 0)
		return 0;
	else if (entity.getClass() == EntityCreeper.class)
		return 4;

	return -1;
}
 
Example #10
Source File: BlockFluidWitchwater.java    From ExNihiloAdscensio with MIT License 4 votes vote down vote up
@Override
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity) {
	
	if (world.isRemote)
		return;
	
	if (entity.isDead)
		return;
	
	if (entity instanceof EntitySkeleton) {
		
		EntitySkeleton skeleton = (EntitySkeleton) entity;
		if (skeleton.getSkeletonType() == SkeletonType.NORMAL) {
			skeleton.setSkeletonType(SkeletonType.WITHER);
			skeleton.setHealth(skeleton.getMaxHealth());
			
			return;
		}
	}
	
	if (entity instanceof EntityCreeper) {
		EntityCreeper creeper = (EntityCreeper) entity;
		if (!creeper.getPowered()) {
			creeper.onStruckByLightning(null);
			creeper.setHealth(creeper.getMaxHealth());
			
			return;
		}
	}
	
	if (entity instanceof EntitySpider && !(entity instanceof EntityCaveSpider)) {
		EntitySpider spider = (EntitySpider) entity;
		spider.setDead();
		
		EntityCaveSpider caveSpider = new EntityCaveSpider(world);
		caveSpider.setLocationAndAngles(spider.posX, spider.posY, spider.posZ, spider.rotationYaw, spider.rotationPitch);
		caveSpider.renderYawOffset = spider.renderYawOffset;
		caveSpider.setHealth(caveSpider.getMaxHealth());
		
		world.spawnEntity(caveSpider);
		
		return;
	}
	
	if (entity instanceof EntitySquid) {
		EntitySquid squid = (EntitySquid) entity;
		squid.setDead();
		
		EntityGhast ghast = new EntityGhast(world);
		ghast.setLocationAndAngles(squid.posX, squid.posY, squid.posZ, squid.rotationYaw, squid.rotationPitch);
		ghast.renderYawOffset = squid.renderYawOffset;
		ghast.setHealth(ghast.getMaxHealth());
		
		world.spawnEntity(ghast);
		
		return;
	}
	
	if (entity instanceof EntityAnimal) {
		((EntityAnimal) entity).onStruckByLightning(null);
		return;
	}
	
	if (entity instanceof EntityPlayer) {
		EntityPlayer player = (EntityPlayer) entity;
		player.addPotionEffect(new PotionEffect(MobEffects.BLINDNESS, 210, 0));
		player.addPotionEffect(new PotionEffect(MobEffects.WEAKNESS, 210, 2));
		player.addPotionEffect(new PotionEffect(MobEffects.WITHER, 210, 0));
		player.addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 210, 0));
	}
}
 
Example #11
Source File: RenderFallenKnight.java    From EnderZoo with Creative Commons Zero v1.0 Universal 4 votes vote down vote up
@Override
public Render<? super EntitySkeleton> createRenderFor(RenderManager manager) {
  return new RenderFallenKnight(manager);
}
 
Example #12
Source File: MoCEntityHorseMob.java    From mocreaturesdev with GNU General Public License v3.0 4 votes vote down vote up
public void onLivingUpdate()
{

    super.onLivingUpdate();

    if (isOnAir() && isFlyer() && rand.nextInt(5) == 0)
    {
        wingFlapCounter = 1;
    }
    
    if (rand.nextInt(200)==0)
    {
        moveTail();
    }
    
    if (!isOnAir() && (this.riddenByEntity == null) && rand.nextInt(250)==0)
    {
        stand();
    }
    
    if ((getType() == 38) && (rand.nextInt(50) == 0) && !MoCreatures.isServer())
    {
        LavaFX();
    }
    
    if ((getType() == 23) && (rand.nextInt(50) == 0) && !MoCreatures.isServer())
    {
        UndeadFX();
    }
    
    
    
    if (MoCreatures.isServer())
        
    {
        if (isFlyer() && rand.nextInt(500) == 0)
        {
            wingFlap();
        }
        
        if (this.worldObj.isDaytime())
        {
            float var1 = this.getBrightness(1.0F);

            if (var1 > 0.5F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) && this.rand.nextFloat() * 30.0F < (var1 - 0.4F) * 2.0F)
            {
                this.setFire(8);
            }
        }
        
        if (!isOnAir() && (this.riddenByEntity == null) && rand.nextInt(300)==0)
        {
            setEating();
        }
        

        
        
        
        
        
        
        if (this.riddenByEntity == null)
        {
        List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.expand(4D, 3D, 4D));
        for(int i = 0; i < list.size(); i++)
        {
            Entity entity = (Entity) list.get(i);
            if(!(entity instanceof EntityMob))
            {
                continue;
            }
            EntityMob entitymob = (EntityMob) entity;
            if(entitymob.ridingEntity == null && (entitymob instanceof EntitySkeleton || entitymob instanceof EntityZombie))
            {
                entitymob.mountEntity(this);
                break;
            }
        }
        }
    }

}