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


Java IMob类代码示例

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


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

示例1: onLivingDropsEvent

import net.minecraft.entity.monster.IMob; //导入依赖的package包/类
@SubscribeEvent
public static void onLivingDropsEvent(LivingDropsEvent event) {
	if (ConfigHandler.dropMoney && !(event.getEntityLiving() instanceof EntityPlayer) && event.getEntityLiving() instanceof IMob && event.getEntityLiving().getEntityWorld().isRemote == false) {
		if (event.getSource().getTrueSource() != null && event.getSource().getTrueSource() instanceof EntityPlayer && !(event.getSource().getTrueSource() instanceof FakePlayer)) {
			CurrencyUtils.dropMoneyAmount(event.getEntityLiving().getMaxHealth() / ConfigHandler.mobDivisionValue, event.getEntityLiving().getEntityWorld(), event.getEntityLiving().posX, event.getEntityLiving().posY, event.getEntityLiving().posZ);
			return;
		}

		if (event.getSource().getTrueSource() != null && event.getSource().getTrueSource() != null && event.getSource().getTrueSource() instanceof EntityArrow) {
			EntityArrow arrow = (EntityArrow) event.getSource().getTrueSource();
			if (arrow.shootingEntity instanceof EntityPlayer && !(arrow.shootingEntity instanceof FakePlayer)) {
				CurrencyUtils.dropMoneyAmount(event.getEntityLiving().getMaxHealth() / ConfigHandler.mobDivisionValue, event.getEntityLiving().getEntityWorld(), event.getEntityLiving().posX, event.getEntityLiving().posY, event.getEntityLiving().posZ);
				return;
			}
		}
	}
}
 
开发者ID:Zundrel,项目名称:Never-Enough-Currency,代码行数:18,代码来源:ModEventHandler.java

示例2: entityMatchesTargetTypes

import net.minecraft.entity.monster.IMob; //导入依赖的package包/类
private boolean entityMatchesTargetTypes(EntityLivingBase entityLivingBase) {
    boolean matches = false;

    if (entityLivingBase instanceof EntityPlayer) {
        matches = players.getValue();
    } else if (entityLivingBase instanceof IMob) {
        matches = mobs.getValue();
    } else if (entityLivingBase instanceof IAnimals) {
        matches = animals.getValue();
    }

    if (mobs.getValue()) {
        if (entityLivingBase instanceof EntityWolf) {
            EntityWolf wolf = (EntityWolf) entityLivingBase;
            matches = wolf.isAngry();
        }
    }

    return matches;
}
 
开发者ID:SerenityEnterprises,项目名称:SerenityCE,代码行数:21,代码来源:KillAura.java

示例3: applyTasks

