net.minecraft.entity.monster.IMob Java Examples

The following examples show how to use net.minecraft.entity.monster.IMob. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TracersModule.java    From seppuku with GNU General Public License v3.0 6 votes vote down vote up
private boolean checkFilter(Entity entity) {
    boolean ret = false;

    if (this.players.getValue() && entity instanceof EntityPlayer && entity != Minecraft.getMinecraft().player) {
        ret = true;
    }

    if (this.mobs.getValue() && entity instanceof IMob) {
        ret = true;
    }

    if (this.animals.getValue() && entity instanceof IAnimals && !(entity instanceof IMob)) {
        ret = true;
    }

    if (this.vehicles.getValue() && (entity instanceof EntityBoat || entity instanceof EntityMinecart || entity instanceof EntityMinecartContainer)) {
        ret = true;
    }

    if (this.items.getValue() && entity instanceof EntityItem) {
        ret = true;
    }

    return ret;
}
 
Example #2
Source File: FamiliarController.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
private List<EntityLivingBase> getAttackableEntities(double rad) {
    double x = owningPlayer.posX;
    double y = owningPlayer.posY;
    double z = owningPlayer.posZ;
    List<EntityLivingBase> entities = owningPlayer.worldObj.getEntitiesWithinAABB(EntityLivingBase.class,
            AxisAlignedBB.getBoundingBox(x - 0.5, y - 0.5, z - 0.5, x + 0.5, y + 0.5, z + 0.5).expand(rad, rad, rad));

    Iterator<EntityLivingBase> it = entities.iterator();
    while (it.hasNext()) {
        EntityLivingBase base = it.next();
        if (base == null || base.isDead || base instanceof EntityPlayer || !(base instanceof IMob)) it.remove();
        //TODO remove entities we don't want to attack...
    }

    return entities;
}
 
Example #3
Source File: EntityTofunian.java    From TofuCraftReload with MIT License 6 votes vote down vote up
public void onDeath(DamageSource cause) {
    if (this.village != null) {
        Entity entity = cause.getTrueSource();

        if (entity != null) {
            if (entity instanceof EntityPlayer) {
                this.village.modifyPlayerReputation(entity.getUniqueID(), -2);
            } else if (entity instanceof IMob) {
                this.village.endMatingSeason();
            }
        } else {
            EntityPlayer entityplayer = this.world.getClosestPlayerToEntity(this, 16.0D);

            if (entityplayer != null) {
                this.village.endMatingSeason();
            }
        }
    }

    super.onDeath(cause);
}
 
Example #4
Source File: RadarHack.java    From ForgeWurst with GNU General Public License v3.0 5 votes vote down vote up
@SubscribeEvent
public void onUpdate(WUpdateEvent event)
{
	EntityPlayerSP player = event.getPlayer();
	World world = WPlayer.getWorld(player);
	
	entities.clear();
	Stream<Entity> stream = world.loadedEntityList.parallelStream()
		.filter(e -> !e.isDead && e != player)
		.filter(e -> !(e instanceof EntityFakePlayer))
		.filter(e -> e instanceof EntityLivingBase)
		.filter(e -> ((EntityLivingBase)e).getHealth() > 0);
	
	if(filterPlayers.isChecked())
		stream = stream.filter(e -> !(e instanceof EntityPlayer));
	
	if(filterSleeping.isChecked())
		stream = stream.filter(e -> !(e instanceof EntityPlayer
			&& ((EntityPlayer)e).isPlayerSleeping()));
	
	if(filterMonsters.isChecked())
		stream = stream.filter(e -> !(e instanceof IMob));
	
	if(filterAnimals.isChecked())
		stream = stream.filter(e -> !(e instanceof EntityAnimal
			|| e instanceof EntityAmbientCreature
			|| e instanceof EntityWaterMob));
	
	if(filterInvisible.isChecked())
		stream = stream.filter(e -> !e.isInvisible());
	
	entities.addAll(stream.collect(Collectors.toList()));
}
 
Example #5
Source File: EntityClayGolem.java    From Artifacts with MIT License 5 votes vote down vote up
protected void collideWithEntity(Entity par1Entity)
{
    if (par1Entity instanceof IMob && this.getRNG().nextInt(20) == 0)
    {
        this.setAttackTarget((EntityLiving)par1Entity);
    }

    super.collideWithEntity(par1Entity);
}
 
