-
Bug
-
Resolution: Invalid
-
Minor
-
None
-
None
-
This server is running CraftBukkit version git-Spigot-766dab2-e2bbf62 (MC: 1.14) (Implementing API version 1.14-R0.1-SNAPSHOT)
-
Yes
When setting the villager profession, the new profession is applied for a tick or so, and then resets back to the default profession.
For example:
Entity entity = location.getWorld().spawnEntity(location, EntityType.VILLAGER); Villager villager = (Villager) entity; System.out.println("Spawned Villager. Current Profession: " + villager.getProfession().name()); villager.setProfession(Profession.BUTCHER); System.out.println("Modified Villager. Current Profession: " + villager.getProfession().name()); final Villager villagerFinal = villager; getServer().getScheduler().scheduleSyncDelayedTask(instance, new Runnable() { @Override public void run() { try { System.out.println("1 Second Wait. Current Profession: " + villagerFinal.getProfession().name()); } catch (Exception e) { e.printStackTrace(); } } }, 20);
Console Output:
[23:23:14] [Server thread/INFO]: Spawned Villager. Current Profession: NONE
[23:23:14] [Server thread/INFO]: Modified Villager. Current Profession: BUTCHER
[23:23:15] [Server thread/INFO]: 1 Second Wait. Current Profession: NONE
Expected Output: (CraftBukkit version git-Spigot-e5e5c7c-c24abab (MC: 1.13.2) (Implementing API version 1.13.2-R0.1-SNAPSHOT))
[23:30:14 INFO]: Spawned Villager. Current Profession: LIBRARIAN
[23:30:14 INFO]: Modified Villager. Current Profession: BUTCHER
[23:30:15 INFO]: 1 Second Wait. Current Profession: BUTCHER
- is duplicated by
-
SPIGOT-7421 spawn a villager and setProfession, Profession will be reset to NONE next tick
- Resolved
- relates to
-
SPIGOT-4834 Add way to get/set Villager levels
- Resolved