ShopChest Integration/Hooks

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

ShaneBee

Supporter +
Addon Developer
Sep 7, 2017
2,248
241
73
Vancouver, Canada
I use this lovely plugin on my server called "ShopChest"
Similar to chest shop, without the need of signs, just commands, plus it puts this handy hologram on top.
I would love if there could be some integration into Skript for this.

I know some of you out there already have some addons that hook into other plugins.... If you would like to add this I would be super appreciative.

Here is the plugin on SPIGOT and GITHUB
Also the dev has posted their JAVADOCS for the api
I know NOTHING about maven and that jazz, but on their spigot page they said
"ShopChest has a maven repository. To add it to your project, insert the following code in the pom.xml:"
code_language.skript:
<repositories>
    <repository>
        <id>epiceric-repo</id>
        <url>https://epicericee.github.io/ShopChest/maven/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>de.epiceric</groupId>
        <artifactId>ShopChest</artifactId>
        <version>1.12</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

Thanks for reading :emoji_slight_smile:
[doublepost=1524081429,1524027235][/doublepost]@Donut Im going to tag you in this, maybe you could add this to SkUniversal if its not too much trouble?
I really need to learn java so I can do this myself :emoji_wink:
 
probably, idk how soon i can get to it but it looks like it has a pretty comprehensive api.
 
I did my homework for ya :emoji_wink:
If you do, I hope that info helps, im not entirely sure how you guys write this stuff, but you do a great job and you've been super helpful to me in the past, hence why i tagged ya
 
YEESH you are amazing.... Thanks a ton for that.
I dont see anything missing, but i just scrolled quick like, the stuff I need seems to be there...
I will notify you later if I feel anything is missing but I doubt it... it looks good :emoji_slight_smile:
[doublepost=1524339438,1524266899][/doublepost]Hey @Donut Ok so im working with this now, everything seems to be great... the only thing i see missing, and if possible to add would be the quantity of a shop.
For example, im writing a skript so when my players log on, they can see who bought what from their shop whilst they were offline.
So if possible could you add an expression for the quantity that was purchased during the event?
Thanks
 
you can get the amount from the itemstack returned in the product expression
code_language.skript:
on shop transaction:
    broadcast "%item amount of the product of the shop with id event-number%"
 
oh perfect thank you :emoji_slight_smile:
[doublepost=1524343196,1524341250][/doublepost]Okay so donut here is the ONLY issue i have with this. PS that works BUT....
lets say a shop has 32 items in it. If i click to buy it will return 32... but if i SNEAK click, it will still return 32 but I buy a whole stack.
I wrote in my skript to just get the Max stack size of said item, so that works amazing..... but i ran into another issue.
Lets say a shop is set up with 32 items. And I sneak click to buy a stack .... it will return 64 (that works) BUT... if said shop only has, lets say 45 items left in it, i will buy 45, but the return will still show 64.. ITS really NOT the end of the world, as a FEW numbers may be off, so I dont TOTALLY care, but that is just the hurtle where im at at the moment
 
code_language.skript:
on shop transaction:
    set {_original} to amount of product of shop with id event-number in player's inventory
    wait 1 tick
    set {_new} to amount of product of shop with id event-number in player's inventory
    set {_amount} to abs({_original} - {_new})
    broadcast "%{_amount}%"
 
code_language.skript:
on shop transaction:
    set {_original} to amount of product of shop with id event-number in player's inventory
    wait 1 tick
    set {_new} to amount of product of shop with id event-number in player's inventory
    set {_amount} to abs({_original} - {_new})
    broadcast "%{_amount}%"
OOOO so smart, thanks