Example #6
Source File: EntityArcher.java    From Electro-Magic-Tools with GNU General Public License v3.0 5 votes vote down vote up
public EntityArcher(World par1World) {
    super(par1World);
    this.isImmuneToFire = true;
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, true, false, IMob.mobSelector));
    this.tasks.addTask(4, new EntityAIWander(this, 0.30D));
}
 
Example #7
Source File: ItemMobSpawner.java    From NotEnoughItems with MIT License 5 votes vote down vote up
@Override
public void addInformation(ItemStack itemstack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
    setDefaultTag(itemstack);
    int meta = itemstack.getItemDamage();
    if (meta == 0) {
        meta = idPig;
    }
    Entity e = getEntity(meta);
    list.add("\u00A7" + (e instanceof IMob ? "4" : "3") + IDtoNameMap.get(meta));
}
 
Example #8
Source File: ItemMobSpawner.java    From NotEnoughItems with MIT License 5 votes vote down vote up
@Override
public void addInformation(ItemStack itemstack, @Nullable World worldIn, List<String> list, ITooltipFlag flag) {
    setDefaultTag(itemstack);
    int meta = itemstack.getItemDamage();
    if (meta == 0) {
        meta = idPig;
    }
    Entity e = getEntity(meta);
    list.add("\u00A7" + (e instanceof IMob ? "4" : "3") + IDtoNameMap.get(meta));
}
 
Example #9
Source File: EntityGuard.java    From YouTubeModdingTutorial with MIT License 5 votes vote down vote up
@Override
protected void initEntityAI() {
    this.tasks.addTask(1, new EntityAIAttackMelee(this, 1.0D, true));
    this.tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 0.9D, 32.0F));
    this.tasks.addTask(3, new GuardAIFollow(this, 1.0D, 6.0F, 9.0F));
    this.tasks.addTask(6, new EntityAIWanderAvoidWater(this, 0.6D));
    this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget<>(this, EntityLiving.class, 4, false, true,
            entity -> entity != null && IMob.VISIBLE_MOB_SELECTOR.apply(entity)));
}
 
Example #10
Source File: Tracers.java    From bleachhack-1.14 with GNU General Public License v3.0 5 votes vote down vote up
public void onRender() {
	if (this.isToggled()) {
		final float thick = (float) getSettings().get(7).toSlider().getValue();
		
		for (Entity e: EntityUtils.getLoadedEntities()) {
			Vec3d vec = e.getPositionVec();
			Vec3d vec2 = new Vec3d(0, 0, 0.25).rotatePitch(-(float) Math.toRadians(mc.player.rotationPitch))
					.rotateYaw(-(float) Math.toRadians(mc.player.rotationYaw))
					.add(mc.player.getEyePosition(mc.getRenderPartialTicks()));
			
			if (e instanceof PlayerEntity && e != mc.player && getSettings().get(0).toToggle().state) {
				RenderUtils.drawLine(vec2.x,vec2.y,vec2.z,vec.x,vec.y,vec.z,1f,0f,0f,thick);
				RenderUtils.drawLine(vec.x,vec.y,vec.z, vec.x,vec.y+(e.getHeight()/1.1),vec.z,1f,0f,0f,thick);
			}
			if (e instanceof IMob && getSettings().get(1).toToggle().state) {
				RenderUtils.drawLine(vec2.x,vec2.y,vec2.z,vec.x,vec.y,vec.z,0f,0f,0f,thick);
				RenderUtils.drawLine(vec.x,vec.y,vec.z, vec.x,vec.y+(e.getHeight()/1.1),vec.z,0f,0f,0f,thick);
			}
			if (EntityUtils.isAnimal(e) && getSettings().get(2).toToggle().state) {
				RenderUtils.drawLine(vec2.x,vec2.y,vec2.z,vec.x,vec.y,vec.z,0f,1f,0f,thick);
				RenderUtils.drawLine(vec.x,vec.y,vec.z, vec.x,vec.y+(e.getHeight()/1.1),vec.z,0f,1f,0f,thick);
			}
			if (e instanceof ItemEntity && getSettings().get(3).toToggle().state) {
				RenderUtils.drawLine(vec2.x,vec2.y,vec2.z,vec.x,vec.y,vec.z,1f,0.7f,0f,thick);
				RenderUtils.drawLine(vec.x,vec.y,vec.z, vec.x,vec.y+(e.getHeight()/1.1),vec.z,1f,0.7f,0f,thick);
			}
			if (e instanceof EnderCrystalEntity && getSettings().get(4).toToggle().state) {
				RenderUtils.drawLine(vec2.x,vec2.y,vec2.z,vec.x,vec.y,vec.z,1f, 0f, 1f,thick);
				RenderUtils.drawLine(vec.x,vec.y,vec.z, vec.x,vec.y+(e.getHeight()/1.1),vec.z,1f, 0f, 1f,thick);
			}
			if ((e instanceof BoatEntity || e instanceof AbstractMinecartEntity) && getSettings().get(5).toToggle().state) {
				RenderUtils.drawLine(vec2.x,vec2.y,vec2.z,vec.x,vec.y,vec.z,0.5f, 0.5f, 0.5f,thick);
				RenderUtils.drawLine(vec.x,vec.y,vec.z, vec.x,vec.y+(e.getHeight()/1.1),vec.z,0.5f, 0.5f, 0.5f,thick);
			}
		}
	}
}
 
