當前位置: 首頁>>代碼示例>>Java>>正文


Java EntityChicken類代碼示例

本文整理匯總了Java中net.minecraft.entity.passive.EntityChicken的典型用法代碼示例。如果您正苦於以下問題:Java EntityChicken類的具體用法?Java EntityChicken怎麽用?Java EntityChicken使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


EntityChicken類屬於net.minecraft.entity.passive包,在下文中一共展示了EntityChicken類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: BiomeGenJungle

import net.minecraft.entity.passive.EntityChicken; //導入依賴的package包/類
public BiomeGenJungle(int p_i45379_1_, boolean p_i45379_2_)
{
    super(p_i45379_1_);
    this.field_150614_aC = p_i45379_2_;

    if (p_i45379_2_)
    {
        this.theBiomeDecorator.treesPerChunk = 2;
    }
    else
    {
        this.theBiomeDecorator.treesPerChunk = 50;
    }

    this.theBiomeDecorator.grassPerChunk = 25;
    this.theBiomeDecorator.flowersPerChunk = 4;

    if (!p_i45379_2_)
    {
        this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityOcelot.class, 2, 1, 1));
    }

    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4));
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:25,代碼來源:BiomeGenJungle.java

示例2: spawnEvent

import net.minecraft.entity.passive.EntityChicken; //導入依賴的package包/類
@SubscribeEvent
public void spawnEvent(EntityJoinWorldEvent event) {
	if (event.entity instanceof EntityPig) {
		EntityPig pig = (EntityPig) event.entity;
		if (EtFuturum.enableBeetroot)
			pig.tasks.addTask(4, new EntityAITempt(pig, 1.2, ModItems.beetroot, false));
	} else if (event.entity instanceof EntityChicken) {
		EntityChicken chicken = (EntityChicken) event.entity;
		if (EtFuturum.enableBeetroot)
			chicken.tasks.addTask(3, new EntityAITempt(chicken, 1.0D, ModItems.beetroot_seeds, false));
	} else if (event.entity instanceof EntityWolf) {
		EntityWolf wolf = (EntityWolf) event.entity;
		if (EtFuturum.enableRabbit)
			wolf.targetTasks.addTask(4, new EntityAITargetNonTamed(wolf, EntityRabbit.class, 200, false));
	} else if (event.entity instanceof EntityVillager) {
		EntityVillager villager = (EntityVillager) event.entity;
		for (Object obj : villager.tasks.taskEntries) {
			EntityAITaskEntry entry = (EntityAITaskEntry) obj;
			if (entry.action instanceof EntityAIOpenDoor) {
				villager.tasks.removeTask(entry.action);
				villager.tasks.addTask(entry.priority, new EntityAIOpenCustomDoor(villager, true));
				break;
			}
		}
	}
}
 
開發者ID:jm-organization,項目名稱:connor41-etfuturum2,代碼行數:27,代碼來源:ServerEventHandler.java

示例3: interactEntityEvent

import net.minecraft.entity.passive.EntityChicken; //導入依賴的package包/類
@SubscribeEvent
public void interactEntityEvent(EntityInteractEvent event) {
	ItemStack stack = event.entityPlayer.getCurrentEquippedItem();
	if (stack == null)
		return;
	if (!(event.target instanceof EntityAnimal))
		return;

	EntityAnimal animal = (EntityAnimal) event.target;
	if (!animal.isChild()) {
		if (animal instanceof EntityPig) {
			if (stack.getItem() == ModItems.beetroot && EtFuturum.enableBeetroot)
				setAnimalInLove(animal, event.entityPlayer, stack);
		} else if (animal instanceof EntityChicken)
			if (stack.getItem() == ModItems.beetroot_seeds && EtFuturum.enableBeetroot)
				setAnimalInLove(animal, event.entityPlayer, stack);
	} else if (EtFuturum.enableBabyGrowthBoost && isFoodItem(animal, stack))
		feedBaby(animal, event.entityPlayer, stack);
}
 
開發者ID:jm-organization,項目名稱:connor41-etfuturum2,代碼行數:20,代碼來源:ServerEventHandler.java

示例4: BiomeTropicalShrubland

