当前位置: 首页>>代码示例>>Java>>正文


Java EntityZombie类代码示例

本文整理汇总了Java中net.minecraft.entity.monster.EntityZombie的典型用法代码示例。如果您正苦于以下问题:Java EntityZombie类的具体用法?Java EntityZombie怎么用?Java EntityZombie使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EntityZombie类属于net.minecraft.entity.monster包,在下文中一共展示了EntityZombie类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: apply

import net.minecraft.entity.monster.EntityZombie; //导入依赖的package包/类
@Override
public boolean apply(EntityPlayer player) {
	for (int i = 0; i < 10; i++) {
		BlockPos pos = new BlockPos(player.posX + player.getRNG().nextGaussian() * 4, player.posY, player.posZ + player.getRNG().nextGaussian() * 4);
		EntityZombie zombie = new EntityZombie(player.world);
		if (player.world.isAirBlock(pos) && player.world.isAirBlock(pos.up()) && player.world.getBlockState(pos.down()).canEntitySpawn(zombie)) {
			zombie.setPosition(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5);
			zombie.onInitialSpawn(player.world.getDifficultyForLocation(pos), null);
			player.world.spawnEntity(zombie);
			if (player.getRNG().nextBoolean() && player.getRNG().nextBoolean())
				zombie.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 900, 1));
			if (player.getRNG().nextBoolean() && player.getRNG().nextBoolean())
				zombie.addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 900, 1));
			if (player.getRNG().nextBoolean() && player.getRNG().nextBoolean())
				zombie.addPotionEffect(new PotionEffect(MobEffects.SPEED, 900, 1));
			if (player.getRNG().nextBoolean() && player.getRNG().nextBoolean())
				zombie.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 900, 1));
			return true;
		}
	}
	return false;
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:23,代码来源:FortuneMeetZombie.java

示例2: EntityVillager

import net.minecraft.entity.monster.EntityZombie; //导入依赖的package包/类
public EntityVillager(World worldIn, int professionId)
{
    super(worldIn);
    this.villagerInventory = new InventoryBasic("Items", false, 8);
    this.setProfession(professionId);
    this.setSize(0.6F, 1.8F);
    ((PathNavigateGround)this.getNavigator()).setBreakDoors(true);
    ((PathNavigateGround)this.getNavigator()).setAvoidsWater(true);
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D));
    this.tasks.addTask(1, new EntityAITradePlayer(this));
    this.tasks.addTask(1, new EntityAILookAtTradePlayer(this));
    this.tasks.addTask(2, new EntityAIMoveIndoors(this));
    this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
    this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
    this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D));
    this.tasks.addTask(6, new EntityAIVillagerMate(this));
    this.tasks.addTask(7, new EntityAIFollowGolem(this));
    this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F));
    this.tasks.addTask(9, new EntityAIVillagerInteract(this));
    this.tasks.addTask(9, new EntityAIWander(this, 0.6D));
    this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
    this.setCanPickUpLoot(true);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:25,代码来源:EntityVillager.java

示例3: unearthMe

import net.minecraft.entity.monster.EntityZombie; //导入依赖的package包/类
private EntityZombie unearthMe()
{
	EntityZombie zombie = (this.getZombieType() == ZombieType.NORMAL ? new EntityZombie(this.world) : new EntityHusk(this.world));
	zombie.renderYawOffset = this.renderYawOffset;
	zombie.prevRotationPitch = zombie.rotationPitch = this.rotationPitch;
	zombie.prevRotationYaw = zombie.rotationYaw = this.rotationYaw;
	zombie.setPosition(this.posX, this.posY, this.posZ);
	zombie.setHealth(this.getHealth());
	zombie.setFire((Integer)ReflectionUtils.getFieldValue(entityFire, this));
	zombie.setAttackTarget(this.getAttackTarget());

	this.springEffect();
	this.setDead();

	this.world.spawnEntity(zombie);
	return zombie;
}
 
开发者ID:crazysnailboy,项目名称:Halloween,代码行数:18,代码来源:EntityZombieHands.java

示例4: earthMe