Example #11
Source File: ESP.java    From bleachhack-1.14 with GNU General Public License v3.0 5 votes vote down vote up
public void onUpdate() {
	if (this.isToggled()) {
		for (Entity e: EntityUtils.getLoadedEntities()) {
			if (e instanceof PlayerEntity && e != mc.player && getSettings().get(0).toToggle().state) {
				EntityUtils.setGlowing(e, TextFormatting.RED, "players");
			}
			
			if (e instanceof IMob && getSettings().get(1).toToggle().state) {
				EntityUtils.setGlowing(e, TextFormatting.DARK_BLUE, "mobs");
			}
			
			if (EntityUtils.isAnimal(e) && getSettings().get(2).toToggle().state) {
				EntityUtils.setGlowing(e, TextFormatting.GREEN, "passive");
			}
			
			if (e instanceof ItemEntity && getSettings().get(3).toToggle().state) {
				EntityUtils.setGlowing(e, TextFormatting.GOLD, "items");
			}
			
			if (e instanceof EnderCrystalEntity && getSettings().get(4).toToggle().state) {
				EntityUtils.setGlowing(e, TextFormatting.LIGHT_PURPLE, "crystals");
			}
			if ((e instanceof BoatEntity || e instanceof AbstractMinecartEntity) && getSettings().get(5).toToggle().state) {
				EntityUtils.setGlowing(e, TextFormatting.GRAY, "vehicles");
			}
		}
	}
}
 
Example #12
Source File: WallHackModule.java    From seppuku with GNU General Public License v3.0 5 votes vote down vote up
private int getColor(Entity entity) {
    int ret = -1;

    if (entity instanceof IAnimals && !(entity instanceof IMob)) {
        ret = 0xFF00FF44;
    }
    if (entity instanceof IMob) {
        ret = 0xFFFFAA00;
    }
    if (entity instanceof EntityBoat || entity instanceof EntityMinecart || entity instanceof EntityMinecartContainer) {
        ret = 0xFF00FFAA;
    }
    if (entity instanceof EntityItem) {
        ret = 0xFF00FFAA;
    }
    if (entity instanceof EntityEnderCrystal) {
        ret = 0xFFCD00CD;
    }
    if (entity instanceof EntityEnderPearl) {
        ret = 0xFFCD00CD;
    }
    if (entity instanceof EntityPlayer) {
        ret = 0xFFFF4444;

        if (entity == Minecraft.getMinecraft().player) {
            ret = -1;
        }

        if (entity.isSneaking()) {
            ret = 0xFFEE9900;
        }

        if (Seppuku.INSTANCE.getFriendManager().isFriend(entity) != null) {
            ret = 0xFF9900EE;
        }
    }
    return ret;
}
 
