I need help with my Randomizing Code

Started by Xeirux on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I need help with my Randomizing Code

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.