Posted February 5, 20196 yr Hey guys, I am making this post because a friend of mine asked me how to make his item give the player a potion effect if it is in the player's inventory, however neither of us knew how to do this, so for this reason I have come here for some insight on how to do this. I am assuming it will involve an event but I could be wrong. If it does use an event, I am clueless of which one. Thanks for the help in advance!
February 5, 20196 yr Author 6 minutes ago, diesieben07 said: Check if the entity has your potion effect (EntityLivingBase#getActivePotionEffect) however Item#onUpdateuses Entity not EntityLivingBase so there is no getActivePotionEffect.
February 5, 20196 yr Author 1 minute ago, diesieben07 said: If you do not know basic Java you should not be writing mods. if statements, instanceof operator, casting. Those are the tools you need. I figured it out while you were typing this, sorry, I have been working a lot with lua and python lately and not much on java at all so I was getting confused lmao. but thx for the help.
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.