armor switching

Started by FLIPRonmcreator on

Topic category: Help with modding (Java Edition)

Last seen on 16:21, 29. Apr 2024
Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
armor switching
Wed, 04/03/2024 - 19:54 (edited)

Hello! I've been working on a mod that adds more tools, weapons and such. I have some copper armor made and wanted it to have a feature where after some time passes it oxidizes (becoming a weaker version of itself and a whole different armor set). I had done this with the tools removing them from the player's inventory and adding in the new item but I couldn't do the same for the armor. If anyone can help I'd appreciate it.  I don't need the procedure to switch the armor exactly into the slot it could just put it in the player's inventory. 

 

The current procedure for the tools are:

 if has (event/target entity) in inventory [custom item]

 do wait 12000 ticks 

                                if has (event/target entity) in inventory [custom item]

                                do remove [custom item] from (event/target entity) main inventory

                                       add [custom item] to (event/target entity) inventory

 

NOTE: I am using the fabric plugin so there may be some issues idk 

Edited by FLIPRonmcreator on Wed, 04/03/2024 - 19:54
Last seen on 16:21, 29. Apr 2024
Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I actually resolved this…
Thu, 04/04/2024 - 19:58

I actually resolved this problem

 

 

here's the procedure if anyone is curious:

 

(on [particular armor piece] tick update]

                                                                       if get item from armor slot 0  =  [custom item]

                                                                       do wait 12000 ticks

                                                                             if get item from armor slot 0  =  [custom item]

                                                                             do set [custom item] in armor slot 0 of (event/target entity)

                                                                  if get item from armor slot 1  =  [custom item]

                                                                       do wait 12000 ticks

                                                                             if get item from armor slot 1  =  [custom item]

                                                                             do set [custom item] in armor slot 1 of (event/target entity)

                                                                 if get item from armor slot 2  =  [custom item]

                                                                       do wait 12000 ticks

                                                                             if get item from armor slot 2  =  [custom item]

                                                                             do set [custom item] in armor slot 2 of (event/target entity)

                                                                      if get item from armor slot 3  =  [custom item]

                                                                       do wait 12000 ticks

                                                                             if get item from armor slot 3  =  [custom item]

                                                                             do set [custom item] in armor slot 3 of (event/target entity)

 

I did it so many times since I struggle with armor slots :P