Example #13
Source File: WallHackModule.java    From seppuku with GNU General Public License v3.0 5 votes vote down vote up
private boolean checkFilter(Entity entity) {
    boolean ret = false;

    if (this.local.getValue() && (entity == Minecraft.getMinecraft().player) && (Minecraft.getMinecraft().gameSettings.thirdPersonView != 0)) {
        ret = true;
    }
    if (this.players.getValue() && entity instanceof EntityPlayer && entity != Minecraft.getMinecraft().player) {
        ret = true;
    }
    if (this.mobs.getValue() && entity instanceof IMob) {
        ret = true;
    }
    if (this.animals.getValue() && entity instanceof IAnimals && !(entity instanceof IMob)) {
        ret = true;
    }
    if (this.items.getValue() && entity instanceof EntityItem) {
        ret = true;
    }
    if (this.crystals.getValue() && entity instanceof EntityEnderCrystal) {
        ret = true;
    }
    if (this.vehicles.getValue() && (entity instanceof EntityBoat || entity instanceof EntityMinecart || entity instanceof EntityMinecartContainer)) {
        ret = true;
    }
    if (this.armorStand.getValue() && entity instanceof EntityArmorStand) {
        ret = true;
    }

    if (this.pearls.getValue() && entity instanceof EntityEnderPearl) {
        ret = true;
    }

    if (Minecraft.getMinecraft().player.getRidingEntity() != null && entity == Minecraft.getMinecraft().player.getRidingEntity()) {
        ret = false;
    }

    return ret;
}
 
Example #14
Source File: TracersModule.java    From seppuku with GNU General Public License v3.0 5 votes vote down vote up
private int getColor(Entity entity) {
    int ret = -1;

    if (entity instanceof IAnimals && !(entity instanceof IMob)) {
        ret = 0xFF00FF44;
    }

    if (entity instanceof IMob) {
        ret = 0xFFFFAA00;
    }

    if (entity instanceof EntityBoat || entity instanceof EntityMinecart || entity instanceof EntityMinecartContainer) {
        ret = 0xFF00FFAA;
    }

    if (entity instanceof EntityItem) {
        ret = 0xFF00FFAA;
    }

    if (entity instanceof EntityPlayer) {
        ret = 0xFFFF4444;

        if (Seppuku.INSTANCE.getFriendManager().isFriend(entity) != null) {
            ret = 0xFF9900EE;
        }
    }

    return ret;
}
 
Example #15
Source File: KillAuraModule.java    From seppuku with GNU General Public License v3.0 5 votes vote down vote up
private boolean checkFilter(Entity entity) {
    boolean ret = false;

    if (this.players.getValue() && entity instanceof EntityPlayer && entity != Minecraft.getMinecraft().player && Seppuku.INSTANCE.getFriendManager().isFriend(entity) == null && !entity.getName().equals(Minecraft.getMinecraft().player.getName())) {
        ret = true;
    }

    if (this.mobs.getValue() && entity instanceof IMob) {
        ret = true;
    }

    if (this.animals.getValue() && entity instanceof IAnimals && !(entity instanceof IMob)) {
        ret = true;
    }

    if (this.vehicles.getValue() && (entity instanceof EntityBoat || entity instanceof EntityMinecart || entity instanceof EntityMinecartContainer)) {
        ret = true;
    }

    if (this.projectiles.getValue() && (entity instanceof EntityShulkerBullet || entity instanceof EntityFireball)) {
        ret = true;
    }

    if (entity instanceof EntityLivingBase) {
        final EntityLivingBase entityLivingBase = (EntityLivingBase) entity;
        if (entityLivingBase.getHealth() <= 0) {
            ret = false;
        }
    }

    return ret;
}
 