import net.minecraft.entity.monster.EntityZombie; //导入依赖的package包/类
private EntityZombieHands earthMe(EntityZombie zombie)
{
	EntityZombieHands entity = new EntityZombieHands(this.world);
	entity.renderYawOffset = zombie.renderYawOffset;
	entity.prevRotationPitch = entity.rotationPitch = zombie.rotationPitch;
	entity.prevRotationYaw = entity.rotationYaw = zombie.rotationYaw;
	entity.setPosition(zombie.posX, zombie.posY, zombie.posZ);
	entity.setHealth(zombie.getHealth());
	entity.setFire((Integer)ReflectionUtils.getFieldValue(entityFire, zombie));
	entity.setAttackTarget(zombie.getAttackTarget());
	entity.setZombieType(zombie instanceof EntityHusk ? ZombieType.HUSK : ZombieType.NORMAL);

	zombie.setDead();
	entity.springEffect();

	this.world.spawnEntity(entity);
	return entity;
}
 
开发者ID:crazysnailboy,项目名称:Halloween,代码行数:19,代码来源:EntityZombieHands.java

示例5: initEntityAI

import net.minecraft.entity.monster.EntityZombie; //导入依赖的package包/类
protected void initEntityAI()
{
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D));
    this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityEvoker.class, 12.0F, 0.8D, 0.8D));
    this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityVindicator.class, 8.0F, 0.8D, 0.8D));
    this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityVex.class, 8.0F, 0.6D, 0.6D));
    this.tasks.addTask(1, new EntityAITradePlayer(this));
    this.tasks.addTask(1, new EntityAILookAtTradePlayer(this));
    this.tasks.addTask(2, new EntityAIMoveIndoors(this));
    this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
    this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
    this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D));
    this.tasks.addTask(6, new EntityAIVillagerMate(this));
    this.tasks.addTask(7, new EntityAIFollowGolem(this));
    this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F));
    this.tasks.addTask(9, new EntityAIVillagerInteract(this));
    this.tasks.addTask(9, new EntityAIWanderAvoidWater(this, 0.6D));
    this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:21,代码来源:EntityVillager.java

示例6: setRotationAngles

import net.minecraft.entity.monster.EntityZombie; //导入依赖的package包/类
/**
 * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
 * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
 * "far" arms and legs can swing at most.
 */
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
    super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
    EntityZombie entityzombie = (EntityZombie)entityIn;
    float f = MathHelper.sin(this.swingProgress * (float)Math.PI);
    float f1 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * (float)Math.PI);
    this.bipedRightArm.rotateAngleZ = 0.0F;
    this.bipedLeftArm.rotateAngleZ = 0.0F;
    this.bipedRightArm.rotateAngleY = -(0.1F - f * 0.6F);
    this.bipedLeftArm.rotateAngleY = 0.1F - f * 0.6F;
    float f2 = -(float)Math.PI / (entityzombie.isArmsRaised() ? 1.5F : 2.25F);
    this.bipedRightArm.rotateAngleX = f2;
    this.bipedLeftArm.rotateAngleX = f2;
    this.bipedRightArm.rotateAngleX += f * 1.2F - f1 * 0.4F;
    this.bipedLeftArm.rotateAngleX += f * 1.2F - f1 * 0.4F;
    this.bipedRightArm.rotateAngleZ += MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
    this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
    this.bipedRightArm.rotateAngleX += MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
    this.bipedLeftArm.rotateAngleX -= MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:26,代码来源:ModelZombieVillager.java

示例7: setRotationAngles

import net.minecraft.entity.monster.EntityZombie; //导入依赖的package包/类
/**
 * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
 * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
 * "far" arms and legs can swing at most.
 */
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
    super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
    boolean flag = entityIn instanceof EntityZombie && ((EntityZombie)entityIn).isArmsRaised();
    float f = MathHelper.sin(this.swingProgress * (float)Math.PI);
    float f1 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * (float)Math.PI);
    this.bipedRightArm.rotateAngleZ = 0.0F;
    this.bipedLeftArm.rotateAngleZ = 0.0F;
    this.bipedRightArm.rotateAngleY = -(0.1F - f * 0.6F);
    this.bipedLeftArm.rotateAngleY = 0.1F - f * 0.6F;
    float f2 = -(float)Math.PI / (flag ? 1.5F : 2.25F);
    this.bipedRightArm.rotateAngleX = f2;
    this.bipedLeftArm.rotateAngleX = f2;
    this.bipedRightArm.rotateAngleX += f * 1.2F - f1 * 0.4F;
    this.bipedLeftArm.rotateAngleX += f * 1.2F - f1 * 0.4F;
    this.bipedRightArm.rotateAngleZ += MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
    this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
    this.bipedRightArm.rotateAngleX += MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
    this.bipedLeftArm.rotateAngleX -= MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:26,代码来源:ModelZombie.java

示例8: onSetProfession

