Checking items in brewing stand

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

Very Cool Bee

New Member
May 21, 2020
7
1
0
23
Hello! How can I check the item player puts into a brewing stand?
I want to prevent people from putting fermented spider eye into a brewing stand.
Thanks :wrong:
 
Solution:
Code:
on inventory click:
    if event-itemtype is fermented spider eye:
        if inventory type is brewing stand inventory:
            cancel event
 
Solution:
Code:
on inventory click:
    if event-itemtype is fermented spider eye:
        if inventory type is brewing stand inventory:
            cancel event
That's the correct solution, but players can put the eye using number keys. So use this:
Code:
on inventory click:
    if type of event-item is fermented spider eye:
        if inventory type is brewing stand inventory:
            cancel event
    if type of event-item is air:
        if inventory type is brewing stand inventory:
            if click type is number key:
                cancel event
 
That's true

Maybe this would be better. Less code but does the same.
Code:
on inventory click:
    if inventory type is brewing stand inventory:
        if event-itemtype is fermented spider eye:
            cancel event
        else if click type is number key:
            cancel event
 
Well these codes work, but:
It prevents any movement of the fermented spider eye in my inventory. If I open the brewing stand I can't move this item at all. I just wanted to prevent players from putting it to the brewing stand.
Also I found a bug - when I opened my normal inventory and wanted to just move the spider eye to the other slot it started copying itself. It's really weird...
 
I don't know how I could make them able to move the spider eye when inside of the brewing stand without allowing them to use it.

The other bug is fixed:
Code:
on inventory click:
    if type of current inventory of player is brewing stand inventory:
        if event-itemtype is fermented spider eye:
            cancel event
        else if click type is number key:
            cancel event
 
I just wanted to prevent players from putting it to the brewing stand.
Code:
on inventory click:
    if type of current inventory of player is brewing stand inventory:
        if event-slot is slot 0 or 1 or 2 or 3 or 4 of event-iventory:
            if event-itemtype is fermented spider eye:
                cancel event
            else if click type is number key:
                cancel event
 
Code:
on inventory click:
    if type of current inventory of player is brewing stand inventory:
        if event-slot is slot 0 or 1 or 2 or 3 or 4 of event-iventory:
            if event-itemtype is fermented spider eye:
                cancel event
            else if click type is number key:
                cancel event

How would that fix it? Wouldn't it just prevent the player from moving the spider eye out of a brewing stand?
 
Just use the code that worked but also in your inventory and add this:

event-inventory != Player's inventory
 
Just use the code that worked but also in your inventory and add this:

event-inventory != Player's inventory
If you mean like this, it wouldn't work:
Code:
on inventory click:
    if event-inventory != Player's inventory:
        if type of current inventory of player is brewing stand inventory:
            if event-itemtype is fermented spider eye:
                cancel event
            else if click type is number key:
                cancel event
 
Status
Not open for further replies.