Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Property undefined/Variable undefined

Comments in 'Plugin Development' started by JacksonML, Jul 23, 2014.

  1. JacksonML
    Offline

    JacksonML New Member

    Joined:
    Jul 20, 2014
    Posts:
    4
    Minecraft User:
    JacksonML
    I am trying to make a plugin for my server, and I've gotten stuck (again). I created a class to keep track of the different objects and to make handling things easier. I've gotten to the point where I can almost successfully create the object, but I can't recall the object after the command has been executed. The link to the code and the console message I get: http://pastebin.com/yx6fs0fS . You will notice on line 31 I have it set to $this->test1->coords[0][0]. If I change it to $test1->coords[0][0] it says undefined variable. I'm guessing I'm defining the object incorrectly. If someone could help me it would be highly appreciated.
  2. Lambo
    Offline

    Lambo Notable Member Plugin Developer

    Joined:
    Sep 14, 2013
    Posts:
    431
    Plugins:
    4
    Minecraft User:
    Lambo
    Test1 isn't defined?
  3. JacksonML
    Offline

    JacksonML New Member

    Joined:
    Jul 20, 2014
    Posts:
    4
    Minecraft User:
    JacksonML
    It should be defined because /prmdefine defines test1
  4. Lambo
    Offline

    Lambo Notable Member Plugin Developer

    Joined:
    Sep 14, 2013
    Posts:
    431
    Plugins:
    4
    Minecraft User:
    Lambo
    No it doesn't?
  5. JacksonML
    Offline

    JacksonML New Member

    Joined:
    Jul 20, 2014
    Posts:
    4
    Minecraft User:
    JacksonML
    What about line 50?"$test1 = new Mine($args[0],$this->x1,$this->y1,$this->z1,$this->x2,$this->y2,$this->z2);"
  6. JacksonML
    Offline

    JacksonML New Member

    Joined:
    Jul 20, 2014
    Posts:
    4
    Minecraft User:
    JacksonML
    Well, finally after a day of trying different things, it came to me at dinner to try to do $this->test1 = new Mine instead of just $test1 = new Mine. Thanks guys but I figured it out myself.
    Lambo likes this.

Share This Page

Advertisement