本文整理汇总了Java中net.minecraft.entity.monster.EntitySkeleton.setSkeletonType方法的典型用法代码示例。如果您正苦于以下问题:Java EntitySkeleton.setSkeletonType方法的具体用法?Java EntitySkeleton.setSkeletonType怎么用?Java EntitySkeleton.setSkeletonType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.entity.monster.EntitySkeleton
的用法示例。
在下文中一共展示了EntitySkeleton.setSkeletonType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRandomSkeletonClasse
import net.minecraft.entity.monster.EntitySkeleton; //导入方法依赖的package包/类
public static EntitySkeleton getRandomSkeletonClasse(World w, double x, double y, double z, Random r)
{
EntitySkeleton skeleton = new EntitySkeleton(w);
skeleton.setLocationAndAngles(x, y + 1.0D, z, 0.0F, 0.0F);
skeleton.setSkeletonType(1);
int alea = r.nextInt(4);
if (alea == 0)
{
}
else if (alea == 1)
{}
else
{}
return skeleton;
}
示例2: onInitialSpawn
import net.minecraft.entity.monster.EntitySkeleton; //导入方法依赖的package包/类
@Nullable
@Override
public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, @Nullable IEntityLivingData livingdata) {
if(!worldObj.isRemote){
for(int i = 0; i < 4; i++){
EntitySkeleton mob = new EntitySkeleton(worldObj);
mob.setSkeletonType(SkeletonType.WITHER);
mob.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.DIAMOND_SWORD));
mob.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(4.0D);
BlockPos pos = pickSpawnPoint();
mob.setLocationAndAngles(0.5 + pos.getX(), pos.getY(), 0.5 + pos.getZ(), CMath.random.nextFloat() * 360,0);
worldObj.spawnEntityInWorld(mob);
}
}
return super.onInitialSpawn(difficulty, livingdata);
}
示例3: apply
import net.minecraft.entity.monster.EntitySkeleton; //导入方法依赖的package包/类
@Override
public void apply(EntityLivingBase entity) {
if (entity instanceof EntitySkeleton) {
EntitySkeleton skeleton = ((EntitySkeleton) entity);
if (wither) skeleton.setSkeletonType(1);
else skeleton.setSkeletonType(0);
}
}
示例4: onEntityCollidedWithBlock
import net.minecraft.entity.monster.EntitySkeleton; //导入方法依赖的package包/类
@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));
}
}
示例5: equipEntity
import net.minecraft.entity.monster.EntitySkeleton; //导入方法依赖的package包/类
/**
* Equips entity with appropriate weapon and armor
*/
protected void equipEntity(World world, EntityLivingBase entity) {
ItemStack melee = null;
ItemStack ranged = new ItemStack(Items.bow);
Item[] armorSet = null;
switch(difficulty) {
case 1:
armorSet = new Item[]{Items.chainmail_boots, Items.chainmail_leggings, Items.chainmail_chestplate, Items.chainmail_helmet};
melee = new ItemStack(Items.iron_sword);
ranged.addEnchantment(Enchantment.power, 1);
break;
case 2:
armorSet = new Item[]{Items.iron_boots, Items.iron_leggings, Items.iron_chestplate, Items.iron_helmet};
melee = new ItemStack(Items.iron_sword);
melee.addEnchantment(Enchantment.sharpness, 2);
ranged.addEnchantment(Enchantment.punch, 1);
ranged.addEnchantment(Enchantment.power, 3);
break;
case 3:
armorSet = new Item[]{Items.diamond_boots, Items.diamond_leggings, Items.diamond_chestplate, Items.diamond_helmet};
melee = new ItemStack(Items.diamond_sword);
melee.addEnchantment(Enchantment.sharpness, 4);
melee.addEnchantment(Enchantment.fireAspect, 1);
ranged.addEnchantment(Enchantment.flame, 1);
ranged.addEnchantment(Enchantment.punch, 2);
ranged.addEnchantment(Enchantment.power, 5);
break;
}
if (armorSet != null) {
for (int i = 0; i < armorSet.length; ++i) {
ItemStack armor = new ItemStack(armorSet[i]);
EnchantmentHelper.addRandomEnchantment(world.rand, armor, difficulty + world.rand.nextInt(difficulty * 5));
entity.setCurrentItemOrArmor(i + 1, armor);
}
}
if (entity instanceof EntityZombie) {
((EntityZombie) entity).setCurrentItemOrArmor(0, melee);
} else if (entity instanceof EntitySkeleton) {
EntitySkeleton skeleton = (EntitySkeleton) entity;
skeleton.setCurrentItemOrArmor(0, ranged);
if (core.getBossType() == BossType.HELL) {
skeleton.setSkeletonType(1);
skeleton.setCurrentItemOrArmor(0, melee);
} else {
skeleton.setCurrentItemOrArmor(0, ranged);
}
} else {
if (entity instanceof EntityOctorok) {
((EntityOctorok) entity).setType((byte) 1);
}
IAttributeInstance iattribute = entity.getEntityAttribute(SharedMonsterAttributes.attackDamage);
AttributeModifier modifier = (new AttributeModifier(UUID.randomUUID(), "Boss Attack Bonus", difficulty * 2.0D, 0)).setSaved(true);
iattribute.applyModifier(modifier);
}
}