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

Started by bigboypadilla9 on

Topic category: Help with MCreator software

Active 3 years ago
Joined Jul 2017
Points:
1022

User statistics:

  • Modifications: 18
  • Forum topics: 24
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 54
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.

Active 5 years ago
Joined Oct 2019
Points:
655

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 3
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