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


Java EntitySilverfish类代码示例

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


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

示例1: apply

import net.minecraft.entity.monster.EntitySilverfish; //导入依赖的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);
		EntitySilverfish silverfish = new EntitySilverfish(player.world);
		if (player.world.isAirBlock(pos) && player.world.isAirBlock(pos.up()) && player.world.getBlockState(pos.down()).canEntitySpawn(silverfish)) {
			silverfish.setPosition(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5);
			silverfish.onInitialSpawn(player.world.getDifficultyForLocation(pos), null);
			player.world.spawnEntity(silverfish);
			if (player.getRNG().nextBoolean() && player.getRNG().nextBoolean())
				silverfish.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 900, 2));
			if (player.getRNG().nextBoolean() && player.getRNG().nextBoolean())
				silverfish.addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 900, 2));
			if (player.getRNG().nextBoolean() && player.getRNG().nextBoolean())
				silverfish.addPotionEffect(new PotionEffect(MobEffects.SPEED, 900, 2));
			if (player.getRNG().nextBoolean() && player.getRNG().nextBoolean())
				silverfish.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 900, 2));
			return true;
		}
	}
	return false;
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:23,代码来源:FortuneMeetUberSilverfish.java

示例2: initialize

import net.minecraft.entity.monster.EntitySilverfish; //导入依赖的package包/类
public static void initialize()
{
    inLove = ReflectionHelper.findField(EntityAnimal.class, "field_70881_d", "inLove");

    //Standard
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world,pos,new EntityCow(world)),100));
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world,pos,new EntitySheep(world)),100));
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world,pos,new EntityPig(world)),100));
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world,pos,new EntityChicken(world)),50)); //Lower chance for egg hatching animal

    //Parent species
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world,pos,mother.createChild(mother)),100));
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world,pos,father.createChild(father)),100));

    //Abominations
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnEntityAt(world,pos,new EntitySilverfish(world)),200));
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnEntityAt(world,pos,new EntityCaveSpider(world)),100));
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnEntityAt(world,pos,new EntitySlime(world)),50));

    //Enviroment dependent
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnEntityAt(world,pos,new EntitySquid(world)),0).setCustomWeight(AnimalCrossbreedHandler::getSquidWeight));
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world,pos,new EntityWolf(world)),0).setCustomWeight(AnimalCrossbreedHandler::getWolfWeight));
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world,pos,new EntityOcelot(world)),0).setCustomWeight(AnimalCrossbreedHandler::getOcelotWeight));
}
 
开发者ID:DaedalusGame,项目名称:BetterWithAddons,代码行数:25,代码来源:AnimalCrossbreedHandler.java

示例3: BiomGenMagic

import net.minecraft.entity.monster.EntitySilverfish; //导入依赖的package包/类
public BiomGenMagic(int p_i1971_1_) 
{
	super(p_i1971_1_);
	
	this.theBiomeDecorator = new BiomeDecoratorMagic();
	
	this.spawnableMonsterList.clear();
	this.spawnableCreatureList.clear();
	
       this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityLibellule.class, 24, 2, 4));
       this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBelier.class, 24, 2, 4));

       this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySilverfish.class, 12, 4, 8));
       this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCrocotta.class, 24, 4, 8));
	this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySlave.class, 12, 1, 2));
}
 
开发者ID:GhostMonk3408,项目名称:MidgarCrusade,代码行数:17,代码来源:BiomGenMagic.java

示例4: onEntityKilled

import net.minecraft.entity.monster.EntitySilverfish; //导入依赖的package包/类
@SubscribeEvent
public void onEntityKilled(LivingDropsEvent event)
{
	// TODO remove when actual ark creatures are in place and dropping items
	if (event.getEntityLiving().world.isRemote) return;
	Random r = new Random();
	int x = r.nextInt(3) + 1;
	ItemStack meat = new ItemStack(ARKCraftItems.meat_raw, x);
	event.getDrops().add(new EntityItem(event.getEntityLiving().world, event.getEntityLiving().posX, event.getEntityLiving().posY,
			event.getEntityLiving().posZ, IDecayable.setDecayStart(meat, ARKCraft.proxy.getWorldTime())));
	if (r.nextDouble() < 0.05) event.getDrops().add(new EntityItem(event.getEntityLiving().world, event.getEntityLiving().posX,
			event.getEntityLiving().posY, event.getEntityLiving().posZ, IDecayable.setDecayStart(new ItemStack(
					ARKCraftItems.primemeat_raw), ARKCraft.proxy.getWorldTime())));
	if (event.getEntityLiving() instanceof EntitySpider || event.getEntityLiving() instanceof EntitySilverfish
			|| event.getEntityLiving() instanceof EntityEndermite) event.getDrops().add(new EntityItem(
					event.getEntityLiving().world, event.getEntityLiving().posX, event.getEntityLiving().posY,
					event.getEntityLiving().posZ, new ItemStack(ARKCraftItems.chitin, r.nextInt(3) + 1)));
	else event.getDrops().add(new EntityItem(event.getEntityLiving().world, event.getEntityLiving().posX,
			event.getEntityLiving().posY, event.getEntityLiving().posZ, new ItemStack(ARKCraftItems.hide, r.nextInt(3) + 1)));
}
 
开发者ID:BubbleTrouble14,项目名称:ARKCraft,代码行数:21,代码来源:CommonEventHandler.java

示例5: init

import net.minecraft.entity.monster.EntitySilverfish; //导入依赖的package包/类
private static void init() {
	addDrop(EntityCreeper.class, SkillBase.armorBreak);
	addDrop(EntityIronGolem.class, SkillBase.armorBreak);
	addDrop(EntitySilverfish.class, SkillBase.dash);
	addDrop(EntityHorse.class, SkillBase.dash);
	addDrop(EntityEnderman.class, SkillBase.dodge);
	addDrop(EntityKeese.class, SkillBase.dodge);
	addDrop(EntitySpider.class, SkillBase.endingBlow);
	addDrop(EntityCaveSpider.class, SkillBase.leapingBlow);
	addDrop(EntityMagmaCube.class, SkillBase.leapingBlow);
	addDrop(EntityPigZombie.class, SkillBase.parry);
	addDrop(EntityOcelot.class, SkillBase.parry);
	addDrop(EntityOctorok.class, SkillBase.risingCut);
	addDrop(EntityBlaze.class, SkillBase.spinAttack);
	addDrop(EntityDarknut.class, SkillBase.spinAttack);
	addDrop(EntityZombie.class, SkillBase.swordBasic);
	addDrop(EntitySkeleton.class, SkillBase.swordBasic);
	addDrop(EntityGhast.class, SkillBase.swordBeam);
	addDrop(EntityWitch.class, SkillBase.swordBeam);
	addDrop(EntityWizzrobe.class, SkillBase.swordBreak);
}
 
开发者ID:coolAlias,项目名称:ZeldaSwordSkills,代码行数:22,代码来源:ZSSItemEvents.java

示例6: onBlockDestroyedByPlayer

import net.minecraft.entity.monster.EntitySilverfish; //导入依赖的package包/类
@Override
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5)
{
    if (!par1World.isRemote && par5 == 1)
    {
        EntitySilverfish entitysilverfish = new EntitySilverfish(par1World);
        entitysilverfish.setLocationAndAngles((double)par2 + 0.5D, par3, (double)par4 + 0.5D, 0.0F, 0.0F);
        par1World.spawnEntityInWorld(entitysilverfish);
        entitysilverfish.spawnExplosionParticle();
        
        for (int i = 3 + par1World.rand.nextInt(5) + par1World.rand.nextInt(5); i > 0;)
        {
            int j = EntityXPOrb.getXPSplit(i);
            i -= j;
            par1World.spawnEntityInWorld(new EntityXPOrb(par1World, par2, par3, par4, j));
        }
    }

    super.onBlockDestroyedByPlayer(par1World, par2, par3, par4, par5);
}
 
开发者ID:wuppy29,项目名称:WuppyMods,代码行数:21,代码来源:BlockExp.java

示例7: dropBlockAsItemWithChance

