[SPIGOT-5883] Piglin Bartering APIs Created: 29/Jun/20  Updated: 02/Jun/21  Resolved: 02/Jun/21

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Minor
Reporter: Jason Penilla Assignee: Unassigned
Resolution: Fixed Votes: 5
Labels: api, entity, event, feature

Version: Spigot-API-1.16.1 / Spigot Server 1.16.1
Guidelines Read: Yes

 Description   

It would be useful if the new Piglin Bartering mechanic had some APIs available.

For example:

  • A PiglinBarterEvent which would expose a payment and result ItemStack, and fire after picking up the payment but before the result is dropped so that the event could modify the result.
  • Methods in the Piglin Interface to get or set a list of bartering recipes, similar to the getRecipes() and setRecipes(ArrayList<MerchantRecipe>) in the Merchant Interface. This could allow for picking up of items set as recipe payments.


 Comments   
Comment by Oliver Dunk [ 30/Jan/21 ]

Just in case anyone else comes looking, I was considering working on this but found some open PRs:

 

https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/pull-requests/522/overview

https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/703/overview

 

I left a comment on the latter one to see if it's still being worked on.

Comment by TheCreeperCow [ 04/Jul/20 ]

Ok so after reviewing the piglin implementation of the API i have concluded the following.

  1. The payment is set in stone and cannot be changed in anyway. Found a very funky workaround for it
  2. The result can only be set during the exchange and cannot be changed in advanced making only a bartering event possible but no bartering related api to the piglin class
Comment by TheCreeperCow [ 03/Jul/20 ]

I approve

Generated at Fri Mar 14 15:12:57 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.