import net.minecraft.entity.monster.EntityZombie; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public static void onSetProfession(EntityZombie entity, VillagerProfession prof)
{
    if (prof == null)
    {
        if (entity.getZombieType() != ZombieType.NORMAL && entity.getZombieType() != ZombieType.HUSK)
            entity.setZombieType(ZombieType.NORMAL);
        return;
    }

    int network = INSTANCE.professions.getId(prof);
    if (network == -1 || prof != INSTANCE.professions.getObjectById(network))
    {
        throw new RuntimeException("Attempted to set villager profession to unregistered profession: " + network + " " + prof);
    }

    if (network >= 0 && network < 5) // Vanilla
    {
        if (entity.getZombieType() == null || entity.getZombieType().getId() != network + 1)
        {
            entity.setZombieType(ZombieType.getVillagerByOrdinal(network));
        }
    }
    else if (entity.getZombieType() != null)
        entity.setZombieType(ZombieType.NORMAL);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:27,代码来源:VillagerRegistry.java

示例9: initEntityAI

import net.minecraft.entity.monster.EntityZombie; //导入依赖的package包/类
protected void initEntityAI()
{
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D));
    this.tasks.addTask(1, new EntityAITradePlayer(this));
    this.tasks.addTask(1, new EntityAILookAtTradePlayer(this));
    this.tasks.addTask(2, new EntityAIMoveIndoors(this));
    this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
    this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
    this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D));
    this.tasks.addTask(6, new EntityAIVillagerMate(this));
    this.tasks.addTask(7, new EntityAIFollowGolem(this));
    this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F));
    this.tasks.addTask(9, new EntityAIVillagerInteract(this));
    this.tasks.addTask(9, new EntityAIWander(this, 0.6D));
    this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:18,代码来源:EntityVillager.java

示例10: onLivingDeath

import net.minecraft.entity.monster.EntityZombie; //导入依赖的package包/类
@SubscribeEvent
public void onLivingDeath(LivingDeathEvent event) {
    if (event.getSource().getSourceOfDamage() != null && event.getSource().getSourceOfDamage() instanceof EntityPlayer) {
        EntityPlayer player = (EntityPlayer) event.getSource().getSourceOfDamage();
        if (this.isActive(player) && event.getEntityLiving() instanceof EntityVillager) {
            EntityVillager villager = (EntityVillager) event.getEntityLiving();
            EntityZombie zombieVillager = new EntityZombie(player.worldObj);
            zombieVillager.copyLocationAndAnglesFrom(villager);
            player.worldObj.removeEntity(villager);
            zombieVillager.onInitialSpawn(player.worldObj.getDifficultyForLocation(new BlockPos(zombieVillager)), null);
            zombieVillager.setVillagerType(villager.getProfessionForge());
            zombieVillager.setChild(villager.isChild());
            zombieVillager.setNoAI(villager.isAIDisabled());
            if (villager.hasCustomName()) {
                zombieVillager.setCustomNameTag(villager.getCustomNameTag());
                zombieVillager.setAlwaysRenderNameTag(villager.getAlwaysRenderNameTag());
            }
            player.worldObj.spawnEntityInWorld(zombieVillager);
            player.worldObj.playEvent(null, 1026, zombieVillager.getPosition(), 0);
        }
    }
}
 
开发者ID:Fararise,项目名称:Possessed,代码行数:23,代码来源:ZombieHandler.java

示例11: BiomRoofedForest

import net.minecraft.entity.monster.EntityZombie; //导入依赖的package包/类
public BiomRoofedForest(int p_i45383_1_)
  {
      super(p_i45383_1_);
      
      this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 8, 4, 6));
      this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityWolf.class, 2, 4, 6));
      this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCentaure.class, 12, 4, 6));
      this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityLutin.class, 14, 4, 6));

      this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCaveSpider.class, 8, 2, 4));
      this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 8, 2, 4));
      
this.topBlock = BlockRegister.GRASS;
this.fillerBlock = BlockRegister.DIRT;
this.setBiomeName("Mystic Roofed Forest");
this.theBiomeDecorator.grassPerChunk = 16;
      ((BiomeDecoratorMagic) this.theBiomeDecorator).berry_per_chunk = 6;
this.theBiomeDecorator.treesPerChunk = 10;
  }
 
开发者ID:GhostMonk3408,项目名称:MidgarCrusade,代码行数:20,代码来源:BiomRoofedForest.java

示例12: BiomMagicForest

