Can I run random commands with a certain probability? #274


  • Enhancment
Open
  • realcommandandorder created this issue May 8, 2021

    like this

    .....

    type: RUN_COMMAND_RANDOM

    runcmd:

     - <60%>/say xxxx

  • realcommandandorder added a tag Enhancment May 8, 2021
  • Caley19_ posted a comment May 8, 2021

    I don't think there's such thing but you could do this:


    type: RUN_COMMAND_RANDOM

    runcmd:

     - /say xxxx

     - /say xxxx

     - /say xxxx

     - /say xxxx

     - /say xxxx

     - /say xxxx

     - /nothing

     - /nothing

     - /nothing

     - /nothing

  • BLiTz_BaNe posted a comment May 12, 2021

    You can actually, By using the randomnumber feature.

    For example, you want to create a20% chance, then you can do $randomnumber%1<to>100% .  Then create an if statement that checks if the random number is 20 or lower, then it will execute the command.


To post a comment, please login or register a new account.