How do I make a mob have random armor and swords?

Started by bigboypadilla9 on

Topic category: Help with MCreator software

Last seen on 04:08, 18. Apr 2022
Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I make a mob have random armor and swords?

I am making a mod where a mob has random armor and swords. Like it could have iron armor, half diamond half leather armor, iron sword, or a wooden sword. I really need help because I am very stumped and have no idea what to do.

Last seen on 19:39, 20. Oct 2019
Joined Oct 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
First, you could set up an…
Sun, 10/13/2019 - 09:05

First, you could set up an ArrayList for all armor parts.

Then, out of every of these lists, you pick one random item by randomized index:

Random r = new Random();
entity.setChestplate(chestplates.get(r.nextInt(chestplates.size)); //dont really know if this is the constructor to set an armor chestplate to a mob