import net.minecraft.entity.monster.IMob; //导入依赖的package包/类
@Override
public void applyTasks() {

	//this.targetTasks.addTask(1, new EntityAISentryOwnerHurt(this, true));
	this.targetTasks.addTask(2, new EntityAINearestChecked(this, EntityLivingBase.class, true, false,
			new Predicate<EntityLivingBase>() {
				@Override
				public boolean apply(EntityLivingBase target) {
					return (((((getAttackFlags() & 2) == 2 && getOwnerId() != null) && target instanceof EntityPlayer) 
							|| target.getTeam() != null
							|| ((getAttackFlags() & 1) == 1 && (getRevengeTarget()==target || (getOwner() != null && getOwner().getRevengeTarget()==target)))
							|| ((getAttackFlags() & 4) == 4 && target instanceof IMob && getOwnerId() != null)
							|| ((getAttackFlags() & 4) == 4 && target instanceof EntityLiving && ((EntityLiving) target).getAttackTarget() == getOwner()))
							|| ((getAttackFlags() & 8) == 8 && !(target instanceof EntityPlayer) && !(target instanceof IMob) && getOwnerId() != null))
							&& (!TF2Util.isOnSameTeam(EntitySentry.this, target))
							&& (!(target instanceof EntityTF2Character && TF2ConfigVars.naturalCheck.equals("Never"))
									|| !((EntityTF2Character) target).natural);

				}
			}, false));
	this.tasks.addTask(1, new EntityAISentryAttack(this));
	this.tasks.addTask(2, new EntityAISentryIdle(this));
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:24,代码来源:EntitySentry.java

示例4: onSpawn

import net.minecraft.entity.monster.IMob; //导入依赖的package包/类
@SubscribeEvent
public void onSpawn(EntityJoinWorldEvent event) {
	if (TF2ConfigVars.targetSentries && event.getEntity() instanceof IMob && event.getEntity() instanceof EntityCreature) {
		((EntityCreature)event.getEntity()).targetTasks.addTask(100, 
				new EntityAINearestAttackableTarget<EntitySentry>((EntityCreature) event.getEntity(), EntitySentry.class, 10, true, false, sentry -> {
			return sentry.getOwnerId() != null;
		}) {
			protected double getTargetDistance()
		    {
		        return super.getTargetDistance() * 0.45f;
		    }
		});
	}
	if (event.getEntity() instanceof EntityPlayer){
		if (event.getEntity().world.isRemote) {
			if (event.getEntity() == ClientProxy.getLocalPlayer())
				TF2weapons.network.sendToServer(new TF2Message.InitClientMessage(TF2weapons.conf));
			TF2weapons.network.sendToServer(new TF2Message.ActionMessage(99, (EntityLivingBase) event.getEntity()));
		}
		if (event.getEntity().world != null && !event.getEntity().world.isRemote && event.getEntity() instanceof EntityPlayerMP){
			EntityPlayerMP player=((EntityPlayerMP)event.getEntity());
			player.inventoryContainer.addListener(new TF2ContainerListener(player));
		}
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:26,代码来源:TF2EventsCommon.java

示例5: addTargetTasks

import net.minecraft.entity.monster.IMob; //导入依赖的package包/类
@SuppressWarnings("unchecked")
/*
  Register targeting tasks here
    */
public void addTargetTasks() {
	switch (dataManager.get(ATTACK_MODE)) {
		case 2:
			this.targetTasks.addTask(2, new EntityAIMasterHurtTarget(this));
		case 1:
			this.targetTasks.addTask(1, new EntityAIMasterHurtByTarget(this));
			this.targetTasks.addTask(1, new EntityAIHurtByNonAllied(this, true));
			this.targetTasks.addTask(2, new EntityAINearestNonTeamTarget(this, EntityPlayer.class, true));
			this.targetTasks.addTask(2, new EntityAINearestNonTeamTarget(this, EntityArmyMember.class, true));
			this.targetTasks.addTask(3, new EntityAINearestNonTeamTarget(this, IMob.class, true));
			break;
		case 0:
		default:
			this.setAttackTarget(null);
			this.setRevengeTarget(null);
			break;
	}
}
 
开发者ID:The-Fireplace-Minecraft-Mods,项目名称:Overlord,代码行数:23,代码来源:EntityArmyMember.java

示例6: attackEntitiesInArea

import net.minecraft.entity.monster.IMob; //导入依赖的package包/类
public static List<EntityLivingBase> attackEntitiesInArea(World world, List<EntityLivingBase> targets, DamageSource damageSource, float damage, boolean attackMobs){
	List<EntityLivingBase> attacked = Lists.newArrayList();
	for(Object obj : targets){
       	if(obj instanceof EntityLivingBase){
       		EntityLivingBase atEntity = (EntityLivingBase) obj;
       		
       		boolean isMob = attackMobs;
       		
       		if(atEntity instanceof IMob){
       			if(!isMob)continue;
       		} else if(isMob) {
       			continue;
       		}
       		
       		if(damageSource == null || atEntity.attackEntityFrom(damageSource, damage)){
       			attacked.add(atEntity);
       		}
       	}
       }
	return attacked;
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:22,代码来源:EntityUtil.java

示例7: EntityJenGolem

import net.minecraft.entity.monster.IMob; //导入依赖的package包/类
public EntityJenGolem(World p_i1694_1_)
{
    super(p_i1694_1_);
    this.setSize(1.4F, 2.9F);
    this.getNavigator().setAvoidsWater(true);
    this.tasks.addTask(1, new EntityAIAttackOnCollide(this, 1.0D, true));
    this.tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 0.9D, 32.0F));
    this.tasks.addTask(3, new EntityAIMoveThroughVillage(this, 0.6D, true));
    this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0D));
    //this.tasks.addTask(5, new EntityAILookAtVillager(this));
    this.tasks.addTask(6, new EntityAIWander(this, 0.6D));
    this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    //this.targetTasks.addTask(1, new EntityAIDefendVillage(this));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, false, true, IMob.mobSelector));
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:18,代码来源:EntityJenGolem.java

示例8: EntityCandyMan

import net.minecraft.entity.monster.IMob; //导入依赖的package包/类
public EntityCandyMan(World var1)
{
    super(var1);
    world = var1;
    experienceValue = 5;
    this.isImmuneToFire = true;
    this.tasks.addTask(1, new EntityAIAttackOnCollide(this, 1.0D, true));
    this.tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 0.9D, 32.0F));
    this.tasks.addTask(3, new EntityAIMoveThroughVillage(this, 0.6D, true));
    this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0D));
    this.tasks.addTask(6, new EntityAIWander(this, 0.6D));
    this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, false, true, IMob.mobSelector));
    this.hasCustomNameTag();
    this.setCustomNameTag("�2The Candy Man");
    addRandomArmor();
    DungeonHooks.addDungeonMob("�2The Candy Man", 180);
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:21,代码来源:EntityCandyMan.java

