Skip to content

Adding extra Features + Bugfixes#40

Open
TheBiochemic wants to merge 10 commits into
DevOnTheRocks:masterfrom
TheBiochemic:master
Open

Adding extra Features + Bugfixes#40
TheBiochemic wants to merge 10 commits into
DevOnTheRocks:masterfrom
TheBiochemic:master

Conversation

@TheBiochemic

@TheBiochemic TheBiochemic commented May 7, 2026

Copy link
Copy Markdown

It is now possible to add an additional parameter for giving a trade entry a chance on how likely it would be to adopt the trade.
Ex:

// Merchant.addTradeChance(String, String, IItemStack, IItemstack (optional), int, float);
Merchant.addTradeChance("minecraft:farmer", "fisherman", <minecraft:emerald> * 3, <minecraft:fish>, 1, 25.0);

The chance value has to be a float between 0.0 and 100.0

…tage for how likely a villager would be able to adopt a new trade.
@TheBiochemic

TheBiochemic commented May 8, 2026

Copy link
Copy Markdown
Author

adding retrieval of Careers and Professions via Reflection.
(i have noticed, that sometimes the orders of the Careers inside the Profession objects seem to have a different order, which might mess up stuff, hence the change to get the stuff via reflection directly from Registry)
Should fix #29

@TheBiochemic TheBiochemic changed the title Adding Trade Chance Adding Trade Chance + Bugfix May 8, 2026
…eItem instead of a lambda. Added two ZenMethods: clearTrades(profession, career), removeTradeItem(profession, career, itemstack).
@TheBiochemic TheBiochemic changed the title Adding Trade Chance + Bugfix Adding extra Features + Bugfixes May 10, 2026
@TheBiochemic

Copy link
Copy Markdown
Author

With the latest change, the following features get added:
Command: /crafttweaker merchant trades or /ct merchant trades returns now a complete list with all known trade types

With new commands, you can now also remove trades (even ones added by this mod). Ex:

// Merchant.clearTrades(String, String);
Merchant.clearTrades("minecraft:farmer", "fisherman");

// Merchant.removeTradeItem(String, String, IItemStack);
Merchant.removeTradeItem("minecraft:farmer", "farmer", <minecraft:apple>);

@TheBiochemic

Copy link
Copy Markdown
Author

I will deal with the CraftTweaker Documentation, once this gets merged

@Mohron

Mohron commented May 11, 2026

Copy link
Copy Markdown
Member

Sorry I'm pretty out of the loop when it comes to Minecraft nowadays. I have set up my local dev environment again and am working on a beta release. Can you verify if these release notes seem accurate based on your contributions?


V0.7.0-BETA Change Log

New

  • Added Merchant.addTradeChance(String, String, IItemStack, IItemstack (optional), int, float); (TheBiochemic)
    • Add a trade to a profession with a variable chance to adopt the trade
  • Added Merchant.clearTrades(String, String); (TheBiochemic)
    • Remove all trades from a villager profession
  • Added Merchant.removeTradeItem(String, String, IItemStack); (TheBiochemic)
    • Remove a specific trade from a villager profession
  • Added command /crafttweaker merchant trades returns a complete list with all known trade types (TheBiochemic)

Updated

@TheBiochemic

Copy link
Copy Markdown
Author

Don't worry about it, it's also for an ancient Minecraft version by now ^^
The version bump is not necessary btw, i did already bump it from 0.5.0 to 0.6.0

Other than that it looks good!
I did play test it in my Modpack for a few days, and it seems to be good.
I will probably do one or two more PRs for adding some Mod support for removing Trades, because i have noticed, that apparently different Mods tend to implement their own trade types.

@Mohron

Mohron commented May 12, 2026

Copy link
Copy Markdown
Member

So version 0.6.0 & 0.6.1 already exist and since there are new features, 0.7.0 is appropriate.

@TheBiochemic

TheBiochemic commented May 12, 2026

Copy link
Copy Markdown
Author

Oh okay, apologies, i must've missed that then, in that case it's all fine :)
I will wait for now until this PR is done, then i will continue adding Mod Support, i hope that's okay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants