Flickering item in GUI?

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

Status
Not open for further replies.

Stefqnutz

Active Member
Sep 23, 2019
67
1
8
19
Hello, I am trying to make custom crafting in a custom GUI, but whenever I seem to put in the recipe the final result seems to flicker?


Code:
Code:
on right click:
    if event-block is piston:
        cancel event
        open chest with 3 rows named "Farm Crafter" to player
        wait 4.5 tick         
        set slot 0 of player's current inventory  to stained glass pane named " "
        set slot 1 of player's current inventory  to stained glass pane named " "
        set slot 2 of player's current inventory  to stained glass pane named " "
        #format slot 3 of player with white stained glass pane named " " to be unstealable
        #format slot 5 of player with white stained glass pane named " " to be unstealable
        set slot 6 of player's current inventory  to stained glass pane named " "
        set slot 7 of player's current inventory  to stained glass pane named " "
        set slot 8 of player's current inventory  to stained glass pane named " "
        set slot 9 of player's current inventory  to stained glass pane named " "
        set slot 10 of player's current inventory  to stained glass pane named " "
        set slot 11 of player's current inventory  to stained glass pane named " "
        #format slot 12 of player with white stained glass pane named " " to be unstealable
        #format slot 14 of player with white stained glass pane named " " to be unstealable
        set slot 15 of player's current inventory  to stained glass pane named " "
        #format slot 16 of player with white stained glass pane named " " to be unstealable
        set slot 17 of player's current inventory  to stained glass pane named " "
        set slot 18 of player's current inventory  to stained glass pane named " "
        set slot 19 of player's current inventory  to stained glass pane named " "
        set slot 20 of player's current inventory  to stained glass pane named " "
        #format slot 21 of player with white stained glass pane named " " to be unstealable
        #format slot 22 of player with white stained glass pane named " " to be unstealable
        #format slot 23 of player with white stained glass pane named " " to be unstealable
        set slot 24 of player's current inventory to stained glass pane named " "
        set slot 25 of player's current inventory  to stained glass pane named " "
        set slot 26 of player's current inventory  to stained glass pane named " "

on inventory click:
    if inventory name of player's current inventory is "Farm Crafter":
        if clicked slot is 0:
            cancel event
        if clicked slot is 1:
            cancel event     
        if clicked slot is 2:
            cancel event     
        if clicked slot is 6:
            cancel event     
        if clicked slot is 7:
            cancel event     
        if clicked slot is 8:
            cancel event     
        if clicked slot is 9:
            cancel event     
        if clicked slot is 10:
            cancel event     
        if clicked slot is 11:
            cancel event     
        if clicked slot is 15:
            cancel event     
        if clicked slot is 17:
            cancel event                                                             
        if clicked slot is 18:
            cancel event
        if clicked slot is 19:
            cancel event
        if clicked slot is 20:
            cancel event
        if clicked slot is 24:
            cancel event
        if clicked slot is 25:
            cancel event
        if clicked slot is 26:
            cancel event

every 4.5 tick:
    loop all players:
        loop all items in loop-player's inventory:
            if inventory name of loop-player's current inventory is "Farm Crafter":
                if slot 3 of loop-player's current inventory is 16 wheat:
                    if slot 4 of loop-player's current inventory is 16 wheat:
                        if slot 5 of loop-player's current inventory is 16 wheat:
                            if slot 12 of loop-player's current inventory is 16 wheat:
                                if slot 13 of loop-player's current inventory is 16 wheat:
                                    if slot 14 of loop-player's current inventory is 16 wheat:
                                        if slot 21 of loop-player's current inventory is 16 wheat:
                                            if slot 22 of loop-player's current inventory is 16 wheat:
                                                if slot 23 of loop-player's current inventory is 16 wheat:
                                            #        wait 4.5 tick
                                                    set slot 16 of loop-player's current inventory to {@enchantedwheat}


You can check the code for yourself and you can see that the item that the crafting menu is supposed to give you just flickers a lot. (By flickering I mean that it appears and dissapears)
And whenever I take out 16 wheat of one of the slots, the flickering dissapears.
Any help? Thanks in advance.
[doublepost=1631022983,1630965409][/doublepost]bump
 
This is because the crafting menu will constantly update to see if you put in a actual Crafting Recipe.
[doublepost=1631023456,1631023426][/doublepost]I suggest using dispenser or dropper instead.
 
Hello, I am trying to make custom crafting in a custom GUI, but whenever I seem to put in the recipe the final result seems to flicker?


