sigurd4 Posted August 27, 2014 Posted August 27, 2014 isn't this supposed to run every tick for any living entities? event handler: @SubscribeEvent public void livingEvent(LivingEvent event) { if(event.entity instanceof EntityPlayer && EntityExtendedPlayer.get((EntityPlayer) event.entity) != null) { EntityExtendedPlayer props = EntityExtendedPlayer.get((EntityPlayer)event.entity); if(props.getDrunkness() > 0) { props.setDrunkness(props.getDrunkness()-1); } if(props.getMaxShields() > 0) { if(props.getShieldsTimer() > 0) { props.setShieldsTimer(props.getShieldsTimer()-1); } else { props.setCurrentShields(props.getCurrentShields()+0.2F); } } } } the other events work, so i know that i set up the event handler correctly. am i supposed to use a different event? according to tutorials i found this is supposed to work. Quote http://www.planetminecraft.com/member/sigurd4 I'm making the bioshock mod!
sigurd4 Posted August 27, 2014 Author Posted August 27, 2014 oh wait nevermind i figured it out! it was the not null check that didnt work for some reason. quite strange. Quote http://www.planetminecraft.com/member/sigurd4 I'm making the bioshock mod!
Eternaldoom Posted August 27, 2014 Posted August 27, 2014 There is a PlayerTickEvent for ticking players, by the way. Quote Check out my mod, Realms of Chaos, here. If I helped you, be sure to press the "Thank You" button!
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.