1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

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

How do i make mobs attack other mobs?

Discussion in 'Skript' started by Juju, Sep 15, 2020.

Tags:
Thread Status:
Not open for further replies.
  1. Juju

    Juju Member

    Joined:
    Sep 13, 2020
    Messages:
    4
    Likes Received:
    0
    minecraft version: 1.16
    skript version: latest idk

    problem:
    #summons a stray to fight for you (temporarily)
    on right click:
    if player is holding stick named "spawn"
    spawn a stray at the target block's location
    wait a tick
    clear all pathfinder goals of last spawned entity
    add pathfinder goal target nearest zombie to last spawned entity <--------- problems
    add pathfinder goal target nearest skeleton to last spawned entity <-----
    add pathfinder goal target nearest spider to last spawned entity <------

    error message: pathfinder goal target nearest (entitiy name)' can't be added to an entity because the former is neither an item type, an inventory nor an experiance point.


    the spaces do not show up here
     
  2. neolia

    neolia New Member

    Joined:
    Sep 19, 2020
    Messages:
    5
    Likes Received:
    0
    This for me works
    Code (Text):
    1. on rightclick:
    2.     if player's tool is a stick named "StraySpawner":
    3.         spawn a stray at player's location
    4.         set {_mob} to the last spawned entity
    5.         loop all entity in radius 10 around player:
    6.             if loop-entity is not a player:
    7.                 if loop-entity is not {_mob}:
    8.                     set target of {_mob} to loop-entity
     
Thread Status:
Not open for further replies.

Share This Page

Loading...