Entity with Randomized Armor

Started by Timelord_10 on

Topic category: Help with Minecraft modding (Java Edition)

Active 3 years ago
Joined Mar 2017
Points:
788

User statistics:

  • Modifications: 4
  • Forum topics: 7
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 28
Entity with Randomized Armor

I am currently working on a mod that would require a mob to have randomized armor. Originally, I planned to use the "set ___ in armor slot ___ of event/target entity" procedure block, in combination with a random variable and the "On Entity Initial Spawn" trigger, to accomplish this. Unfortunately, the aforementioned procedure block only works for player entities. The only solution I've found by looking through other similar -- albeit a little outdated -- forums was to "create a copy of the entity for every combination of the armor  that I would need, then just lower the spawn rates". This is not actually possible -- from a practical stand point -- as I would require around 81 different variants of this single mob Does anyone know of another way that would allow me to have a mob with randomized armors?

 

 

Any and all help would be appreciated!

(also: if I'm just being a total moron and their is some obvious solution that I missed, feel free to point it out)

(also also: I only know very basic java. If this requires custom coding, you may need to walk me through it)

Active 4 months ago
Joined Jul 2020
Points:
689

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 130
Do everything shown and you…
Thu, 08/13/2020 - 03:53

Do everything shown and you should be good.

For armor slot info:

Head slot:5

Chest slot:4

Legs slot:3

Feet slot:2

There are other ways to select the armor piece that will be Worn but this is the simplest.

EntitySetArmor

Active 4 months ago
Joined Jul 2020
Points:
689

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 130
Keep in mind the reason for…
Thu, 08/13/2020 - 03:57

Keep in mind the reason for the while loop is because if you don't put it in the procedure it will set it to the armor you wanted but there is a chance that the game by vanilla will set it to something else after.

Basically the game can overwrite your choice in this situation without the while loop.

Active 1 month ago
Joined Jan 2019
Points:
891

User statistics:

  • Modifications: 6
  • Forum topics: 12
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 203
*Armor Slots: 0f 1l 2c 3h
Sat, 08/15/2020 - 22:37

*Armor Slots: 0f 1l 2c 3h

Active 4 years ago
Joined Aug 2020
Points:
645

User statistics:

  • Modifications: 0
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 9
i tried to do this, but i…
Tue, 09/01/2020 - 00:15

i tried to do this, but i can't put "Event/target entity" in "Get a Copy of Item slot _ of _ if it has inventory"

How do you put it there?

 

Active 4 years ago
Joined Aug 2020
Points:
645

User statistics:

  • Modifications: 0
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 9
Okay nvm, i fixed it :)  
Mon, 09/21/2020 - 00:02

Okay nvm, i fixed it :)

 

Active 11 months ago
Joined Apr 2020
Points:
725

User statistics:

  • Modifications: 0
  • Forum topics: 17
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 26
how'd you fix it? : )
Tue, 04/11/2023 - 01:26

how'd you fix it? : )