(watch me get a whole lotta hate for even attempting to do this instead of updating to 1.10.2)
ok, so i'm working on backporting certain stuff from 1.9+ (using 1.10.2) to 1.8.9. the first real subject of my attention that i can't figure out is the levitation effect. i've found where the actual effect is handled within 1.10.2's code (entityLivingBase, specifically) and wish to backport the same functionality to 1.8.9. however, what's got me riddled is that i can't actually modify the class itself in eclipse to put this in 1.8.9.
my original idea to solve this would be to take the class and make an extended clone of it, but that would require also cloning every mob, calling them as an instance of the extended class, as well as cloning a lot of other classes to account for it...i'd be dead by the time i finish if i did that.
so my question is, is there a better way to handle the levitation effect without actually modifying entityLivingBase? i've read up and modifying base classes can actually break compatibility with other mods, so...that's kinda the last thing i wanna do.
If I were you, I would handle the LivingUpdateEvent (or whatever it is called) to check for your 'levitation' effect and apply motion changes there. Not too hard once you get the potion effect working.
Rollback Post to RevisionRollBack
Click this banner for a list of illegal mod distributors -- only download from legal sites!
Events should only be used when there's no corresponding callback method or when dealing with things created by outside code. In this case, you should override Potion#isReady and Potion#performEffect instead of using LivingUpdateEvent.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Events should only be used when there's no corresponding callback method or when dealing with things created by outside code. In this case, you should override Potion#isReady and Potion#performEffect instead of using LivingUpdateEvent.
(watch me get a whole lotta hate for even attempting to do this instead of updating to 1.10.2)
ok, so i'm working on backporting certain stuff from 1.9+ (using 1.10.2) to 1.8.9. the first real subject of my attention that i can't figure out is the levitation effect. i've found where the actual effect is handled within 1.10.2's code (entityLivingBase, specifically) and wish to backport the same functionality to 1.8.9. however, what's got me riddled is that i can't actually modify the class itself in eclipse to put this in 1.8.9.
my original idea to solve this would be to take the class and make an extended clone of it, but that would require also cloning every mob, calling them as an instance of the extended class, as well as cloning a lot of other classes to account for it...i'd be dead by the time i finish if i did that.
so my question is, is there a better way to handle the levitation effect without actually modifying entityLivingBase? i've read up and modifying base classes can actually break compatibility with other mods, so...that's kinda the last thing i wanna do.
If I were you, I would handle the LivingUpdateEvent (or whatever it is called) to check for your 'levitation' effect and apply motion changes there. Not too hard once you get the potion effect working.
Use forge event, they are called on specific parts of the vanilla code INCLUDING the entity update methods!
Here is a tutorial(It hasn't really changed except some events uses getters for their variables): http://bedrockminer.jimdo.com/modding-tutorials/advanced-modding/event-handler/
use the LivingUpdateEvent
just increase the motionY of the entity
example: motionY+=0.1;
My mods
#StopModReposts
so uh i tried and i got a crash upon trying. what am i doing wrong?
TEM_potions.levitation is null.
Events should only be used when there's no corresponding callback method or when dealing with things created by outside code. In this case, you should override Potion#isReady and Potion#performEffect instead of using LivingUpdateEvent.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
alrighty, it works as intended now. thanks.