Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I was able to get my custom potioneffect to render with my custom texture in the player's gui before I updated to the latest forge. Now there are methods like Minecraft.getMinecraft().renderEngine.bindTexture(par1ResourceLocation) and Minecraft.getMinecraft().renderEngine.getTexture(par1ResourceLocation) and Minecraft.getMinecraft().renderEngine.loadTexture(par1ResourceLocation, par2TextureObject).

 

Does anyone know how to use them?

new ResourceLocation("modID:textures/gui/potion_icon.png")

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

I tried this but I am still not getting the image. In fact, I am not getting the name of my potion effect either.

You probably want to use the bindTexture(...) one.

Though it would be easier to help if you showed some code.

  • Author

Here is my cutom potion file :

package eclipse.MoreApples.potion;


import java.util.Timer;
import java.util.TimerTask;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.renderer.texture.TextureObject;
import net.minecraft.client.resources.ReloadableResourceManager;
import net.minecraft.client.resources.Resource;
import net.minecraft.client.resources.SimpleReloadableResourceManager;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.src.ModLoader;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.living.LivingFallEvent;

public class FlyingPotion extends Potion 
{


public FlyingPotion(int par1, boolean par2, int par3) 
	{
	super(par1, par2, par3);


	}


public Potion setIconIndex(int par1, int par2) 
	{

	//(3,2) is where I drew my texture in the "2D array" of textures in the inventory.png
	super.setIconIndex(3,2);
	return (Potion)this;
	}

@Override
public int getStatusIconIndex() 
	{
	ResourceLocation r = new ResourceLocation("More_Apples:textures/gui/inventory.png");

	TextureObject texture = Minecraft.getMinecraft().renderEngine.getTexture(r);
	Minecraft.getMinecraft().renderEngine.bindTexture(r);


	return super.getStatusIconIndex();

	}



}

 

And here is what's rendering:

 

 

 

 

I have also noticed something. If I give myself the potion effect, then quit the game before the potion effect runs out, it will render this:

 

  • Author

I meant that you can see the images of what's going on. The rendering problem is NOT fixed yet. Please help =)

  • Author

I fixed it. I was giving the player new instances of my potion effects, but I didn't set the status icon of those potion effects.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.