Jump to content

Custom Effect not Rendering on GUI [1.16.5]


Recommended Posts

Hi! I was trying to  reate a custom effect, and it works properly except for a little thing.

When im on the Inventory of the Player, it doesn't render at all, how can i do?
I see that there is a method called "renderHUDEffect(...)", but i don't know how to use it.
Someone can help me?

This is my Effect Class:

public class ColorEffect extends Effect {

    private final String colorName;
    private final String descriptionId;

    public ColorEffect(String colorName, int color) {
        super(EffectType.HARMFUL, color);
        this.colorName = colorName;
        this.descriptionId = "color.effect." + colorName;

    public void applyEffectTick(LivingEntity entity, int amplifier) {
        if (entity instanceof PlayerEntity) {
            PlayerEntity player = (PlayerEntity) entity;
            if (amplifier <= 0) {
            player.addEffect(new EffectInstance(this, 2000, amplifier));

    public boolean isDurationEffectTick(int duration, int amplifier) {
        return true;

    public String getColorName() {
        return colorName;

    public ITextComponent getDisplayName() {
        return new TranslationTextComponent("colorfood.effect." + this.colorName);

    public String getOrCreateDescriptionId() {
        return this.descriptionId;


Link to comment
Share on other sites

8 minutes ago, Yurim64 said:

Oh, I need to register the Effect?
Not finding the EFFECT tag in ForgeRegistries I thought I shouldn't register them. How can I register an effect?

ForgeRegistries#POTIONS for an effect, ForgeRegistries#POTION_TYPES -> for a potion

Link to comment
Share on other sites

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.

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.

  • Create New...

Important Information

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