Monsters can "break" blocks if from spawners.

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

swaith

Supporter
May 4, 2021
23
1
3
34
Category: Mob behaviour

Suggested name: Breakout

Spigot/Skript Version: 2.6-beta2 / 3238-Spigot-6clclb2-9217b52 (MC: 1.17.1)

What I want:
a way to adjust the script below, so that it can detect when a mob has been spawned via a spawner it will on chance break blocks surrounding it that are not on a blacklist, - example below, that doesn't work, I tried using skellett but I believe I am misunderstanding how to have it recognise how a monster was spawned in.

((It may be written wrong, but I expect what i wrote to apply 10% chance to each block, please let me know if I have done that wrong, I am worried on 10% chance it will just set ALL blocks in 1 radius not iin {blacklist::*} to air. ))

((the reason I want it specifically to detect what spawned the monster in, is that I do not want monsters spawned by normal spawning from the server to break blocks around them))

Code:
on script load:
    add iron bar to {blacklist::*}
    add diamond block to {blacklist::*}

if mob is from spawner:
    loop every 10 seconds all blocks in radius 1 around loop-mob:
        if loop-block is not {blacklist::*}:
            chance 10%
            set blocks at loop-block to air
            broadcast "&aYour monsters are trying to break free!"
        else:
            stop



When I'd like it by: No rush, it might not even be possible =]
 
Last edited:
I will try that, but it seems too simple to me, as that would only be on the spawning event? would that track all mobs spawned by the spawner?
 
https://ibb.co/QDTgrT0

as in the image above, I wanted it so that monsters spawned by the spawner (orange) can break the blocks around them, but naturally spawned mobs (red) cannot, I am currently using when the entity targets a player as the trigger with a repeat every 2 seconds over 8 seconds on target, but I cannot find a way for it to apply specifically to the monsters spawned by the spawner block.

I have quite a few spawner farms on the server, and I would like it to be that those specific mobs can break their cages - rather then an event that runs when the spawner block spawns something - it needs to persist when they move away from the block itself. I wondered if there was a tag on the monster that showed it was spawned by a block rather then the server due to darkness etc.