本文整理汇总了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);
}