Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShopPreTransactionEvent - filter out specific items from being sold #6

Open
rayzr522 opened this issue Jul 12, 2020 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@rayzr522
Copy link

rayzr522 commented Jul 12, 2020

i've got a plugin i've developed privately for a server i work for that uses blaze rods for a custom tool item. however, our ShopGUI+ shop also lets players sell blaze rods.

i was hoping that either your API would allow me to remove specific items from the list of items to be sold (e.g. i could filter the list and remove any items with the particular NBT that the tools use), or that there would simply be some way to specify that we only want to sell items that have no lore or displayname.

i recognize that the latter is a non-API change, and that this is not the place to suggest those kinds of features, but figured i'd mention it here as a potentially far less difficult to implement change -- simply letting users specify "none" for name/lore on items or something along those lines could solve the problem by allowing us to limit sold items to those obtained from vanilla without name or lore.

@brcdev
Copy link
Member

brcdev commented Jul 12, 2020

or that there would simply be some way to specify that we only want to sell items that have no lore or displayname

There's already such option:

  1. How do you disallow selling items with name/lore different from the shop item's ones?
    Simply add a compareMeta: true setting to your shop item in the shop yaml.
    Example: http://pastebin.com/DsVWWC4h

@rayzr522
Copy link
Author

hmmm, I see. looked through the docs but didn't see it initially, thanks!

I think it would still be useful to be able to have a programmatic way of doing this tho, perhaps as I suggested by providing the list of items to sell and allowing consumers of the event to mutate it, then just use the final list to determine what to actually sell/remove from their inventory. while this use case can be handled with the createMeta: true option, others may not

@brcdev brcdev added the enhancement New feature or request label Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants