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.

ItsTheRuski

Members
  • Joined

  • Last visited

Everything posted by ItsTheRuski

  1. Thanks for the quick reply. However, I looked at this blog and it describes how to render Items into the player's GUI. I however need to just simply tell the game to look at a certain spot in the inventory.png file and display that image into the GUI. I am getting a potion effect icon except it is blank(except for the blue/yellow) corners. I checked my file to make sure it had transparency, and it did. My problem, I think, arises from these lines of code: ResourceLocation r = new ResourceLocation("textures/gui/container/inventory.png"); TextureObject texture = Minecraft.getMinecraft().renderEngine.func_110581_b(r); Minecraft.getMinecraft().renderEngine.func_110577_a(r); I just need to find away to tell Minecraft to find my .png file. and to register it with the game.
  2. Hello everyone, I have made a custom potion effect; however, I haven't the slightest clue as to which methods to use to add a texture to the potion effect in the player's inventory GUI. Does anyone know how to render textures for potion effects? Thank you! Here is my CustomPotion class package eclipse.MoreApples.potion; import net.minecraft.client.Minecraft; 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.potion.Potion; import net.minecraft.src.ModLoader; import net.minecraft.util.ResourceLocation; public class CustomPotion extends Potion { public CustomPotion(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 this; } @Override public int getStatusIconIndex() { ResourceLocation r = new ResourceLocation("textures/gui/container/inventory.png"); TextureObject texture = Minecraft.getMinecraft().renderEngine.func_110581_b(r); Minecraft.getMinecraft().renderEngine.func_110577_a(r); return super.getStatusIconIndex(); } } Here is my inventory.png picture http://www.mediafire.com/?uk0ntrwmns0jd2g What I Want to Happen: My custom potion effect to show up in my player gui with my custom texture What is Going On Right Now: The potion effect is working correctly, but the texture shows up as a box with yellow/blue corners. I noticed this was the empty space in the original inventory.png file, but I created a new inventory.png with that space filled in.
  3. I had having trouble with the logic of my mod; this is not an error. I have a consumable that is supposed to allow the player to fly for 10 seconds. Then, flying should be disabled; the player should float down gradually, and the player shouldn't take fall damage. For some reason, the player either doesn't fall even though flight is disabled and they are in survival mode, or the player falls but doesn't take fall damage when the flight ability should be over. The player seems to act normally after they take damage from another source that actually deals at least half a heart of damage. Does anyone know how I can make the player fly for 10 seconds, then make them float down gradually and take no damage from the gradual fall. I am open to all answers even if it means rewriting everything. Thanks to everyone for taking the time to read this. I use the onEaten method to run my code. Here is my class declaration of the consumable. Here is my ForgeModLoader-client-0.log
  4. Thanks, I overrode the onEaten method and updated the onItemRightClick method. Now the particle effects are loading properly and the eating in on a proper speed. Thanks a bunch!
  5. I am creating a mod that add an armor that the player can eat to replenish their hunger bar at the cost of the armor's durability. I created a new class that inherits from the ItemArmor class. However, on right click I run the same methods as the onEaten method of ItemFood. Everything is working properly, my hunger bar is replenishing and my duribility is decreasing, except there are no particle effects rendering and the time it takes to eat once is too fast even though I have overiden the method getMaxItemUseDuration to retrun 4 times the default number of ticks. I am attaching my armor class and a video of what's wrong. So my question is how do I add the particle effects and make the eating duration longer? package eclipse.MoreApples.armor; import java.util.Random; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumAction; import net.minecraft.item.EnumArmorMaterial; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class ItemAppleIronBoots extends ItemArmor{ public ItemAppleIronBoots(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) { super(par1, par2EnumArmorMaterial, par3, par4); } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister register){ this.itemIcon = register.registerIcon("more_apples:appleIron_boots"); } public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer){ return "more_apples:textures/models/armor/appleIron_layer_1.png"; } @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { par1ItemStack.attemptDamageItem(2, new Random()); par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); par3EntityPlayer.setEating(true); par2World.playSoundAtEntity(par3EntityPlayer, "random.burp", 0.5F, par2World.rand.nextFloat() * 0.1F + 0.9F); par3EntityPlayer.getFoodStats().addStats(2, 0.2F); return par1ItemStack; } @Override public EnumAction getItemUseAction(ItemStack par1ItemStack) { return EnumAction.eat; } @Override public int getMaxItemUseDuration(ItemStack par1ItemStack) { return 128; } } http://www.mediafire.com/watch/tfu73fvurizbdzq/Eating_Doesn't_Render_Particle_Effects.mp4

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.