0

How can I summon an item that will despawn after a specified number of minutes, as opposed to the default 5?

I tried

/summon Item ~ ~1 ~ {Item:{id:minecraft:planks,Count:1,Age:1}}

but the item always despawns after 5 min no matter what number I specify for the Age.

1 Answer 1

2

You can set the Age to a negative number to make it last longer. The age will always increase once per tick until it gets to 6000, at which point the item will despawn. The Age is a tag of the item entity itself, not of the contained item, so it should be outside the Item:{} tag:

/summon Item ~ ~-2 ~ {Item:{id:minecraft:planks,Count:1},Age:-5000}

There is also a special case for Age:-32768, the lowest possible value for a short, for which the item will never despawn. E.G:

/summon Item ~ ~-2 ~ {Item:{id:minecraft:planks,Count:1},Age:-32768}
1
  • perfect! Thanks. Now I can adjust the time on my chest regeneration.
    – ScottUSA
    Jun 6, 2016 at 18:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .