Pathfinder?

Discussion in 'Plugin Development' started by Someone_Like_You, Dec 8, 2013.

Thread Status:
Not open for further replies.
  1. Can someone explain me a few stuff about mobs "Pathfinder"?
    I extended entity zombie so Il be able to modify his speed without speed potion, and another few things, but I cant understand a few things,

    1. Whats the numer after a. means? priority?

    2. In line 3 we have the 2.0D (or float), whats its means?... the speed of zombie? the damage? cause I tested it, but I didnt saw any diffrents

    3. In line 4, whats the 1D stands of?

    4. In line 5, whats the 8.0F? how fast will he look? how long will he look at you?

    5. Line 7, how its affect the zombies?

    6. Anddd line 8.... whats the "8" and whats the "true"?

    *I tried to look for some information in google, havent found anything :(
    Code:java
    1. this.getNavigation().b(true); //line 1
    2. this.goalSelector.a(0, new PathfinderGoalFloat(this));//line 2
    3. this.goalSelector.a(0, new PathfinderGoalMeleeAttack(this, EntityHuman.class, 2.0D, false));//line 3
    4. this.goalSelector.a(2, new PathfinderGoalMoveTowardsRestriction(this, 1D));//line 4
    5. this.goalSelector.a(7, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));//line 5
    6. this.goalSelector.a(7, new PathfinderGoalRandomLookaround(this));//line 6
    7. this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, true));//line 7
    8. this.targetSelector.a(0, new PathfinderGoalNearestAttackableTarget(this, EntityHuman.class, 8, true));//line 8
     
  2. Offline

    Cybermaxke

    This is everything I found ;)
    3. arg 3 = Speed & arg 4 = Whether the entity doesn't need to see it's target.
    4. arg 2 = Speed
    5. arg 3 = The range the entity will try to look at someone.
    7. arg 2 = Makes a group of the same type entities attack the target.
    8. arg 3 = Is the chance if the entity targets it's nearest target. (random.nextInt(chance) == 0) & arg 4 = Whether the entity needs to see it's target.
     
    Someone_Like_You likes this.
  3. Cybermaxke Thanks for asnwer :) I got a few more questions :3
    1. My zombie (from that class ) are retarded... hes ignoring line 3 the "true" or false thingy (of going to play even if he doesnt see him)
    2. How would I make vanilla zombies faster, smarter, stronger and have bigger range of "looking for player"?
    3. Is it possible to make them "jump" when have obstacle near them? (lava, over deep holes)

    EDIT: Do you have any idea whats the first number mean?
    EDIT AGAIN: Lol, My zombie seems like walking around and after a few seconds notice the player that 1 block next to him... how to fix it? :eek:
     
  4. Offline

    Cybermaxke

    The first value is the priority, you can change the attributes of the zombie to change speed, attack range, etc.
    But jumping over holes and lava isn't possible with the default path finding.
     
    Someone_Like_You likes this.
  5. Cybermaxke Okay, thanks... I got one more question :3,
    I extended Snowman entity, to make them "dummy" , and I need to cancel their damage event, how do I cancel it? Im getting spammed with errors :( "EventException"...
    And any idea about the smarter zombies?
     
  6. Offline

    Cybermaxke

    Can you post the complete error stack?
     
    Someone_Like_You likes this.
  7. Emm, Ive changed it to if(e.getEntity() instacenof MyCustomEntity()) , but its doesnt even shoot >,< how do I check for damage event with extended entities?
     
  8. Offline

    Cybermaxke

    if (((CraftEntity) e.getEntity()).getHandle() instanceof MyCustomEntity)
     
    Someone_Like_You likes this.
Thread Status:
Not open for further replies.

Share This Page