serversigns / ServerSigns

ServerSigns (SVS) provides the ability to bind player-dispatched and server-disptached commands, messages and actions to signs and every other block in Minecraft.
https://dev.bukkit.org/projects/serversigns
GNU Affero General Public License v3.0
13 stars 13 forks source link

Option to disallow sign use / purchase if inventory is full. #23

Open mibby opened 4 years ago

EpiCanard commented 4 years ago

Hello :)

Maybe a little more information will be helpful.

What is your goal ? Why do you want this feature ? Because a sign will add an item to the player inventory ? Should the hand be empty or can it be at least one empty space anywhere in the inventory ?

Thanks for your suggestion EpiCanard

mibby commented 4 years ago

I use ServerSigns in a couple of places that have a cost to them. Upon interacting with them, it runs commands that spawn in items to give players rewards. If a player has a full inventory, they are still charged for the sign interaction and the command still runs despite not being able to be given the item.

To combat this, I would like an option to deny sign interaction if their inventory is completely full.

EpiCanard commented 4 years ago

Ok, I see two ways to do it :

The operator may be the best solution if you want to do action before or after this inventory check

leasoncre commented 4 years ago

PAPI?: https://github.com/PlaceholderAPI/PlaceholderAPI/wiki/Placeholders#player %player_has_empty_slot% %player_empty_slots%

EpiCanard commented 4 years ago

@leasoncre You are right ! @mibby SVS supports PlaceholderAPI so you can use it with your sign :

/svs add <if> placeholder:%player_has_empty_slot%=true
mibby commented 4 years ago

@EpiCanard That would not prevent charging though. That is for adding a conditional check for commands to run. ServerSigns charges on interact before it runs the commands / conditional checks. I would like to be able to have a check that prevents interaction / charging if they don't have any room in their inventory.

leasoncre commented 4 years ago

run the eco take command, instead of using the svs cost

mibby commented 4 years ago

Then there is no deny message when players interact with the sign if they don't have enough money and the eco take command would allow them to go negative or 0 rather than requiring the full balance, unless there was another placeholder conditional check to only run if they have over that exact amount of money.

This becomes messy and more complex than just a simple sign config option check to deny interacting with signs if their inventory is full.

EpiCanard commented 4 years ago

I will see to add this feature inside sign flags

I don't have much free time, it can take time :)

aparry91 commented 2 years ago

run the eco take command, instead of using the svs cost

not ideal but could you not then build out your own if statement for balance check aswell.. I think I did this prior to learning about serversigns integrated payment requirement. Maybe this is the exception for now