import net.minecraft.entity.monster.EntityZombie; //导入依赖的package包/类
public BiomMagicForest(int p_i45383_1_)
  {
      super(p_i45383_1_);
      
      this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 8, 4, 6));
      this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityWolf.class, 2, 4, 6));
      this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityStymph.class, 10, 4, 6));
      
      this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityLutin.class, 14, 4, 6));   
      this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCentaure.class, 12, 4, 6));
      this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCaveSpider.class, 8, 2, 4));
      this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 8, 2, 4));
      this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityGobelin.class, 8, 2, 4));
      
this.topBlock = Blocks.grass;
this.fillerBlock = Blocks.dirt;
this.setBiomeName("Mystic Forest");
this.theBiomeDecorator.grassPerChunk = 16;
      ((BiomeDecoratorMagic) this.theBiomeDecorator).berry_per_chunk = 6;
this.theBiomeDecorator.treesPerChunk = 6;
  }
 
开发者ID:GhostMonk3408,项目名称:MidgarCrusade,代码行数:22,代码来源:BiomMagicForest.java

示例13: saveCurrentRenderers

import net.minecraft.entity.monster.EntityZombie; //导入依赖的package包/类
private void saveCurrentRenderers(RenderManager rm) {
    // villagers
    saveRenderer(rm, EntityVillager.class);
    saveRenderer(rm, EntityZombieVillager.class);
    // zombies
    saveRenderer(rm, EntityZombie.class);
    saveRenderer(rm, EntityHusk.class);
    // pig zombie
    saveRenderer(rm, EntityPigZombie.class);
    // skeletons
    saveRenderer(rm, EntitySkeleton.class);
    saveRenderer(rm, EntityStray.class);
    saveRenderer(rm, EntityWitherSkeleton.class);
    // illagers
    saveRenderer(rm, EntityVex.class);
    saveRenderer(rm, EntityEvoker.class);
    saveRenderer(rm, EntityVindicator.class);
    saveRenderer(rm, EntityIllusionIllager.class);
}
 
开发者ID:MineLittlePony,项目名称:MineLittlePony,代码行数:20,代码来源:MineLittlePony.java

示例14: attackEntityFrom

import net.minecraft.entity.monster.EntityZombie; //导入依赖的package包/类
@Override
public boolean attackEntityFrom(DamageSource par1DamageSource, float par2)
{
	super.attackEntityFrom(par1DamageSource, par2);
	if (!this.isDead && !this.worldObj.isRemote)
	{
		this.health -= par2;
		if (this.health <= 0)
		{
			this.setDead();
			this.worldObj.createExplosion((Entity) null, this.posX, this.posY, this.posZ, 6.0F, true);
			worldObj.spawnEntityInWorld(new EntityB2Frag(worldObj, this, 0));
			worldObj.spawnEntityInWorld(new EntityB2Frag(worldObj, this, 1));
			EntityZombie pz = new EntityZombie(worldObj);
			pz.setPosition(posX, posY, posZ);
			worldObj.spawnEntityInWorld(pz);
			RivalRebelsSoundPlayer.playSound(this, 0, 0, 30, 1);
		}
	}
	
	return true;
}
 
开发者ID:rodolphito,项目名称:Rival-Rebels-Mod,代码行数:23,代码来源:EntityB2Spirit.java

示例15: arms

import net.minecraft.entity.monster.EntityZombie; //导入依赖的package包/类
protected void arms(float ageInTicks, Entity entityIn) {
	boolean armIsRaised = entityIn instanceof EntityZombie && ((EntityZombie) entityIn).isArmsRaised();
	float swingAngle = MathHelper.sin(swingProgress * (float) Math.PI);
	float f1 = MathHelper.sin((1.0F - (1.0F - swingProgress) * (1.0F - swingProgress)) * (float) Math.PI);

	/*
	 * z rotates arm inward and outward
	 * 
	 * y rotates the axis down the arm
	 */

	bipedRightArm.rotateAngleZ = 0.0F;
	bipedLeftArm.rotateAngleZ = 0.0F;
	staff.rotateAngleX = 0F;

	if (isStaffAttacking) {
		bipedRightArm.rotateAngleX += -1.2F;
		bipedLeftArm.rotateAngleX += -1.4F;
		staff.rotateAngleX = 1.1F;
	} else {
		bipedRightArm.rotateAngleX += -1.1F;
	}

}
 
开发者ID:ToroCraft,项目名称:ToroQuest,代码行数:25,代码来源:ModelMage.java


注:本文中的net.minecraft.entity.monster.EntityZombie类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。