Topic category: Help with Minecraft modding (Java Edition)
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
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