Topic category: Help with Minecraft modding (Java Edition)
Hello! I am posting here today because I cannot find any information about this particular thing I am trying to attempt.
I am trying to create a working procedure for a mob of mine. When the player right-clicks the mob, it will give random NPC-like responses already set with the "Send to chat to all players". I have a total of 10 different responses to keep things interesting and not repetative.
Currently, when I right-click the mob during a test game it generates ALL the options I manually entered in the procedure at once and I am trying to fix this. Does anyone know what I am doing wrong? All I want is for once random response at a time per right+click. Any help is highly appreciated! Thank you~
Yeah I know this is messy, but bare with me please.
Still nothing huh?
Just use if else statements and set the random value to a local variable so its the same random value, and have your total values checked to equal to the max random value that can be created.
randVal = rand;
If( randVal >0.1)
else if(randVal>0.2)
else if (rand)...
and so on like that. You can manipulate this as needed.
It worked! Thank you for the help.