當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。