Jump to content

Recommended Posts

Posted

As the title states I want to render a layer or really anything that makes the entities I select turn blue, similar to the red layering of when a player is on fire but with my own twists to it. I have looked in vanilla code and saw that RenderBlockScreenEffectEvent holds all the information before the layering is added to the player(apparently its a block layered onto a player I am unsure) I want to do this but there is no actual code about how to do it its just documentation and get() methods. I've seen other members on the forum mention RenderSystem.setShaderColor but I dont understand how to get the ShaderInstance of the entity. Right now I am stuck between using RenderSystem or creating my own Layering which again has little to no documentation on it. 

 

Currently this is all I have

@SubscribeEvent
    public static void onLivingRender(RenderLivingEvent.Pre e){
        LivingEntity entity = e.getEntity();
        if(entity.getPersistentData().contains(XprtData.ICE_BALL_FROZEN)){
            RenderSystem.setShader(GameRenderer::getRendertypeEntityNoOutlineShader);
            RenderSystem.setShaderColor(0,0,255,1);
        }
    }

I noticed in the event it has LivingRenderer class which has getModel() which also has a render method which can be used to re-render the model which I have also tried to do but when getting the RenderType from its ResourceLocation it just returns a default player model head and is placed directly at head level of the entity. Very weird

Posted
1 hour ago, sFXprt said:

Right now I am stuck between using RenderSystem or creating my own Layering which again has little to no documentation on it. 

Create a new RenderLayer for that and do something like the EnergySwirlLayer. Then, attach it during EntityRenderersEvent$AddLayers on the mod event bus. What you are doing right now will do nothing as the parameters are set by the model before rendering anyways.

Posted
11 hours ago, ChampionAsh5357 said:

Create a new RenderLayer for that and do something like the EnergySwirlLayer. Then, attach it during EntityRenderersEvent$AddLayers on the mod event bus. What you are doing right now will do nothing as the parameters are set by the model before rendering anyways.

Got it, thanks for letting me know 👍

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.