Jump to content

getinventory


holyfoxx

Recommended Posts

  • 4 weeks later...

oh i got it, now im using , inventory.isFull()

 

inventory.isFull() keeps running as an error for me.. :(

Will run perfectly like this:

    private State getState() {
    	Entity tree = objects.closest("Tree");
    	if(!inventory.isEmpty())
    		return State.DROP;
    	if (tree != null)
    		return State.CUT;
    	return State.WAIT;

but if i throw in the .isFull() the script won't run at all:

    private State getState() {
    	Entity tree = objects.closest("Tree");
    	if(!inventory.isFull())
    		return State.DROP;
    	if (tree != null)
    		return State.CUT;
    	return State.WAIT;

pls halp (:

Link to comment
Share on other sites

inventory.isFull() keeps running as an error for me.. sad.png

Will run perfectly like this:

    private State getState() {
    	Entity tree = objects.closest("Tree");
    	if(!inventory.isEmpty())
    		return State.DROP;
    	if (tree != null)
    		return State.CUT;
    	return State.WAIT;

but if i throw in the .isFull() the script won't run at all:

    private State getState() {
    	Entity tree = objects.closest("Tree");
    	if(!inventory.isFull())
    		return State.DROP;
    	if (tree != null)
    		return State.CUT;
    	return State.WAIT;

pls halp (:

 

If inventory isn't full, drop? Remember to remove the ! before the boolean (it was !isEmpty now !isFull) they are opposite so it should be if (getInventory().isFull())

 

Or is the isFull causing an actual error? 

Edited by Czar
  • Like 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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