#spawn only 1 mob in specific region

1 messages · Page 1 of 1 (latest)

weary hornet
#

it doesn't work

#

how do i do this

weary hornet
#
    if event-location is in region "cherry":
        if entity is a skeleton:
            if name of entity is "&x&F&F&6&4&6&4&lCherry's Helpers":
                stop
        cancel event```
dim rampart
weary hornet
#

When i try to spawn the skeleton named that way it doesn t work

#

I tried without that skript and it worked

dim rampart
#

If a skeleton spawns in a certain region with a certain name you want to cancel the event right

dim rampart
#

You need to explain your problem better

weary hornet
#

Well i want it to spawn but to be the only mob that can be spawned

#

The skeleton to be the only mob that can spawn

#

In that region

dim rampart
#

Okay, why do you write "if entity is skeleton:" when you want skeletons to spawn

thin island
#

he doesnt cancel if its a skeleton

dim rampart
#

Yeah the indentation is just wrong on the cancel event

thin island
#

also when would a mob that is just spawning in have a name

dim rampart
#

He possibly has another skript giving a mob a name when it spawns

thin island
#

it's not if he wants only skeletons named that to spawn

rustic drum
#

And the indentation of cancel event is wrong

#

Remove the stop

winter sapphire
#

Hey! The issue is mainly the use of stop, you don’t need that there at all and it actually messes things up a bit, also the indentation of cancel event is probably off, it needs to be inside the right condition so it only cancels mobs that aren’t the named skeleton. I would also suggest you to make sure you’re checking the region right too, sometimes using region at event-location works better depending on your setup
Your idea is to cancel every mob that spawns in that area except your custom skeleton, so just let that one through and cancel the rest

thin island
#

actually the stop makes it so that it doesnt cancel the custom skeletons

#

youre wrong AGAIN

rustic drum
#

That is true

winter sapphire
#

Ok, i will go straight to the point because it seems I didn't explain it well: The problem is how you verify the region, the structure with stop **can **work, but if you rwwrite it without stop it could be clearer..

First, use %region at event-location% to verify the region, no event-location is in region. This allows only skeletons with the specified name to spawn as well as it cancels other spawns. I would also recommend you to make sure that the cherry region is well defined in your server, I guess you are using a region plugin.

winter sapphire
dim rampart
#

@winter sapphire are you the yap king?

winter sapphire
#

I just like to help highfive

weary hornet
#
    if %region at event-location% contains "cherry":
        if name of entity is "&x&F&F&6&4&6&4&lCherry's Helpers":
            stop
        cancel event```
hearty adder
#

you need quotes around the region check, not only percent signs

#

%stuff% --> "%stuff%"

#

also, newly spawned mobs don't have a name just yet, you need to wait a tick before you check the name

weary hornet
#

i figured it out

#

ty tho

hearty adder
#

no problem