Minecraft java nullpointerexception?

La
3

I don't know how to resolve this NullPointerException:

public boolean isSlotFull () {
for (int i = 0; i ItemStack is = mc.thePlayer.inventory.getStackInSlot (i);
if (is.stackSize == 64) {
return true;
}
}
return false;
}

Eclipse says the line if (is.stackSize == 64) is NullPointerException

Bu

Accordingly, getStackInSlot returns zero. You should check why this is the case below.

Incidentally, I wonder why you act with so many publicly visible attributes. According to the principle of the encapsulation, getters should be there instead.

La

Sorry am new

go

Actually on principle, especially with Java, all attributes always on private.