How do i make mobs attack other mobs?

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Juju

Member
Sep 13, 2020
4
0
1
24
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
 
This for me works
Code:
on rightclick:
    if player's tool is a stick named "StraySpawner":
        spawn a stray at player's location
        set {_mob} to the last spawned entity
        loop all entity in radius 10 around player:
            if loop-entity is not a player:
                if loop-entity is not {_mob}:
                    set target of {_mob} to loop-entity
 
Status
Not open for further replies.