Help please with 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.

bobby2002

Active Member
Nov 24, 2017
50
0
0
21
I am using skript 1.12.2 and I was wondering how I would do these 3 things:
Kill a mob with a name (like idk "random mob") - and it would kill that mob with that name
make a mob not attack a player - so if i spawn in a zombie it wouldntattack me even if i wasnt in gms
make a mob follow a player/attack a player if they attacked me
thanks ! :emoji_stuck_out_tongue:
 
1) You can kill a mob using its name but its tricky because its name is not a unique identifier so you would have to loop all entities and check if their name matches, if so you would kill the looped entity. This would only work if the mob is in a loaded chunk though.

2) There is an on target event. You can cancel it

3) Possible but I don't know the easiest way to achieve that without actually trying to code it
 
For your second request.

code_language.skript:
on target:
    targeted entity is a player:
        cancel event
 
1) You can kill a mob using its name but its tricky because its name is not a unique identifier so you would have to loop all entities and check if their name matches, if so you would kill the looped entity. This would only work if the mob is in a loaded chunk though.

2) There is an on target event. You can cancel it

3) Possible but I don't know the easiest way to achieve that without actually trying to code it
Thanks, but it’s not really helpful. It just tells me it’s possable And not how to do it. If I knew how to do it I wouldn’t be posting about it. But thanks anyways! :emoji_slight_smile:
[doublepost=1518114838,1517845134][/doublepost]Bump
 
Thanks, but it’s not really helpful. It just tells me it’s possable And not how to do it. If I knew how to do it I wouldn’t be posting about it. But thanks anyways! :emoji_slight_smile:
[doublepost=1518114838,1517845134][/doublepost]Bump
I didn't provide further help in the first 2 because they are fairly self explanatory, but this is kind of what you would do for the first one:
code_language.skript:
loop all entities:
  if name of loop-entity is "Bad Zombie":
    kill loop-entity
For your second request Hexivoid seems to have provided an example but if you don't understand or need further help just ask. Your third request is a bit more complex and if you want someone to give you working code for that I'd make a post in the requests section
 
Status
Not open for further replies.