I need help with my Randomizing Code

Started by Xeirux on Wed, 02/03/2021 - 21:00

Topic category: Help with modding (Java Edition)

Last seen on 08:00, 2. Oct 2021
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I need help with my Randomizing Code
Wed, 02/03/2021 - 21:00

So basically, i have this code
 

int rando = (int)(Math.random(1,2));
                int rando = (int)(Math.random()*2)+1;
                    
                    if(rando==1){
                        return new ResourceLocation("cd_walkers:textures/zombie.png");
                     }
                    
                    else{
                        return new ResourceLocation("cd_walkers:textures/zombie2.png");
                        }

                }
            };

https://imgur.com/HOms3H2 screenshot of Error

I don't know what's wrong with it.