Started by
half glaceon
on
Topic category: Help with Minecraft modding (Java Edition)
Hello! So uhhh, I really am kinda new on the variables and procedures stuff, and haven't been here for a while.
So I want to do a weapon (melee sword to be more specific) that has a CHANCE to trigger a potion effect on whoever it hits.
Again, what I'm looking for is for it to have a chance but not always do the effect.
So, anybody knows how to help me with this?
Definitely! When you create your weapon, on the "living entity is hit with weapon" trigger, set up a procedure that says "if [random: 0,1] >= 0.9 do apply potion effect.
This means there is a 10% chance to apply potion effect. (1.0 - 0.9 = 0.1)
You can find the [random 0,1] block under math tab
>= is located under the logic, you need to use the math equal sign and then use the drop down to select >=