import net.minecraft.entity.passive.EntityChicken; //導入依賴的package包/類
public BiomeTropicalShrubland() {
    super(new Biome.BiomeProperties("Tropical Shrubland")
            .setBaseHeight(0.105f)
            .setHeightVariation(0.15f)
            .setTemperature(1.1f)
            .setRainfall(0.45f)
    );

    this.setRegistryName(Ref.MODID+":tropical_shrubland");
    this.decorator.treesPerChunk = 5;
    this.decorator.grassPerChunk = 10;
    this.decorator.flowersPerChunk = 4;

    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityChicken.class, 5, 4, 4));
    Ref.BIOMES.add(this);
}
 
開發者ID:stuebz88,項目名稱:modName,代碼行數:17,代碼來源:BiomeTropicalShrubland.java

示例5: maximumOvercluck

import net.minecraft.entity.passive.EntityChicken; //導入依賴的package包/類
@SubscribeEvent
public void maximumOvercluck(LivingEvent.LivingUpdateEvent event) {
	
	if (!event.getEntityLiving().worldObj.isRemote && event.getEntityLiving() instanceof EntityChicken) {
		EntityChicken chicken = (EntityChicken)event.getEntityLiving();
		NBTTagCompound tag = chicken.getEntityData();
		if (!chicken.isChild() && tag.hasKey(ItemGeneric.TAG_OVERCLUCK)) {
			int timer = tag.getInteger(ItemGeneric.TAG_OVERCLUCK);
			tag.setInteger(ItemGeneric.TAG_OVERCLUCK, --timer);
			if (--timer <= 0)
			{
	            chicken.playSound(SoundEvents.ENTITY_CHICKEN_EGG, 1.0F, (chicken.worldObj.rand.nextFloat() - chicken.worldObj.rand.nextFloat()) * 0.2F + 1.0F);
	            chicken.dropItem(Items.EGG, 1);
	            timer = chicken.worldObj.rand.nextInt(60) + 900;
	            tag.setInteger(ItemGeneric.TAG_OVERCLUCK, timer);
			}
		}
	}
}
 
開發者ID:bafomdad,項目名稱:uniquecrops,代碼行數:20,代碼來源:UCEventHandlerServer.java

示例6: BiomeJungle

import net.minecraft.entity.passive.EntityChicken; //導入依賴的package包/類
public BiomeJungle(boolean isEdgeIn, Biome.BiomeProperties properties)
{
    super(properties);
    this.isEdge = isEdgeIn;

    if (isEdgeIn)
    {
        this.theBiomeDecorator.treesPerChunk = 2;
    }
    else
    {
        this.theBiomeDecorator.treesPerChunk = 50;
    }

    this.theBiomeDecorator.grassPerChunk = 25;
    this.theBiomeDecorator.flowersPerChunk = 4;

    if (!isEdgeIn)
    {
        this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityOcelot.class, 2, 1, 1));
    }

    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityChicken.class, 10, 4, 4));
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:25,代碼來源:BiomeJungle.java

示例7: EntityZombieCat

import net.minecraft.entity.passive.EntityChicken; //導入依賴的package包/類
public EntityZombieCat(World world, boolean isHusk) {
    super(world);

    this.setMobType(isHusk ? EnumUndeadMobType.HUSK : EnumUndeadMobType.ZOMBIE);

    ((PathNavigateGround) this.getNavigator()).setCanSwim(true);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIAttackMelee(this, 1, false));
    this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1));
    this.tasks.addTask(6, new EntityAIWander(this, 1));
    this.tasks.addTask(5, new EntityAIMoveThroughVillage(this, 1, false));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, false));
    if (ExtendedConfig.zombiePetsAttackPets) {
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityWolf.class, false));
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityOcelot.class, false));
    }
    if (ExtendedConfig.zombiePetsAttackAnimals) {
        this.targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityChicken.class, false));
    }

    this.targetTasks.addTask(4, new EntityAINearestAttackableHorse(this, false));
}
 
開發者ID:NightKosh,項目名稱:Gravestone-mod-Extended,代碼行數:23,代碼來源:EntityZombieCat.java

示例8: AfterBuilding

import net.minecraft.entity.passive.EntityChicken; //導入依賴的package包/類
/**
 * This method is used after the main building is build for any additional
 * structures or modifications.
 * 
 * @param configuration The structure configuration.
 * @param world The current world.
 * @param originalPos The original position clicked on.
 * @param assumedNorth The assumed northern direction.
 * @param player The player which initiated the construction.
 */
