#Inventory full condition name

1 messages · Page 1 of 1 (latest)

fair vector
#

whats the effect/condition called to check if inventory is full i tried if player's inventory is full didnt work and if player's inventory doesn't have space for 1 saddle didnt work

covert fog
#

structure void is an unobtainable item so its best to check with that

#

If they can’t hold that, it means their inventory is full

fair vector
storm spoke
#

theres a colon at the end of that line.

#

you haven't indented correctly.

fair vector
#

without colon the red error still there

#

it fixed yellow but how do i fix red now

storm spoke
#

try if player has space for wheat then set the block to air yadyadyada and then else: your inventory is full

storm spoke
#

uhh

#

If player can hold event-block

#

i just searched up "can hold" on the docs and thats what it said

#

maybe its enough space instead

fair vector
storm spoke
#
# you can change that number```
#

Yea that

storm spoke
#

bru

fair vector
#

do i need some sort of addon or something

storm spoke
#

add a colon at the end and see if it fixes

#

it is if: after all

#

nope it says "skript"

fair vector
#

if i add colon yellow error pop up and it dosent do the rest properly it just says your inventory is full (when its not) and dosent give me the rest of the skript

storm spoke
#

show error

#

and show code aswell

fair vector
storm spoke
#

with that yellow error

fair vector
storm spoke
#

alright

#

ok

#

i see your problem

#

!indent

outer socketBOT
#

Indentation in Skript

In skript, you need to maintain consistent indentation, meaning you cannot indent 1 line 5 spaces, and the next 7 spaces. Usually it’s recommended you use tabs, however.

A good rule of thumb is to always indent the subsequent line whenever the previous statement ends with a :, an exception to this is in command statements with items before the trigger such as permission: or aliases:

With conditional statements and loops, any code that is indented within the statement will be run as a part of the statement, other code will not be run within the statement. Here is an example of proper indentation:

storm spoke
#

you didn't do what i said originally

#

and that

#

you havent indented correctly

#

the image is self explanatory really

#

the bottom part needs to be up where the inventory full thing is

#

and vice versa

fair vector
#

!format

outer socketBOT
#

Code Blocks

To make it easier for others to read your code, it is asked that you send it in a code block. On Discord, you can simply send this:

```
Code here
```

storm spoke
#

...

fair vector
#
on break:
    if event-block is hay bale:
        if player has enough space for 64 wheat:
        cancel event
        send "&cYour inventory is full!" to player
    else:
        set the block to air
        give 1 of hay bale named "&6Wheat &0Generator" to the player
        send "&aYou left clicked the hay bale and got a new Wheat Generator!" to player
#

im confused sorry

storm spoke
#

fine. wait like 2 minutes.

#
    if event-block is hay bale:
        if player has enough space for 1 hay bale:
            set the block to air
            give 1 of hay bale named "&6Wheat &0Generator" to the player
            send "&aYou left clicked the hay bale and got a new Wheat Generator!" to player
        else:
            cancel event
            send "&cYour inventory is full!" to player```
#

you are giving the player a hay bale i've realised.

fair vector
#

9 errors

storm spoke
#

probably indentation.

fair vector
#

ye il fix rn and tell you if any error

storm spoke
#
    if event-block is hay bale:
        if player has enough space for 64 wheat:
            set the block to air
            give 1 of hay bale named "&6Wheat &0Generator" to the player
            send "&aYou left clicked the hay bale and got a new Wheat Generator!" to player
        else:
            cancel event
            send "&cYour inventory is full!" to player```
#

heres the thing with tabs

#

my visual studio code was indenting with spaces

fair vector
#

Perfect it works thank you very much!

storm spoke
#

yw

#

and to anyone looking at this forum sorry for spoonfeeding lol