How can I decrease the health of an item by 1?

How can I decrease the health of an item by 1? - Books On The Table

I am making a mine craft bed-wars mini-game designed for 1v1v1v1. In your base there is an item spawner that occasionally spawns iron and gold. To limit the amount that spawns I am going to use the nbt: Health. I am going to have a clock going into a command block that decreases the heath of all gold and iron by 1. They will eventually go from 5 to 0 and DE-spawn. I have this command started but I don't know what to put next.

/execute as @e[type=minecraft:item,nbt={Item:{id:"minecraft:gold_ingot",Count:1}}] run data merge entity @s {}

I just need something to make the health decrease.






Pictures about "How can I decrease the health of an item by 1?"

How can I decrease the health of an item by 1? - Confident adult Hispanic male traveler in sunglasses and casual clothes with backpack opening can of drink while walking along pavement against blurred cars driving along street and empty crosswalk in downtown
How can I decrease the health of an item by 1? - Black Sneakers On Gray Concrete
How can I decrease the health of an item by 1? - Side view of adult Hispanic guy with dreadlocks in sunglasses and casual clothes with backpack and smart watch drinking yummy beverage from vivid yellow can while standing with eyes closed on street in downtown





23 and 1/2 hours: What is the single best thing we can do for our health?




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Ylanite Koppens, Andrea Piacquadio, Mikhail Nilov, Andrea Piacquadio