@Override
public void AfterBuilding(StructureConfiguration configuration, World world, BlockPos originalPos, EnumFacing assumedNorth, EntityPlayer player)
{
	if (this.chickenCoopBlockPos != null)
	{
		// For the chicken coop, spawn 1 chicken above a hay bale.
		for (int i = 0; i < 1; i++)
		{
			EntityChicken entity = new EntityChicken(world);
			entity.setPosition(this.chickenCoopBlockPos.getX(), this.chickenCoopBlockPos.getY(), this.chickenCoopBlockPos.getZ());
			world.spawnEntity(entity);
		}
		
		this.chickenCoopBlockPos = null;
	}
}
 
開發者ID:Brian-Wuest,項目名稱:MC-Prefab,代碼行數:27,代碼來源:StructureChickenCoop.java

示例9: EntityKitty

import net.minecraft.entity.passive.EntityChicken; //導入依賴的package包/類
public EntityKitty(World p_i1688_1_)
{
    super(p_i1688_1_);
    this.setSize(0.6F, 0.8F);
    this.getNavigator().setAvoidsWater(true);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, this.aiSit);
    this.tasks.addTask(3, this.aiTempt = new EntityAITempt(this, 0.6D, Items.fish, true));
    //this.tasks.addTask(4, new EntityAIAvoidEntity(this, EntityPlayer.class, 16.0F, 0.8D, 1.33D));
    this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 5.0F));
    this.tasks.addTask(6, new EntityAIKittySit(this, 1.33D));
    this.tasks.addTask(7, new EntityAILeapAtTarget(this, 0.3F));
    this.tasks.addTask(8, new EntityAIOcelotAttack(this));
    this.tasks.addTask(9, new EntityAIMate(this, 0.8D));
    this.tasks.addTask(10, new EntityAIWander(this, 0.8D));
    this.tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F));
    this.targetTasks.addTask(1, new EntityAITargetNonTamed(this, EntityChicken.class, 750, false));
    this.hasCustomNameTag();
    this.setCustomNameTag("Kitty");
}
 
開發者ID:jtrent238,項目名稱:PopularMMOS-EpicProportions-Mod,代碼行數:21,代碼來源:EntityKitty.java

示例10: itemInteractionForEntity

import net.minecraft.entity.passive.EntityChicken; //導入依賴的package包/類
@Override
public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase target) {

	if (target.worldObj.isRemote || ItemStackHelper.getItemDamage(stack) != WORMS)
		return false;

	if (target instanceof EntityChicken) {

		// If the chicken is a child, make it an adult. If it is
		// an adult, accelerate egg laying.
		final EntityChicken chicken = (EntityChicken) target;
		if (chicken.isChild()) {
			chicken.setGrowingAge(-1);
		} else {
			chicken.timeUntilNextEgg -= random.nextInt(EGG_ACCELERATION) + EGG_ACCELERATION;
		}

		stack.stackSize--;

		return true;
	}

	return false;
}
 
開發者ID:OreCruncher,項目名稱:ThermalRecycling,代碼行數:25,代碼來源:Material.java

示例11: EntityVelociraptor

import net.minecraft.entity.passive.EntityChicken; //導入依賴的package包/類
public EntityVelociraptor(World world)
  {
      super(world);
      this.setSize(1F, 0.6F);
      isCarnivore = true;
      minSize = 0.2F;
maxSize = 1.4F;
adultAge = 10;
maxAge = 16;
      this.tasks.addTask(8, new EntityAITempt(this, 1.2D, Items.chicken, false));
      this.tasks.addTask(10, new MobAIWatchClosestWhenAwake(this, EntityPlayer.class, 8.0F));
      this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntityChicken.class, 200, false));
      this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntityCow.class, 200, false));
      this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false));
      this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntityCompsognathus.class, 200, false));
      this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntityPig.class, 200, false));

      this.setTamed(false);
  }
 
開發者ID:Alex-the-666,項目名稱:It-s-About-Time-Minecraft-Mod,代碼行數:20,代碼來源:EntityVelociraptor.java

示例12: updateEntity

