Custom GUIs

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

JNJPIG

New Member
Feb 19, 2024
6
0
1
24
I am trying to make a /recipes command that shows all the custom recipes from my server and I have the issue where a player can put items from their inventory into the gui and if the user already has an item from the gui in their inventory they can double click it to grab the item from the gui and stack it with theres. Does anyone know how to help with this?


Here is my skript so far:

command /recipes:
trigger:
open chest with 3 row named "Recipes" to sender
wait a tick
format slot 0 of sender with gravel named "Gravel" to run [make sender execute command "gravelrecipe"]
format slot 1 of sender with oak sapling named "Oak Sapling" to run [make sender execute command "oaksaplingrecipe"]
format slot 2 of sender with string named "String" to run [make sender execute command "stringrecipe"]
format slot 3 of sender with bundle named "Bundle" to run [make sender execute command "bundlerecipe"]
format slot 4 of sender with cobbled deepslate named "Cobbled Deepslate" to run [make sender execute command "cobbleddeepslaterecipe"]
format slot 5 of sender with potion of luck named "Potion Of Luck" to run [make sender execute command "potionofluckrecipe"]
format slot 6 of sender with jukebox named "Jukebox" to run [make sender execute command "jukeboxrecipe"]
 
I am trying to make a /recipes command that shows all the custom recipes from my server and I have the issue where a player can put items from their inventory into the gui and if the user already has an item from the gui in their inventory they can double click it to grab the item from the gui and stack it with theres. Does anyone know how to help with this?


Here is my skript so far:

command /recipes:
trigger:
open chest with 3 row named "Recipes" to sender
wait a tick
format slot 0 of sender with gravel named "Gravel" to run [make sender execute command "gravelrecipe"]
format slot 1 of sender with oak sapling named "Oak Sapling" to run [make sender execute command "oaksaplingrecipe"]
format slot 2 of sender with string named "String" to run [make sender execute command "stringrecipe"]
format slot 3 of sender with bundle named "Bundle" to run [make sender execute command "bundlerecipe"]
format slot 4 of sender with cobbled deepslate named "Cobbled Deepslate" to run [make sender execute command "cobbleddeepslaterecipe"]
format slot 5 of sender with potion of luck named "Potion Of Luck" to run [make sender execute command "potionofluckrecipe"]
format slot 6 of sender with jukebox named "Jukebox" to run [make sender execute command "jukeboxrecipe"]
I'm on a mobile device but you can just add this.
Code:
on inventory click:
    if name of event-inventory is "Recipes":
        cancel event
 
Anywhere in the file works fine, events can be called from anywhere. Do note that this is an event, and thus should not be within the command, so for example, you can do this:
Python:
command /recipes:
    trigger:
        open chest with 3 row named "Recipes" to sender
        wait a tick
        format slot 0 of sender with gravel named "Gravel" to run [make sender execute command "gravelrecipe"]
        format slot 1 of sender with oak sapling named "Oak Sapling" to run [make sender execute command "oaksaplingrecipe"]
        format slot 2 of sender with string named "String" to run [make sender execute command "stringrecipe"]
        format slot 3 of sender with bundle named "Bundle" to run [make sender execute command "bundlerecipe"]
        format slot 4 of sender with cobbled deepslate named "Cobbled Deepslate" to run [make sender execute command "cobbleddeepslaterecipe"]
        format slot 5 of sender with potion of luck named "Potion Of Luck" to run [make sender execute command "potionofluckrecipe"]
        format slot 6 of sender with jukebox named "Jukebox" to run [make sender execute command "jukeboxrecipe"]

on inventory click:
    name of event-inventory contains "Recipes":
        cancel event