本文整理匯總了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;
}
}
}
}
示例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;
}
示例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));
}
示例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));
}
}
}
示例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;
}
}
示例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;
}
示例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));
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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));
}
示例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);
}
示例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);
}
示例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);
}