Code:
Code:
on right click:
    if event-block is piston:
        cancel event
        open chest with 3 rows named "Farm Crafter" to player
        wait 4.5 tick        
        set slot 0 of player's current inventory  to stained glass pane named " "
        set slot 1 of player's current inventory  to stained glass pane named " "
        set slot 2 of player's current inventory  to stained glass pane named " "
        #format slot 3 of player with white stained glass pane named " " to be unstealable
        #format slot 5 of player with white stained glass pane named " " to be unstealable
        set slot 6 of player's current inventory  to stained glass pane named " "
        set slot 7 of player's current inventory  to stained glass pane named " "
        set slot 8 of player's current inventory  to stained glass pane named " "
        set slot 9 of player's current inventory  to stained glass pane named " "
        set slot 10 of player's current inventory  to stained glass pane named " "
        set slot 11 of player's current inventory  to stained glass pane named " "
        #format slot 12 of player with white stained glass pane named " " to be unstealable
        #format slot 14 of player with white stained glass pane named " " to be unstealable
        set slot 15 of player's current inventory  to stained glass pane named " "
        #format slot 16 of player with white stained glass pane named " " to be unstealable
        set slot 17 of player's current inventory  to stained glass pane named " "
        set slot 18 of player's current inventory  to stained glass pane named " "
        set slot 19 of player's current inventory  to stained glass pane named " "
        set slot 20 of player's current inventory  to stained glass pane named " "
        #format slot 21 of player with white stained glass pane named " " to be unstealable
        #format slot 22 of player with white stained glass pane named " " to be unstealable
        #format slot 23 of player with white stained glass pane named " " to be unstealable
        set slot 24 of player's current inventory to stained glass pane named " "
        set slot 25 of player's current inventory  to stained glass pane named " "
        set slot 26 of player's current inventory  to stained glass pane named " "

on inventory click:
    if inventory name of player's current inventory is "Farm Crafter":
        if clicked slot is 0:
            cancel event
        if clicked slot is 1:
            cancel event    
        if clicked slot is 2:
            cancel event    
        if clicked slot is 6:
            cancel event    
        if clicked slot is 7:
            cancel event    
        if clicked slot is 8:
            cancel event    
        if clicked slot is 9:
            cancel event    
        if clicked slot is 10:
            cancel event    
        if clicked slot is 11:
            cancel event    
        if clicked slot is 15:
            cancel event    
        if clicked slot is 17:
            cancel event                                                            
        if clicked slot is 18:
            cancel event
        if clicked slot is 19:
            cancel event
        if clicked slot is 20:
            cancel event
        if clicked slot is 24:
            cancel event
        if clicked slot is 25:
            cancel event
        if clicked slot is 26:
            cancel event

every 4.5 tick:
    loop all players:
        loop all items in loop-player's inventory:
            if inventory name of loop-player's current inventory is "Farm Crafter":
                if slot 3 of loop-player's current inventory is 16 wheat:
                    if slot 4 of loop-player's current inventory is 16 wheat:
                        if slot 5 of loop-player's current inventory is 16 wheat:
                            if slot 12 of loop-player's current inventory is 16 wheat:
                                if slot 13 of loop-player's current inventory is 16 wheat:
                                    if slot 14 of loop-player's current inventory is 16 wheat:
                                        if slot 21 of loop-player's current inventory is 16 wheat:
                                            if slot 22 of loop-player's current inventory is 16 wheat:
                                                if slot 23 of loop-player's current inventory is 16 wheat:
                                            #        wait 4.5 tick
                                                    set slot 16 of loop-player's current inventory to {@enchantedwheat}


You can check the code for yourself and you can see that the item that the crafting menu is supposed to give you just flickers a lot. (By flickering I mean that it appears and dissapears)
And whenever I take out 16 wheat of one of the slots, the flickering dissapears.
Any help? Thanks in advance.
[doublepost=1631022983,1630965409][/doublepost]bump

I wouldn't try to make that unless you're really competent in your skripting abilities. Sorry but you're just not, I would recommend going back to this at a time when you know more skripting.
 
I wouldn't try to make that unless you're really competent in your skripting abilities. Sorry but you're just not, I would recommend going back to this at a time when you know more skripting.

Yeah, I think im not competent when I made a similar copy to Hypixel SkyBlock and now Im working on another one, sorry but this reply dosen't make sense unless you genuiently know someones skripting abilities.
 
Yeah, I think im not competent when I made a similar copy to Hypixel SkyBlock and now Im working on another one, sorry but this reply dosen't make sense unless you genuiently know someones skripting abilities.
Do I really have to lay it down on you....
List of problems:
  • You're using SkQuery to open a chest.
  • Wait 4.5 tick?
  • You're checking 26 different slots, worst of all you're not even using Skript Syntax to get the clicked slot, it's index of event-slot, clicked slot is some skellett bs.
  • Every 4.5 tick, loop all players, any competent skripter wouldn't do that.
Your Skripting capabilities are horrible. I don't mean to be rude.
 
Using SKQuery because the server is on 1.8.
Just a delay?
Okay, thats how I've been doing it since I started skripting and I had 0 issues so far.
Excuse me? Im doing this on a localhost server, couldn't care less about optimization when it comes to loops, etc
 
Using SKQuery because the server is on 1.8.
Just a delay?
Okay, thats how I've been doing it since I started skripting and I had 0 issues so far.
Excuse me? Im doing this on a localhost server, couldn't care less about optimization when it comes to loops, etc

You don't need SkQuery for 1.8?
Matocolotoe's fork takes care of stuff like that. And vanilla gui's exist.

couldn't care less about optimization when it comes to loops
........ You're obviously not very proficient. Stop the ego trip.
 
  • Like
Reactions: Frog
Would you care about efficiency when you are trying to test something?

Also as far as I knew, set slot 0 was vanilla gui's.

Edit: This is a coding forum, not twitter, stop.
 
Last edited:
Would you care about efficiency when you are trying to test something?

Also as far as I knew, set slot 0 was vanilla gui's.

Edit: This is a coding forum, not twitter, stop.

Code:
open chest with 3 rows named "Farm Crafter" to player
SkQuery
Code:
if clicked slot is 0:
Skellett
 
Status
Not open for further replies.