My mobs dont attack players

Discussion in 'Support' started by Nicolas Andrade, Apr 16, 2018.

  1. Nicolas Andrade

    Nicolas Andrade New Member

    Joined:
    Jan 24, 2018
    Messages:
    18
    Likes Received:
    0
    Hello,

    I have configured to my mobs attack players but one mob type dont attack anyone only follows the player but does not attack him.
    One thing that is not understand is that the mob "lobo" attacks the players and the "urso" does not attack but both of which use basically the same configuration.
    Mob that dont attack = urso
    My config:

    urso:
    Type: Cow
    Display: '&cUrso'
    Health: 110
    Damage: 3.0
    Drops:
    - urso
    Options:
    PreventOtherDrops: true
    FollowRange: 20
    MaxCombatDistance: 21
    AIGoalSelectors:
    - 0 clear
    - 1 meleeattack
    - 2 randomstroll
    AITargetSelectors:
    - 0 clear
    - 1 players
    lobo:
    Type: Wolf
    Display: '&cLobo'
    Health: 60
    Damage: 1.5
    Drops:
    - urso
    Options:
    PreventOtherDrops: true
    FollowRange: 20
    MaxCombatDistance: 21
    AIGoalSelectors:
    - 0 clear
    - 1 meleeattack
    - 2 randomstroll
    AITargetSelectors:
    - 0 clear
    - 1 players
     
    #1
  2. Nicolas Andrade

    Nicolas Andrade New Member

    Joined:
    Jan 24, 2018
    Messages:
    18
    Likes Received:
    0
    UP, dont have any support in this forum, wtf ...
     
    #2
  3. Roger M

    Roger M Member
    Supporter

    Joined:
    May 13, 2016
    Messages:
    71
    Likes Received:
    8
    Cows don’t naturally have melee attacks, so you need to make it fire off a skill attack instead.
     
    #3
  4. Nicolas Andrade

    Nicolas Andrade New Member

    Joined:
    Jan 24, 2018
    Messages:
    18
    Likes Received:
    0
    I put this and mob still dont attack me
    urso:
    Type: COW
    Display: '&cUrso'
    Health: 110
    Drops:
    - urso
    Options:
    PreventOtherDrops: true
    FollowRange: 20
    MaxCombatDistance: 21
    AITargetSelectors:
    - 0 clear
    - 1 players
    Skills:
    - damage{amount=6;pkb=true} @Target ~onAttack
     
    #4
  5. Roger M

    Roger M Member
    Supporter

    Joined:
    May 13, 2016
    Messages:
    71
    Likes Received:
    8
    It’s the onAttack that’s the problem. Since cows can’t naturally attack the skill never gets fired. Instead make a conditional skill that only fires when the target is with a certain range and use onTimer instead. Also use the aigoalselector you had, but swap movetowardstarget in for meleeattack.
     
    #5
    Last edited: Apr 19, 2018
  6. Buguser

    Buguser Member

    Joined:
    Oct 11, 2016
    Messages:
    96
    Likes Received:
    38
    #6
  7. Nicolas Andrade

    Nicolas Andrade New Member

    Joined:
    Jan 24, 2018
    Messages:
    18
    Likes Received:
    0
    I put this skill to my mob, the particles is work but dont give any damage when the cow get closer to the player, what i do wrongly?

    COW:
    Cooldown: 10
    Skills:
    - throw{v=2;vy=5} @Target
    - effect:particlesphere{particle=reddust;amount=30;radius=1.5;y=0.5;color=#A90F27;repeat=2;repeatinterval=20} @Target
     
    #7
  8. MooshroomStatus

    Joined:
    May 25, 2016
    Messages:
    92
    Likes Received:
    29
    What they're suggesting you may want to do is something along the lines of this;

    Code:
    Type: COW
    Display: '&cUrso'
    Health: 110
    Drops:
    - urso
    Options:
    PreventOtherDrops: true
    FollowRange: 20
    MaxCombatDistance: 21
    AITargetSelectors:
    - 0 clear
    - 1 players
    Skills:
    - skill{s=meleeattack} @Target ~onTimer:20
    Code:
    meleeattack:
      cooldown: 0
      conditions:
      - targetwithin{d=1} true
      Skills:
      - throw{v=2;vy=5} @Target
      - damage{a=6} @Target
      - effect:particlesphere{particle=reddust;amount=30;radius=1.5;y=0.5;color=#A90F27;repeat=2;repeatinterval=20} @Target
    Hope this helps!
     
    #8
  9. Nicolas Andrade

    Nicolas Andrade New Member

    Joined:
    Jan 24, 2018
    Messages:
    18
    Likes Received:
    0
    Bro i have put this configs and the COW mob is attacking the player even if it is 10 blocks away the mob, lol
     
    #9
  10. MooshroomStatus

    Joined:
    May 25, 2016
    Messages:
    92
    Likes Received:
    29
    Did you make it a skill with the following condition? Or make sure the syntax is correctly typed? If it is, the skill shouldn't fire unless the player is within 1 block of the cow.

    EDIT: Make sure under the mob file, the targetter is set to @Self
     
    #10
  11. Nicolas Andrade

    Nicolas Andrade New Member

    Joined:
    Jan 24, 2018
    Messages:
    18
    Likes Received:
    0
    I have put the SAME configs that you have send for me and cow was hiting me even if im at 10 blocks away
     
    #11
  12. MooshroomStatus

    Joined:
    May 25, 2016
    Messages:
    92
    Likes Received:
    29
    Ok, so I think I figured out what's wrong. Try this configuration:
    Code:
    Urso:
      Type: COW
      Display: '&cUrso'
      Health: 110
      Drops:
      - urso
      Options:
      MovementSpeed:
      PreventOtherDrops: true
      FollowRange: 20
      MaxCombatDistance: 21
      AIGoalSelectors:
      - 0 meleeattack
      AITargetSelectors:
      - 0 players
      Skills:
      - skill{s=meleeattack} @Self ~onTimer:20
    What did I change here?: Your mob was missing an AIGoalSelector. So although it would target players, it would never actually move towards them since it's a passive mob, so I added the meleeattack goal selector. I recommend tweaking the movement speed of the cow too, since it walks pretty slowly.

    As far as skills:
    Code:
    meleeattack:
      cooldown: 0
      conditions:
      - targetwithin{d=1} true
      Skills:
      - throw{v=2;vy=5} @PIR{r=1}
      - damage{a=6} @PIR{r=1}
      - effect:particlesphere{particle=reddust;amount=30;radius=1.5;y=0.5;color=#A90F27;repeat=2;repeatinterval=20} @PIR{r=1}
    What I did here was change the @Target targetters to @PIR. This prevents the mob from hurting players that are outside a set radius (Which is what the condition should do but doesn't for some reason). You can change the radius accordingly.
     
    #12
  13. Nicolas Andrade

    Nicolas Andrade New Member

    Joined:
    Jan 24, 2018
    Messages:
    18
    Likes Received:
    0
    Thats works now!! Thank you so much!
    What i need put in MovementSpeed to increase the speed? I have tested 2.0, 2, 5 and and nothing changes ..
     
    #13
  14. Nicolas Andrade

    Nicolas Andrade New Member

    Joined:
    Jan 24, 2018
    Messages:
    18
    Likes Received:
    0
    #14

Share This Page