Hey Guys! So me and a friend are working on 2 mods and we are both having trouble with potion effects on items, we've been searching the internet for hours trying to figure out how to get this work, this is our scenario:
My problem is trying to make it so when you put an item in your hand and right-click it, it will give you invisibility but when you hit someone with the same item by left clicking it gives them nausea and slowness.
His problem is that he wants to be able to right-click his item and give the player confusion.
I'm not sure if the codeing is too complicated but we've been coding for weeks now and we just can't seem to fgure out how to get this to work. Any help or reply would be appreiated! Thank you!
You are not going to get anywhere until you know java a bit better. This is your mod, so it is you that should write the code. Part of the fun of modding is reverse engineering and understanding how minecraft works (well, that's what it is for me). It is doubtful you are going to find a ready made solution out there.
It is up to you to work it out, as countless other people have taken it upon themselves to work out how minecraft works to make their own modifications. If you can't understand minecraft's code enough to make mods yourself, then my suggestion is to study up on java, or even go further back and study programming fundamentals. If modding is something you want to do, get the fundamentals first. This is not an easy hobby, but it is fun as hell if you get there Hope this helps
About your code, you put a method declaration inside a constructor. If you don't know why this is wrong, or how to fix it, you definitely need to learn more programming, and more about programming first.
Thank you Terith! I didnt know that but I figured it out. And also thanks for the other info, I've been trying my best to learn java but it's kind've hard if you don't know where to look, u'know? Anyways thank you for the insight and help!