import net.minecraft.entity.monster.EntitySilverfish; //导入依赖的package包/类
/**
 * Spawns this Block's drops into the World as EntityItems.
 */
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune)
{
    if (!worldIn.isRemote && worldIn.getGameRules().getBoolean("doTileDrops"))
    {
        EntitySilverfish entitysilverfish = new EntitySilverfish(worldIn);
        entitysilverfish.setLocationAndAngles((double)pos.getX() + 0.5D, (double)pos.getY(), (double)pos.getZ() + 0.5D, 0.0F, 0.0F);
        worldIn.spawnEntityInWorld(entitysilverfish);
        entitysilverfish.spawnExplosionParticle();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:14,代码来源:BlockSilverfish.java

示例8: silverFishDrop

import net.minecraft.entity.monster.EntitySilverfish; //导入依赖的package包/类
@SubscribeEvent
public void silverFishDrop(final LivingDropsEvent event) {
    if (event.entityLiving instanceof EntitySilverfish && !event.entity.worldObj.isRemote && event.entity.worldObj.rand.nextInt(5) == 0 && event.recentlyHit && OreDictionary.getOres(this.silverName).size() > 0) {
        final ItemStack item = OreDictionary.getOres(this.silverName).get(0).copy();
        if (event.drops.size() > 0) {
            for (int i = 0; i < event.drops.size(); ++i) {
                final ItemStack t = event.drops.get(i).getEntityItem();
                if (t != null && (t.getItem() == item.getItem() || t.getItemDamage() == item.getItemDamage())) {
                    return;
                }
            }
        }
        event.drops.add(new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entity.posY, event.entityLiving.posZ, item));
    }
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:16,代码来源:EventHandlerServer.java

示例9: Config

import net.minecraft.entity.monster.EntitySilverfish; //导入依赖的package包/类
public Config() {
	mobs = new ArrayList<Entity>(Arrays.asList(new Entity[]{
			new Entity(EntityBat.class), 
			new Entity(EntityChicken.class),
			new Entity(EntityCow.class),
			new Entity(EntityHorse.class),
			new Entity(EntityMooshroom.class),
			new Entity(EntityOcelot.class),
			new Entity(EntityPig.class),
			new Entity(EntityRabbit.class),
			new Entity(EntitySheep.class),
			new Entity(EntitySquid.class),
			new Entity(EntityVillager.class),
			new Entity(EntityWolf.class),
			new Entity(EntityBlaze.class),
			new Entity(EntityCaveSpider.class),
			new Entity(EntityCreeper.class),
			new Entity(EntityEnderman.class),
			new Entity(EntityGhast.class),
			new Entity(EntityGolem.class),
			new Entity(EntityGuardian.class),
			new Entity(EntityIronGolem.class),
			new Entity(EntityMagmaCube.class),
			new Entity(EntityPigZombie.class),
			new Entity(EntitySilverfish.class),
			new Entity(EntitySkeleton.class),
			new Entity(EntitySlime.class),
			new Entity(EntitySnowman.class),
			new Entity(EntitySpider.class),
			new Entity(EntityWitch.class),
			new Entity(EntityZombie.class),
			new Entity(EntityItem.class),
			new Entity(EntityMinecart.class),
			new Entity(EntityPlayer.class)
			}));
}
 
开发者ID:TealNerd,项目名称:CivRadar,代码行数:37,代码来源:Config.java

示例10: removeTheseMCMobs

import net.minecraft.entity.monster.EntitySilverfish; //导入依赖的package包/类
private static void removeTheseMCMobs()
{
	// Don't spawn the normal Minecraft hostile mobs?
	if (!CoreBalance.GEN.mcHostileMobs)
	{
		for (int i = 0; i < BiomeGenBase.getBiomeGenArray().length; i++)
		{
			if (BiomeGenBase.getBiomeGenArray()[i] != null)
			{
				EntityRegistry.removeSpawn(EntityZombie.class, EnumCreatureType.MONSTER,
						BiomeGenBase.getBiomeGenArray()[i]);
				EntityRegistry.removeSpawn(EntityCreeper.class, EnumCreatureType.MONSTER,
						BiomeGenBase.getBiomeGenArray()[i]);
				EntityRegistry.removeSpawn(EntitySkeleton.class, EnumCreatureType.MONSTER,
						BiomeGenBase.getBiomeGenArray()[i]);
				EntityRegistry.removeSpawn(EntitySpider.class, EnumCreatureType.MONSTER,
						BiomeGenBase.getBiomeGenArray()[i]);
				EntityRegistry.removeSpawn(EntitySilverfish.class, EnumCreatureType.MONSTER,
						BiomeGenBase.getBiomeGenArray()[i]);
				EntityRegistry.removeSpawn(EntityWitch.class, EnumCreatureType.MONSTER,
						BiomeGenBase.getBiomeGenArray()[i]);
				EntityRegistry.removeSpawn(EntityEnderman.class, EnumCreatureType.MONSTER,
						BiomeGenBase.getBiomeGenArray()[i]);
				EntityRegistry.removeSpawn(EntityCaveSpider.class, EnumCreatureType.MONSTER,
						BiomeGenBase.getBiomeGenArray()[i]);
			}
		}
	}
}
 
开发者ID:Archiving,项目名称:ARKCraft-Code,代码行数:30,代码来源:GlobalAdditions.java

示例11: onBlockDestroyedByPlayer

import net.minecraft.entity.monster.EntitySilverfish; //导入依赖的package包/类
public void onBlockDestroyedByPlayer(World p_149664_1_, int p_149664_2_, int p_149664_3_, int p_149664_4_, int p_149664_5_)
{
    if (!p_149664_1_.isClient)
    {
        EntitySilverfish var6 = new EntitySilverfish(p_149664_1_);
        var6.setLocationAndAngles((double)p_149664_2_ + 0.5D, (double)p_149664_3_, (double)p_149664_4_ + 0.5D, 0.0F, 0.0F);
        p_149664_1_.spawnEntityInWorld(var6);
        var6.spawnExplosionParticle();
    }

    super.onBlockDestroyedByPlayer(p_149664_1_, p_149664_2_, p_149664_3_, p_149664_4_, p_149664_5_);
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:13,代码来源:BlockSilverfish.java

示例12: dropBlockAsItemWithChance

import net.minecraft.entity.monster.EntitySilverfish; //导入依赖的package包/类
/**
 * Drops the block items with a specified chance of dropping the specified items
 */
public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
{
    if (!p_149690_1_.isClient)
    {
        EntitySilverfish var8 = new EntitySilverfish(p_149690_1_);
        var8.setLocationAndAngles((double)p_149690_2_ + 0.5D, (double)p_149690_3_, (double)p_149690_4_ + 0.5D, 0.0F, 0.0F);
        p_149690_1_.spawnEntityInWorld(var8);
        var8.spawnExplosionParticle();
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:14,代码来源:BlockSilverfish.java

示例13: onLivingUpdate

import net.minecraft.entity.monster.EntitySilverfish; //导入依赖的package包/类
@Override
public void onLivingUpdate(EntityZertumEntity dog) {
	int level = dog.talents.getLevel(this);
	
	if(level >= 0) {
           byte damage = 1;

           if (level == 5)
               damage = 2;

           List list = dog.worldObj.getEntitiesWithinAABB(EntitySilverfish.class, new AxisAlignedBB(dog.posX, dog.posY, dog.posZ, dog.posX + 1.0D, dog.posY + 1.0D, dog.posZ + 1.0D).expand(level * 3, 4D, level * 3));
           Iterator iterator = list.iterator();
           
           while(iterator.hasNext()) {
           	EntitySilverfish entitySilverfish = (EntitySilverfish)iterator.next();
           	if(dog.getRNG().nextInt(20) == 0)
           		entitySilverfish.attackEntityFrom(DamageSource.generic, damage);
           }
           
           List list2 = dog.worldObj.getEntitiesWithinAABB(EntitySlime.class, new AxisAlignedBB(dog.posX, dog.posY, dog.posZ, dog.posX + 1.0D, dog.posY + 1.0D, dog.posZ + 1.0D).expand(level * 3, 4D, level * 3));
           Iterator iterator2 = list2.iterator();
           
           while(iterator2.hasNext()) {
           	EntitySlime entitySlime = (EntitySlime)iterator2.next();
           	if(dog.getRNG().nextInt(20) == 0)
           		entitySlime.attackEntityFrom(DamageSource.generic, damage);
           }
       }
}
 
开发者ID:NovaViper,项目名称:ZeroQuest,代码行数:30,代码来源:PestSlayer.java

示例14: onBlockDestroyedByPlayer

import net.minecraft.entity.monster.EntitySilverfish; //导入依赖的package包/类
public void onBlockDestroyedByPlayer(World p_149664_1_, int p_149664_2_, int p_149664_3_, int p_149664_4_, int p_149664_5_)
{
    if (!p_149664_1_.isRemote)
    {
        EntitySilverfish entitysilverfish = new EntitySilverfish(p_149664_1_);
        entitysilverfish.setLocationAndAngles((double)p_149664_2_ + 0.5D, (double)p_149664_3_, (double)p_149664_4_ + 0.5D, 0.0F, 0.0F);
        p_149664_1_.spawnEntityInWorld(entitysilverfish);
        entitysilverfish.spawnExplosionParticle();
    }

    super.onBlockDestroyedByPlayer(p_149664_1_, p_149664_2_, p_149664_3_, p_149664_4_, p_149664_5_);
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:13,代码来源:BlockSilverfish.java

示例15: dropBlockAsItemWithChance

import net.minecraft.entity.monster.EntitySilverfish; //导入依赖的package包/类
public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
{
    if (!p_149690_1_.isRemote)
    {
        EntitySilverfish entitysilverfish = new EntitySilverfish(p_149690_1_);
        entitysilverfish.setLocationAndAngles((double)p_149690_2_ + 0.5D, (double)p_149690_3_, (double)p_149690_4_ + 0.5D, 0.0F, 0.0F);
        p_149690_1_.spawnEntityInWorld(entitysilverfish);
        entitysilverfish.spawnExplosionParticle();
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:11,代码来源:BlockSilverfish.java


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