Skip to content

feat: expose updateDemand and restock on Villager#12608

Merged
Warriorrrr merged 4 commits into
PaperMC:mainfrom
mja00:feat/more-villager-api
Jun 7, 2025
Merged

feat: expose updateDemand and restock on Villager#12608
Warriorrrr merged 4 commits into
PaperMC:mainfrom
mja00:feat/more-villager-api

Conversation

@mja00
Copy link
Copy Markdown
Contributor

@mja00 mja00 commented May 31, 2025

These functions are super helpful when creating a plugin to disable the AI of the Villager as they're needed to ensure stock and demand are still calculated like Vanilla.

Restock could always be done manually through the API but demand wasn't possible before this. Tested it with my lobotomizing plugin and it works :)

First time doing an API PR so let me know if it's wrong lol

Comment thread paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java Outdated
Comment thread paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java Outdated
Copy link
Copy Markdown
Member

@electronicboy electronicboy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra import needs yeeting but, not going to not-approve on something somebody can clean up

@github-project-automation github-project-automation Bot moved this from Awaiting review to Awaiting final testing in Paper PR Queue May 31, 2025
Copy link
Copy Markdown
Contributor

@lynxplay lynxplay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might benefit from some minecraft.wiki curveballs, like https://minecraft.wiki/w/Villager#Supply_and_demand.

updateDemand specifically. Or maybe a bit of an "intro" as to what demands are.

Comment thread paper-api/src/main/java/org/bukkit/entity/Villager.java
@mja00
Copy link
Copy Markdown
Contributor Author

mja00 commented May 31, 2025

Yeah, lemme make the docs a bit more clearer.

@DereC4
Copy link
Copy Markdown

DereC4 commented May 31, 2025

that was fast 👍

@Warriorrrr Warriorrrr merged commit 3527ccd into PaperMC:main Jun 7, 2025
3 checks passed
@github-project-automation github-project-automation Bot moved this from Awaiting final testing to Merged in Paper PR Queue Jun 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

8 participants