Very kind to reply so fast. I have tested it and it looks like that problem has been solved. I do have found more “problems”.
For example: i set a sell shop for red wool and i define the price to 1 let say “dollar”. I also put 1 redwool inside the chest, because i want that people can sell 1 redwool and get 1 dollar. Here comes the trouble now. It littery looks for 1 piece of redwool. If the player has a stack of 64 or just anything more then 1 you see a message that you don’t have that item to sell. It cannot substract 1 item from the stack.
For the buy shop the same thing, you need to put stacks of 1 inside or the message "shop is empty " appear.
While the shop holds multiple stacks of the respective item, it doesn’t find it because the stack needs to be 1.
I hope you understand what i mean. I’m not native to english, so sometimes it’s hard to explain things.
Anyways, you need to create a system that checks for the stack and substract the quantity needed and return the rest.
So if i want to make a shop where players can buy 5 greenwool for a price of 2 dollar. I don’t want to fill my chest with stacks of 5, but instead fill it to max. The shop has to handle the calculation.
I have some suggestion too. They aren’t that important, but maybe this is something you want to do.
Receive a message whenever you buy/sell something to both players.
For example if i buy something from a shop that is owned by Sam, let’s say 5 obsidian for 1 dollar. Then i should see in chat (and only i should see it):
“You bought 5 Obsidian for 1 dollar from Sam’s shop”
And when Sam is online he should see:
“Winnetrie bought 5 Obsidian for 1 dollar from your shop”
The owner of the shop can now buy/sell in his own shop. This is nice to test things out, but can be possebly abused soon or later (i don’t know how yet, but it doesn’t make sense anyway). You might wanne check if the owner is buying or selling and deny it.
You might wanne create a list of transactions that happend. People who have been offline for a day or 2 (or just some hours) and log back in will find out their balance has changed (wether pos or neg) , but they will wonder where or why or what. So maybe a command something like this /carrotshop history. The you get a list in chat of what happend. There should also be a command to delete the list. You can also limit that list to ex. 100 lines or something.
If a players shop is empty or full they should receive a message in chat (only if they are online ofc)