Posted January 30, 201312 yr Hello all, In my mod I have it so that when pressing a key under special circumstances the player gets a potion effect, or rather a lot of effects. I've been searching for methods to add Potion Effects without the annoying GUI-Display (which shifts your Inventory over to the right) for quite a long time, but I haven't found anything good yet. I tried removing the effects as soon as you open the Inventory, but it has a tiny very annoying delay, I tried doing it with ".performEffect", which doesn't work for all potions, and I tried replicating the effects of the potions, but there are some (like Night-vision) that are pretty hard to do. I know where the Inventory Render gets called (InventoryEffectRenderer.displayDebuffEffects), but I can't hinder minecraft from doing it… Now my question, is there any good way to add potion effects without the display in the Inventory? Thanks, Max http://dl.dropbox.com/u/47049865/MC/Profile/Signature2.png[/img]
February 1, 201312 yr Author I guess I'll go with replicating the potion effects then http://dl.dropbox.com/u/47049865/MC/Profile/Signature2.png[/img]
September 14, 201312 yr I am trying to do the same thing. So far I have realized that the EntityLiving class has an updatePotionEffects method which takes the hashmap( a hashmap is sort of like an array, but each cell of the array has several attributes) of potioneffects curerntly on the living entity and displays them. There are no parameters to the method, so we cannot modify the way the potioneffects are rendered. However, there are several other ways to achieve our goal: 1. Mimic the commands of instantiating a potioneffect on the living entity in a food item, armor, or such class without adding it to the living entity's potioneffect hashmap( I tried this on a custom food item, still trying to get it to work) 2. Creating a custom class that extends EntityLiving and rewriting the updatePotionEffects method. One would have to change the instance of the player that the potioneffect is suppose to be affecting from a EntityLivingBase to a XXXX class that extends EntityLivingBase Try the first option and I will try the second option. This way we can collaborate on our mutual dilemma. =)
September 14, 201312 yr Make a entityLivingEvent handler and then look if this key is pressed: Add the player who pressed the key a potioneffect.
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.