[SPIGOT-4776] Please add an option to lock / unlock villager careers/professions Created: 26/Apr/19 Updated: 27/May/19 Resolved: 27/May/19 |
|
| Status: | Resolved |
| Project: | Spigot |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Minor |
| Reporter: | Shane Martin | Assignee: | Unassigned |
| Resolution: | Invalid | Votes: | 1 |
| Labels: | 1.14, professions, trading, villager | ||
| Version: | This server is running CraftBukkit version git-Spigot-47463c2-6de3aa1 (MC: 1.14) (Implementing API version 1.14-R0.1-SNAPSHOT) |
| Guidelines Read: | Yes |
| Description |
|
Currently villagers can change professions until traded with, could we please have a boolean value that can be checked in say the Merchant object?
Example: A unemployed villager encounters a lectern, he becomes a librarian. If that villager trades with a player he becomes a librarian permanently unless he dies. However; if the villager never trades with a player and the lectern is destroyed he reverts back to a normal villager, until he encounters a new workstation.
Suggest adding a flag to the Merchant to lock in their profession which would prevent them from reverting, or if a Merchant IS locked in, clearing the flag would allow them to revert and change jobs. This would also allow plugins to reset the villagers path without destroying the entity and spawning a new one (once it's locked in). |
| Comments |
| Comment by md_5 [ 27/May/19 ] |
|
Just set their experience to > 0. |
| Comment by i509vcb [ 17/May/19 ] |
|
Well then a VillagerWorkBlockDestoryEvent could have an option to cancel profession change. |
| Comment by Shane Martin [ 26/Apr/19 ] |
|
The event would be nice as well; however once a player trades with the villager that event would never fire again as they’re unable to change professions naturally. One could set their profession null I suppose but that still leaves no way to tell if the villagers profession is locked in or not.
|
| Comment by Black Hole [ 26/Apr/19 ] |
|
More appropriate would be a cancellable VillagerChangeCarrierEvent, so plugins can decide what is best for their use case. |