示例9: EntityPat

import net.minecraft.entity.monster.IMob; //导入依赖的package包/类
public EntityPat(World var1)
{
    super(var1);
    world = var1;
    experienceValue = 5;
    this.isImmuneToFire = true;
    this.tasks.addTask(1, new EntityAIAttackOnCollide(this, 1.0D, true));
    this.tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 0.9D, 32.0F));
    this.tasks.addTask(3, new EntityAIMoveThroughVillage(this, 0.6D, true));
    this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0D));
    this.tasks.addTask(6, new EntityAIWander(this, 0.6D));
    this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, false, true, IMob.mobSelector));
    this.hasCustomNameTag();
    this.setCustomNameTag("FuriousDestroyer");
    
    addRandomArmor();
    DungeonHooks.addDungeonMob("FuriousDestroyer", 180);
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:22,代码来源:EntityPat.java

示例10: EntityCaptianCookie

import net.minecraft.entity.monster.IMob; //导入依赖的package包/类
public EntityCaptianCookie(World var1)
{
    super(var1);
    world = var1;
    experienceValue = 5;
    this.isImmuneToFire = true;
    this.tasks.addTask(1, new EntityAIAttackOnCollide(this, 1.0D, true));
    this.tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 0.9D, 32.0F));
    this.tasks.addTask(3, new EntityAIMoveThroughVillage(this, 0.6D, true));
    this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0D));
    this.tasks.addTask(6, new EntityAIWander(this, 0.6D));
    this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, false, true, IMob.mobSelector));
   
    this.hasCustomNameTag();
    this.setCustomNameTag("Captian Cookie");
    addRandomArmor();
    DungeonHooks.addDungeonMob("Captian Cookie", 180);
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:22,代码来源:EntityCaptianCookie.java

示例11: EntityJen

import net.minecraft.entity.monster.IMob; //导入依赖的package包/类
public EntityJen(World var1)
{
    super(var1);
    world = var1;
    experienceValue = 5;
    this.isImmuneToFire = true;
    this.tasks.addTask(1, new EntityAIAttackOnCollide(this, 1.0D, true));
    this.tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 0.9D, 32.0F));
    this.tasks.addTask(3, new EntityAIMoveThroughVillage(this, 0.6D, true));
    this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0D));
    this.tasks.addTask(6, new EntityAIWander(this, 0.6D));
    this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, false, true, IMob.mobSelector));
    this.hasCustomNameTag();
    this.setCustomNameTag("SuperGirlyGamer");
    addRandomArmor();
    DungeonHooks.addDungeonMob("SuperGirlyGamer", 180);
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:21,代码来源:EntityJen.java

示例12: EntityPatGolem

import net.minecraft.entity.monster.IMob; //导入依赖的package包/类
public EntityPatGolem(World p_i1694_1_)
{
    super(p_i1694_1_);
    this.setSize(1.4F, 2.9F);
    this.getNavigator().setAvoidsWater(true);
    this.tasks.addTask(1, new EntityAIAttackOnCollide(this, 1.0D, true));
    this.tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 0.9D, 32.0F));
    this.tasks.addTask(3, new EntityAIMoveThroughVillage(this, 0.6D, true));
    this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0D));
    //this.tasks.addTask(5, new EntityAILookAtVillager(this));
    this.tasks.addTask(6, new EntityAIWander(this, 0.6D));
    this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    //this.targetTasks.addTask(1, new EntityAIDefendVillage(this));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, false, true, IMob.mobSelector));
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:18,代码来源:EntityPatGolem.java

示例13: EntityBellie

import net.minecraft.entity.monster.IMob; //导入依赖的package包/类
public EntityBellie(World var1)
{
    super(var1);
    world = var1;
    experienceValue = 5;
    this.isImmuneToFire = true;
    this.tasks.addTask(1, new EntityAIAttackOnCollide(this, 1.0D, true));
    this.tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 0.9D, 32.0F));
    this.tasks.addTask(3, new EntityAIMoveThroughVillage(this, 0.6D, true));
    this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0D));
    this.tasks.addTask(6, new EntityAIWander(this, 0.6D));
    this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, false, true, IMob.mobSelector));
   
    this.hasCustomNameTag();
    //this.setCustomNameTag("Captian Cookie");
    addRandomArmor();
    //DungeonHooks.addDungeonMob("Captian Cookie", 180);
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:22,代码来源:EntityBellie.java

示例14: EntitySpookyPat

import net.minecraft.entity.monster.IMob; //导入依赖的package包/类
public EntitySpookyPat(World var1)
{
    super(var1);
    world = var1;
    experienceValue = 5;
    this.isImmuneToFire = true;
    this.tasks.addTask(1, new EntityAIAttackOnCollide(this, 1.0D, true));
    this.tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 0.9D, 32.0F));
    this.tasks.addTask(3, new EntityAIMoveThroughVillage(this, 0.6D, true));
    this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0D));
    this.tasks.addTask(6, new EntityAIWander(this, 0.6D));
    this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, false, true, IMob.mobSelector));
    this.hasCustomNameTag();
    this.setCustomNameTag("FuriousDestroyer");
    
    addRandomArmor();
    DungeonHooks.addDungeonMob("FuriousDestroyer", 180);
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:22,代码来源:EntitySpookyPat.java

示例15: EntitySpookyJen

import net.minecraft.entity.monster.IMob; //导入依赖的package包/类
public EntitySpookyJen(World var1)
{
    super(var1);
    world = var1;
    experienceValue = 5;
    this.isImmuneToFire = true;
    this.tasks.addTask(1, new EntityAIAttackOnCollide(this, 1.0D, true));
    this.tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 0.9D, 32.0F));
    this.tasks.addTask(3, new EntityAIMoveThroughVillage(this, 0.6D, true));
    this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0D));
    this.tasks.addTask(6, new EntityAIWander(this, 0.6D));
    this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, false, true, IMob.mobSelector));
    this.hasCustomNameTag();
    this.setCustomNameTag("SuperGirlyGamer");
    addRandomArmor();
    DungeonHooks.addDungeonMob("SuperGirlyGamer", 180);
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:21,代码来源:EntitySpookyJen.java


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