CostumEntity - movelistener

Discussion in 'Plugin Development' started by Shmobi, Sep 19, 2014.

Thread Status:
Not open for further replies.
  1. Hello,
    i made a costumentityclass and gave it a private arraylist of movelistener, an interface i made. the name says what it shall do. listen to every time the mob is moving, so can somebody tell me how the movemethod in an entityclass is called? i just need the listener for this entity. i want to overwrite it. i will call every listener in my listenerarraylist and then call the default movemethod of the superclass.
    thanks for answers
     
  2. Offline

    FabeGabeMC

    Shmobi
    Create your own event called EntityMoveEvent with the constructor EntityMoveEvent(LivingEntity ent, Location from, Location to){}
    Then run a repeating task of 1 tick looping through all the worlds' entities storing their old location in a HashMap. If a change happens, call the event.
     
  3. FabeGabeMC this would be a possible way, but would may be laagy and like i said, i just want to have my listener for this class. all others aren't interesting for me. i just need to know how the method which moves the livingentity is called to overwrite it. then i can call it from the superclass and call my listener
     
Thread Status:
Not open for further replies.

Share This Page