Solved Inventory crafting slot

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

Bilbo

Member
Jan 26, 2017
27
0
0
29
Good evening Everybody.

I am so sorry that i am not using the correct formatting for the question part, but what i wanted to know if it is possible to format the crafting slots on player's E inventory.

I know its possible to do something if a player clicks on one of the 4 slots, but is it possible to set an item there not to be stealable?

Thank you.
 
The crafting grid is the player's current inventory when the player's inventory is opened. Just format/set the slots of the player's current inventory when the player's inventory is opened.

EDIT:
A note, the inventory open event isn't triggered when the player's inventory is opened so you have to use packets for it:
code_language.skript:
on packet event play_client_client_command:
    if "ClientCommand" penum 0 of event-packet is "OPEN_INVENTORY_ACHIEVEMENT":
        #do stuff

#Skellett way:
on packet:
    if event-string is "PacketPlayInClientCommand":
        if "%packet field ""a""%"  is "OPEN_INVENTORY_ACHIEVEMENT":
            #do stuff
 
Last edited by a moderator:
The crafting grid is the player's current inventory when the player's inventory is opened. Just format/set the slots of the player's current inventory when the player's inventory is opened.

EDIT:
A note, the inventory open event isn't triggered when the player's inventory is opened so you have to use packets for it:
code_language.skript:
on packet event play_client_client_command:
    if "ClientCommand" penum 0 of event-packet is "OPEN_INVENTORY_ACHIEVEMENT":
        #do stuff

#Skellett way:
on packet:
    if event-string is "PacketPlayInClientCommand":
        if "%packet field ""a""%"  is "OPEN_INVENTORY_ACHIEVEMENT":
            #do stuff

As far as i understand, what this does, is when a player opens hes inventory - # do stuff, am i right?
 
But is it possible to set the slots to something on inventory opening?

Update: i found out it is under "CRAFTING" section of player's inventory, but nor format nor set works for it
[doublepost=1492332746,1492278605][/doublepost]Bump
 
But is it possible to set the slots to something on inventory opening?

Update: i found out it is under "CRAFTING" section of player's inventory, but nor format nor set works for it
[doublepost=1492332746,1492278605][/doublepost]Bump
Could you show us what have you tried?
 
Could you show us what have you tried?
I tried many ways of format - tat usually works with open chest menus, using set command, but the id sets automanically players hotbar slots, i cant figure out how to define setting the "CRAFTING" slot 1, not the usualy hotbar slot 1
 
I tried many ways of format - tat usually works with open chest menus, using set command, but the id sets automanically players hotbar slots, i cant figure out how to define setting the "CRAFTING" slot 1, not the usualy hotbar slot 1
Did you do this?
code_language.skript:
set slot 0 of player's current inventory to some item
Because the crafting slots aren't in the player's inventory but the current one.
 
Status
Not open for further replies.