How to process the player's screen on FabricAPI?

Viewed 13

in minecraft it is possible to process the player's screen (Example of effects: night vision, nausea, blindness ...), I have a desire to add my own effects similar to those given, but I don't know how to process the player's screen, and I see an example of the origi

All I could achieve

    @Override
public void inventoryTick(ItemStack stack, World world, Entity entity, int slot, boolean selected) {
    if (!world.isClient) {
        if (entity instanceof LivingEntity) {
            if (Screen.hasControlDown()) {
                RenderSystem.recordRenderCall(() -> {
                    MinecraftClient client = MinecraftClient.getInstance();
                    Identifier textureIdentifier =  client.getTextureManager().registerDynamicTexture("light_map", new NativeImageBackedTexture(16, 16, false));
                    RenderSystem.setShaderTexture(2, textureIdentifier);
                    client.getTextureManager().bindTexture(textureIdentifier);
                    RenderSystem.texParameter(3553, 10241, 9729);
                    RenderSystem.texParameter(3553, 10240, 9729);
                    RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
                });
            }
        }
    }
    super.inventoryTick(stack, world, entity, slot, selected);
}
0 Answers
Related