How to make Mob with multiple chat respsonses? [Procedure help]

Started by MasterRuste on

Topic category: Help with modding (Java Edition)

Last seen on 02:45, 16. Nov 2023
Joined Dec 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make Mob with multiple chat respsonses? [Procedure help]

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~

 

Current Procedure and Mod Test

Yeah I know this is messy, but bare with me please.

 

Last seen on 02:45, 16. Nov 2023
Joined Dec 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Still nothing huh? 
Sat, 09/03/2022 - 19:26

Still nothing huh? 

Last seen on 06:22, 13. Mar 2023
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Just use if else statements…
Sun, 09/04/2022 - 13:24

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.

Last seen on 02:45, 16. Nov 2023
Joined Dec 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It worked! Thank you for the…
Mon, 09/05/2022 - 05:37

It worked! Thank you for the help.