Is it possible to make a villager incapable of reusing or adding trades? [duplicate]
Using the Offers:{Recipes:...
tag, you're able to /summon
a villager with custom trades, and limits on those trades.
Problem is, once you start trading with that villager, he starts adding new trades, or reopening trades that previously ran out. Is there any way to prevent this?
That is to say, if my villager has exactly one trade with one use, for instance, can I prevent him from opening new, non-custom trades - or worse, reopening the custom one that should have had just one use?
I'd prefer to keep him around once his trades run out, and simply be unable to trade with him, but if it comes to /kill
ing all villagers that don't have active trades, so be it.
New trades unlocking can be prevented by setting the CareerLevel
of the villager to a high number (like 100).
Limiting the trade to X
times without it being able to "refesh" (refreshing will also increase the maxUses) is done by setting the "maxUses" to its maximum value and "uses" to X
below.
An example:
/summon villager ~ ~1 ~ {Career:1,CareerLevel:100,Offers:{Recipes:[{uses:2147483645,maxUses:2147483647,buy:{id:stone,Count:1},sell:{id:stone,Count:1}},{uses:2147483645,maxUses:2147483647,buy:{id:stone,Count:1},sell:{id:stone,Count:1}}]}}
Since maxUses
is set to its maximum, if a refresh is triggered (which will try to increase the maxUses
) it will overflow to negatives and lock the trade.In the example, the trade can only be used 2 times (since uses
is maxUses
-2).