Example #16
Source File: KillauraHack.java    From ForgeWurst with GNU General Public License v3.0 4 votes vote down vote up
@SubscribeEvent
public void onUpdate(WUpdateEvent event)
{
	EntityPlayerSP player = event.getPlayer();
	World world = WPlayer.getWorld(player);
	
	if(player.getCooledAttackStrength(0) < 1)
		return;
	
	double rangeSq = Math.pow(range.getValue(), 2);
	Stream<EntityLivingBase> stream = world.loadedEntityList
		.parallelStream().filter(e -> e instanceof EntityLivingBase)
		.map(e -> (EntityLivingBase)e)
		.filter(e -> !e.isDead && e.getHealth() > 0)
		.filter(e -> WEntity.getDistanceSq(player, e) <= rangeSq)
		.filter(e -> e != player)
		.filter(e -> !(e instanceof EntityFakePlayer));
	
	if(filterPlayers.isChecked())
		stream = stream.filter(e -> !(e instanceof EntityPlayer));
	
	if(filterSleeping.isChecked())
		stream = stream.filter(e -> !(e instanceof EntityPlayer
			&& ((EntityPlayer)e).isPlayerSleeping()));
	
	if(filterFlying.getValue() > 0)
		stream = stream.filter(e -> {
			
			if(!(e instanceof EntityPlayer))
				return true;
			
			AxisAlignedBB box = e.getEntityBoundingBox();
			box = box.union(box.offset(0, -filterFlying.getValue(), 0));
			// Using expand() with negative values doesn't work in 1.10.2.
			return world.collidesWithAnyBlock(box);
		});
	
	if(filterMonsters.isChecked())
		stream = stream.filter(e -> !(e instanceof IMob));
	
	if(filterPigmen.isChecked())
		stream = stream.filter(e -> !(e instanceof EntityPigZombie));
	
	if(filterEndermen.isChecked())
		stream = stream.filter(e -> !(e instanceof EntityEnderman));
	
	if(filterAnimals.isChecked())
		stream = stream.filter(e -> !(e instanceof EntityAnimal
			|| e instanceof EntityAmbientCreature
			|| e instanceof EntityWaterMob));
	
	if(filterBabies.isChecked())
		stream = stream.filter(e -> !(e instanceof EntityAgeable
			&& ((EntityAgeable)e).isChild()));
	
	if(filterPets.isChecked())
		stream = stream
			.filter(e -> !(e instanceof EntityTameable
				&& ((EntityTameable)e).isTamed()))
			.filter(e -> !WEntity.isTamedHorse(e));
	
	if(filterVillagers.isChecked())
		stream = stream.filter(e -> !(e instanceof EntityVillager));
	
	if(filterGolems.isChecked())
		stream = stream.filter(e -> !(e instanceof EntityGolem));
	
	if(filterInvisible.isChecked())
		stream = stream.filter(e -> !e.isInvisible());
	
	target = stream.min(priority.getSelected().comparator).orElse(null);
	if(target == null)
		return;
	
	RotationUtils
		.faceVectorPacket(target.getEntityBoundingBox().getCenter());
	mc.playerController.attackEntity(player, target);
	player.swingArm(EnumHand.MAIN_HAND);
}
 
Example #17
Source File: ChamsModule.java    From seppuku with GNU General Public License v3.0 4 votes vote down vote up
private boolean checkFilter(Entity entity) {
    boolean ret = false;

    if (entity == Minecraft.getMinecraft().player) {
        ret = false;
    }

    final Entity riding = Minecraft.getMinecraft().player.getRidingEntity();

    if (riding != null && entity == riding) {
        ret = false;
    }

    if (this.players.getValue() && entity instanceof EntityPlayer && entity != Minecraft.getMinecraft().player) {
        ret = true;
    }

    if (this.animals.getValue() && entity instanceof IAnimals) {
        ret = true;
    }

    if (this.mobs.getValue() && entity instanceof IMob) {
        ret = true;
    }

    if (this.vehicles.getValue() && (entity instanceof EntityBoat || entity instanceof EntityMinecart || entity instanceof EntityMinecartContainer)) {
        ret = true;
    }

    if (this.crystals.getValue() && entity instanceof EntityEnderCrystal) {
        ret = true;
    }

    if (entity instanceof EntityLivingBase) {
        final EntityLivingBase entityLiving = (EntityLivingBase) entity;

        if (entityLiving.ticksExisted <= 0) {
            ret = false;
        }
    }

    return ret;
}
 
Example #18
Source File: EntityOwl.java    From EnderZoo with Creative Commons Zero v1.0 Universal 4 votes vote down vote up
@Override
public boolean canBeLeashedTo(EntityPlayer player){
  boolean ret = !this.getLeashed() && (this instanceof IMob);
  return ret;
}