Sokaya Posted November 4, 2014 Author Posted November 4, 2014 After addPotionEffect with highter time than 1800 ticks, the potion time changes to infinity. Quote
Sokaya Posted November 4, 2014 Author Posted November 4, 2014 Can you show me where to start? Where's that method what is making time of effect infinity? Quote
shucke Posted November 4, 2014 Posted November 4, 2014 I would suggest creating an IExtendEntityProperties for the player. Create some custom effects, store them somewhere, and add them to a list in the extended properties when a player drinks a potion for example. Create a method in your extended properties to be called onUpdate or something. Use a tick event to call the method. Check in the method for effects. Do whatever you want to happen. example: public class PlayerProperties implements IExtendedEntityProperties{ private EntityPlayer thePlayer; private List<Effect> effects = new ArrayList(); public PlayerProperties(EntityPlayer player){ thePlayer = player; } public void onUpdate(){ for(int i = 0; i < effects.size(); i++){ Effect effect = effects.get(i); effect.execute(thePlayer); effect.time--; if(effect.time == 0) effects.remove(i); } } public void addEffect(int id, int time){ effects.add(new Effect(id, time)); } } if you want more info on how to create IExtendedEntityProperties check out the tutorial from CoolAlias on the minecraft forum. Quote http://www.minecraftforum.net/topic/1937703-162smpforge-pet-mastery-hatch-level-battle/
Recommended Posts
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.