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

Feature request regarding selling commands #105

Open
NoobcoreNetwork opened this issue May 18, 2021 · 3 comments
Open

Feature request regarding selling commands #105

NoobcoreNetwork opened this issue May 18, 2021 · 3 comments

Comments

@NoobcoreNetwork
Copy link

NoobcoreNetwork commented May 18, 2021

So I'm attempting to use bossshop to sell 'stat trackers' to players using this plugin https://www.spigotmc.org/resources/%E2%9A%A1-1-16-1-16-5-stattrackers-%E2%9C%A8-track-stats-on-your-items-%E2%9C%85-eula-friendly-perk.88247/

My config looks like this for BSP

1:
RewardType: item
PriceType: money
Price: 100
RewardType: command
Reward:
- stgive %player% damage_dealt
Message: '&aYou''ve purchased a damage dealt tracker for $100'
InventoryLocation: 1
ExtraPermission: ''

The issue I have is, It lets you purchase even if your inventory is full, Now, I know why it does this, because BSP sees it as a command, not an item, But is it possible to add something that STOPS the sale if the inventory is full, Even if it's a command reward. aka PreventFullInv: True

Thankyou :)
@Blackixx
Copy link
Owner

Hm, so I do have a possible solution in mind, but it requires some effort from your side.
What you could do:

  1. Add a condition to your shopitem which checks that the inventory of your player is not full
  2. Add a second shopitem which looks the same to the same GUI slot but do not give it a condition and assign the price/reward/message to it that you want players to get when their inventory is full
  3. Done

The shopitem with the condition will be hidden if the condition is not met (e.g. inventory full). In that case, the second item is shown.
Conditions documentation: https://www.spigotmc.org/wiki/bossshoppro-conditions/

Now the tricky part: BSP does NOT come with a "inventory is full" condition. However, it DOES support placeholder conditions (also explained on the page linked above). You just need to find some PlaceholderAPI extension, which provides an "inventory is full" placeholder or "count of filled inventory slots" or "first index of empty inventory slot" or something of that kind. I am sure there are placeholders of that kind available. The CheckItem extension might be suitable (https://github.com/PlaceholderAPI/PlaceholderAPI/wiki/Placeholders).

@Blackixx Blackixx reopened this May 26, 2021
@Blackixx
Copy link
Owner

Blackixx commented May 26, 2021

Reopening the issue:
a "IsInventoryFull" condition should be added to the list of BSP conditions. I will, probably, not work on it within the foreseeable future, though.

@NoobcoreNetwork
Copy link
Author

Still very much in need of this if possible <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants