Started by
lamon_damon
on
Topic category: Help with Minecraft modding (Java Edition)
I wanted to make a sword that, when right-clicked with, it gives a random positive potion effect that lasts 20 seconds, and after you get the potion, a 30 cooldown so you can't spam getting potion effects.
I've tried for hours to make it work and I don't know what I'm doing wrong, could someone help?
Here's the procedure I made: https://imgur.com/a/CGqLCD2
there is a "when item right clicked" trigger you should use instead then you just need to get a random number > activate an effect based on that number > cooldown the provided item stack
I put an image with my code, I think I kinda did all of that, but it still doesn't work...
is that a new image in the top post or the old one?
the new one, I basically didn't change anything
if you used the "when item right clicked" trigger so shouldn't need "item in main hand of" in the if loops
it still doesn't work even without the "item in main hand of"
1st try removing "simulate right click"
if that doesn't work try moving "cooldown item in main hand" to the bottom and/or change it to "cooldown provided item stack"
So I tried what you said, but it still doesn't do anything...
Here's the new code, maybe I messed something up: https://imgur.com/a/Sda89AK
honestly I have no idea maybe you linked the wrong procedure or something
I made a what I told you to make and it worked fine
"maybe you linked the wrong procedure or something" sorry I didn't realize how this could sound what I meant to say is to make sure you have the right procedure selected under triggers
I think the problem is that you're using the "Random number between min X and max X" block, but I think sure that also includes numbers like 0.1, but you're checking for whole numbers. Try switching to the "Random integer between min X and max X included" block. That one will only do whole numbers.
@TheMrCrow good catch
Yep, that worked!! I don't know how I didn't think on changing the random block to be an integer one, but it's alright now. Thank you so much for the help, I appreciate both of you!!
@TheMrCrow would you please like to help me make a mod together?