Jump to content

me being braindead once again


Recommended Posts

Posted

if(!getInventory().isFull()){
    //inventory not full <28
}else{
    //inventory is full >28
}
Or you coule check out

getInventory().isFull()

getInventory().isEmpty()

.isEmpty will only work when there is no items in the inventory. So you are better of doing !getInventory().isFull() because that will let you do stuff while the inventory is not full and it can still contain items without saying it is full, because you need 28 items for it to be full :p

  • Like 1
Posted

if(inventory.isFull()) {
//action you want it to do
}
if(!inventory.isFull()) {
//action you want it to do
}

the "!" in front of booleans (conditions) basically means the opposite return than if it didn't have it.

if else statements work well too, but I would stick to using just if statements for now, but thats just my opinion

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...