Only hostile 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 community!

    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.

pepper82

Member
Jan 26, 2017
272
1
18
Is there any way of checking the type of a mob for if it is a "hostile mob"?
Or do I have to check every single mob?

e.g.

if targeted entity is any hostile mob
OR
if targeted entity is blaze, cave spider, zombie, creeper, elder guardian, enderman, endermite, evoker, ghast, guardian, husk, zombie pigman, shulker, silverfish, skeleton, slime, spider, stray, witch, wither skeleton or zombie
etc.


???
 
Last edited:
You can just use Monsters
code_language.skript:
command /KillMonsters:
    trigger:
        kill all Monsters
        broadcast "Bye bye Monsters :D"
 
So putting Tobias's example into your perspective I imagine it would go something along the lines of,

if targeted entity is (any / a) monster:
#do stuff
 
TuSKe also has the following condition.
code_language.skript:
%living entities% (is|are) [a] (hostile|neutral|passive) [mob]
%living entities% (is|are)(n't| not) [a] (hostile|neutral|passive) [mob]
Example:

code_language.skript:
on spawn:
    wait a tick
    if event-entity is hostile:
        send "Watch out, a hostile mob is close!" to players in radius 30 of event-entity
 
Status
Not open for further replies.