import net.minecraft.entity.passive.EntityChicken; //導入依賴的package包/類
@Override
public void updateEntity(){
    if(PowerStored > 0 && slot != null && slot.getItem().equals(Items.egg)) {
        Tick++;
        if(Tick % 10 == 0){
            PowerStored--;
        }
    }
    System.out.println("Tick: " + Integer.toString(Tick));
    System.out.println("ChickTick: " + Integer.toString(ChickenTick));
    if(slot != null && slot.getItem().equals(Items.egg) && Tick == ChickenTick + 48000){
        ChickenTick = 0;
        EntityChicken entityChicken = new EntityChicken(this.worldObj);
        entityChicken.setLocationAndAngles(pos.getX() + .5, pos.getY() + 1, pos.getZ() + .5, 0.0F, 0.0F);
        entityChicken.setGrowingAge(-24000);
        this.worldObj.spawnEntityInWorld(entityChicken);
    }
}
 
開發者ID:Team-Radicool,項目名稱:CreepTech,代碼行數:19,代碼來源:TileEntityIncubator.java

示例13: uncontainedEffect

import net.minecraft.entity.passive.EntityChicken; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Override
public void uncontainedEffect(int x, int y, int z, World world, EntityPlayer player) {
    super.uncontainedEffect(x, y, z, world, player);
    Vec3 cornerstone = Vec3.createVectorHelper(x,y,z);
    List<Entity> playerMPs = world.loadedEntityList;
    for (int i = 0; i < playerMPs.size();i++) {
        Entity entity = playerMPs.get(i);
        if (entity instanceof EntityLivingBase) {
            if (!(entity instanceof EntityPlayer) && !(entity instanceof EntityBat) && !(entity instanceof EntityChicken)) {
                 Vec3 location = Vec3.createVectorHelper(entity.posX,entity.posY,entity.posZ);
                if (location.distanceTo(cornerstone) < 100) {
                    entity.motionY += 3.0F;
                }
            }
        }
    }
}
 
開發者ID:MagiciansArtificeTeam,項目名稱:Magicians-Artifice,代碼行數:19,代碼來源:RitualFlight.java

示例14: BiomeGenRedSeed

import net.minecraft.entity.passive.EntityChicken; //導入依賴的package包/類
public BiomeGenRedSeed(int id) {
    super(id);
   	this.waterColorMultiplier = 0x003333;
    this.theBiomeDecorator.treesPerChunk = -999;
    this.theBiomeDecorator.flowersPerChunk = 4;
    this.theBiomeDecorator.grassPerChunk = 10;
    this.flowers.clear();
    this.addFlower(Blocks.red_flower,    4,  3);
    this.addFlower(Blocks.red_flower,    5,  3);
    this.addFlower(Blocks.red_flower,    6,  3);
    this.addFlower(Blocks.red_flower,    7,  3);
    this.addFlower(ModBlocks.nileBlackFlower,    0, 20);
    this.addFlower(ModBlocks.nileBlackFlower,    3, 20);
    this.addFlower(ModBlocks.nileBlackFlower,    8, 20);
    this.addFlower(ModBlocks.nileBlackFlower, 0, 30);
    this.spawnableMonsterList.clear();
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityHorse.class, 5, 2, 6));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityRedZertum.class, 100, 4, 4));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 5, 1, 5));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 5, 1, 5));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityPig.class, 5, 1, 5)); 
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 100, 4, 4));
}
 
開發者ID:NovaViper,項目名稱:ZeroQuest,代碼行數:26,代碼來源:BiomeGenRedSeed.java

示例15: BiomeGenBioZone

import net.minecraft.entity.passive.EntityChicken; //導入依賴的package包/類
public BiomeGenBioZone(int id) {
    super(id);
    this.theBiomeDecorator.generateLakes = true;
    this.theBiomeDecorator.treesPerChunk = 4;
    this.spawnableMonsterList.clear();
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCreeper.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 100, 4, 4));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityZertum.class, 100, 4, 4));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 5, 1, 5));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 5, 1, 5));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 5, 1, 5));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityPig.class, 5, 1, 5)); 
}
 
開發者ID:NovaViper,項目名稱:ZeroQuest,代碼行數:17,代碼來源:BiomeGenBioZone.java


注:本文中的net.minecraft.entity.passive.EntityChicken類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。