1. 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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Monsters can "break" blocks if from spawners.

Discussion in 'Requests' started by swaith, Sep 18, 2021.

  1. swaith

    Supporter

    Joined:
    May 4, 2021
    Messages:
    23
    Likes Received:
    1
    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 (Text):
    1.  
    2. on script load:
    3.     add iron bar to {blacklist::*}
    4.     add diamond block to {blacklist::*}
    5.  
    6. if mob is from spawner:
    7.     loop every 10 seconds all blocks in radius 1 around loop-mob:
    8.         if loop-block is not {blacklist::*}:
    9.             chance 10%
    10.             set blocks at loop-block to air
    11.             broadcast "&aYour monsters are trying to break free!"
    12.         else:
    13.             stop
    14.  


    When I'd like it by: No rush, it might not even be possible =]
     
    #1 swaith, Sep 18, 2021
    Last edited: Sep 18, 2021
  2. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    650
    Likes Received:
    39
    Code (Text):
    1. on spawner spawn:
     
    swaith likes this.
  3. swaith

    Supporter

    Joined:
    May 4, 2021
    Messages:
    23
    Likes Received:
    1
    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?
     
  4. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    650
    Likes Received:
    39
    This event shoots when a spawner spawns mobs
     
  5. swaith

    Supporter

    Joined:
    May 4, 2021
    Messages:
    23
    Likes Received:
    1
    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.
     

Share This Page

Loading...