OK so using RenderGameOverlayEvent I managed to check when the player have a certain item on the helmet slot but fore some reason the overlay itself don't work.
Here is the code:
public class MODIngameGui extends IngameGui
{
protected static final ResourceLocation GASMASK_BLUR_TEX_PATH = new ResourceLocation("mod:textures/guis/gasmask.png");
protected void renderGasmaskOverlay() {
RenderSystem.disableDepthTest();
RenderSystem.depthMask(false);
RenderSystem.defaultBlendFunc();
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
RenderSystem.disableAlphaTest();
this.mc.getTextureManager().bindTexture(GASMASK_BLUR_TEX_PATH);
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferbuilder = tessellator.getBuffer();
bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX);
bufferbuilder.pos(0.0D, (double)this.scaledHeight, -90.0D).tex(0.0F, 1.0F).endVertex();
bufferbuilder.pos((double)this.scaledWidth, (double)this.scaledHeight, -90.0D).tex(1.0F, 1.0F).endVertex();
bufferbuilder.pos((double)this.scaledWidth, 0.0D, -90.0D).tex(1.0F, 0.0F).endVertex();
bufferbuilder.pos(0.0D, 0.0D, -90.0D).tex(0.0F, 0.0F).endVertex();
tessellator.draw();
RenderSystem.depthMask(true);
RenderSystem.enableDepthTest();
RenderSystem.enableAlphaTest();
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
}
public MODIngameGui(Minecraft mcIn, MatrixStack matrixStack)
{
super(mcIn);
ItemStack itemstack = this.mc.player.inventory.armorItemInSlot(3);
if (this.mc.gameSettings.getPointOfView().func_243192_a() && itemstack.getItem() == items_MOD.GAS_MASK.get()) {
this.renderGasmaskOverlay();
mod.LOGGER.info("test test test");
}
}
}
even tried to use, renderPumpkinOverlay but no success
the message appear in the console by the way