Solved Ally 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.

Sunbex

New Member
Sep 13, 2021
8
0
1
24
Can someone write a script that summons a mob that is friendly to any player that summons it but attacks everyone else? (Like the pigman class in Hypixel) Thanks
 
You can disable the mob's normal target with

Code:
on entity target:

Then you can just set the target with this expression


Code:
[the] target[[ed] %*entitydata%] [of %livingentities%]
 
how would you code it so that a player having an item in their inventory wont get attacked?
 
Depends on which item.
In this code just replace item with the item you want, for example diamond sword named "Protector".

Code:
on entity target:
    target is a player
    loop target's inventory:
        if loop-value is item:
            cancel event
 
  • Like
Reactions: Sunbex
Status
Not open for further replies.