#Inventory full condition name
1 messages · Page 1 of 1 (latest)
if player can’t hold 1 structure void:
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
try if player has space for wheat then set the block to air yadyadyada and then else: your inventory is full
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
bru
do i need some sort of addon or something
add a colon at the end and see if it fixes
it is if: after all
nope it says "skript"
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
with that yellow error
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:
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
!format
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
```
...
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
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.
9 errors
probably indentation.
ye il fix rn and tell you if any error
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
Perfect it works thank you very much!