Started by
Burnout23
on
Topic category: Help with Minecraft modding (Java Edition)
Hi, i made an item that allows me to summon lightning at a location i can see when i right click with it but wanted to make it usable in my offhand as well but its not working and was hoping someone could me understand why
i can expand the procedure in the do sections if needed but those should not be related to the problem
Edited by Burnout23 on Tue, 01/23/2024 - 00:33
I'm not quite sure why you needed variables to check the item, you could just use the in main/offhand block Instead of the local variable, also if the user has them in both hands it will not register for the second one since they are in an else if, breaking them into 2 if statements would fix that issue. quick tip, when using else if statements if a condition prior was satisfied then it will not continue checking the next else if statements down the chain, so if it is possible for 2 statements to be true at the same time (like in this case) make them both seperate if statements.
Thank you i appreciate the help. i didn't need the variable i just did it cause it easier for me to keep things sorted, your solution worked but for some reason the cooldown no longer works when the item is in myoffhand, do you have any ideas as to why that could be?(sorry this only like my 3rd or 4th day modding). and thank you for the tip, i appreciate it
nvm think i figured it out, I'm just dumb lol