i4m2g00d4u Posted January 28, 2022 Posted January 28, 2022 Hey! I want to make an EntityESP. The EntityESP should color-mark the outlines of the mobs through the walls. The only problem is that the entity also changes color with my method. Screen: https://prnt.sc/26kyk2n My Method: Quote public static void entityESPBox(Entity entity, int mode) { GL11.glBlendFunc(770, 771); GL11.glEnable(GL11.GL_BLEND); GL11.glLineWidth(1.0F); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glDepthMask(false); if(mode == 0)// Enemy GL11.glColor4d( 1 - Minecraft.getMinecraft().thePlayer .getDistanceToEntity(entity) / 40, Minecraft.getMinecraft().thePlayer.getDistanceToEntity(entity) / 40, 0, 0.5F); else if(mode == 1)// Friend GL11.glColor4d(0, 0, 1, 0.5F); else if(mode == 2)// Other GL11.glColor4d(1, 1, 0, 0.5F); else if(mode == 3)// Target GL11.glColor4d(1, 0, 0, 0.5F); else if(mode == 4)// Team GL11.glColor4d(0, 1, 0, 0.5F); Minecraft.getMinecraft().getRenderManager(); RenderGlobal.drawSelectionBoundingBox( new AxisAlignedBB( entity.getCollisionBoundingBox().minX - 0.05 - entity.posX + (entity.posX - Minecraft.getMinecraft() .getRenderManager().viewerPosX), entity.getCollisionBoundingBox().minY - entity.posY + (entity.posY - Minecraft.getMinecraft() .getRenderManager().viewerPosY), entity.getCollisionBoundingBox().minZ - 0.05 - entity.posZ + (entity.posZ - Minecraft.getMinecraft() .getRenderManager().viewerPosZ), entity.getCollisionBoundingBox().maxX + 0.05 - entity.posX + (entity.posX - Minecraft.getMinecraft() .getRenderManager().viewerPosX), entity.getCollisionBoundingBox().maxY + 0.1 - entity.posY + (entity.posY - Minecraft.getMinecraft() .getRenderManager().viewerPosY), entity.getCollisionBoundingBox().maxZ + 0.05 - entity.posZ + (entity.posZ - Minecraft.getMinecraft() .getRenderManager().viewerPosZ))); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glDepthMask(true); GL11.glDisable(GL11.GL_BLEND); } Expand Can anyone help me?
Recommended Posts