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.

Solved Custom Mob Spawner

Discussion in 'Requests' started by Luxic, May 27, 2017.

Tags:
  1. Luxic

    Luxic Member

    Joined:
    May 27, 2017
    Messages:
    1
    Likes Received:
    0
    Category: ?

    Suggested name: CustomSilkSpawner

    What I want:
    1. If you break a spawner (doesn't need silk touch) it'll drop the spawner complete with it's nbt tags or whatever (like Spawn Range, Spawn Delay, etc)
    2. If you place a spawner it'll place it complete with it's nbt tags or whatever ^
    3. The nbt tags or whatever will be in a form of rarity/tiers (idk like tier stone, coal, iron,etc i can change it after i study the code)
    4. and a command for buying it


    Ideas for commands:
    /CSS [<text>] [<text>] [<text>] [<text>]
    arg 1 is give
    arg 2 target player or all
    arg 3 type of mob
    arg 4 rarity/tiers

    Ideas for permissions:
    i can figure this out later, i just need the codes, i'm seriously stuck


    When I'd like it by:
    IDK a reasonable time I guess?

    Plugins I have: (if needed more tell me)
    -MundoSK
    -SharpSK
    -Skellett
    -SkQuery
    -skRayFall_v1.9.7
    -Skript
    -SkStuff1.6.4.1
    -skUtilities.v0.9.0
    -TuSKe
    -Umbaska-3.3
    -WildSkript

    YES I'm just starting out

    Thx

    P.S I got these but I don't think it helps

    Haven't checked for errors sry
    Code (Skript):
    1. on break of mob spawner:
    2.     if {_s::%event-block%} is not set:
    3.         set {_s::%event-block%} to "%nbt of targeted block%"
    4.         set {_s::%event-block%::*} to {_s::%event-block%} split at """"
    5.         if {_s::%event-block%::2} is "minecraft:pig":
    6.             drop a mob spawner named "PIG"
    7.    
    8.  
    9. on place of mob spawner:
    10.         player is holding mob spawner named "Blaze"
    11.         set mob type of spawner target block to "Blaze"
    12.         player is holding mob spawner named "PIG"
    13.         set mob type of spawner target block to "Pig"
    14.    
     
    #1 Luxic, May 28, 2017
    Last edited: May 28, 2017
  2. Best Answer:
    Post #2 by ShaneBee, May 28, 2017
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    You can't store nbt into a block, you know that.
    Do something like this, i'm busy and I can't do it for you:

    On place of mob spawner:
    • save the location to a list variable index
    • save the nbt to the the variable value (set this value to nbt of player's tool)
    On break of mob spawner:
    • loop the mob spawner variable list
    • if the index is the same as the event-location, you found a custom mob spawner.
    • cancel the drop of the spawner
    • give the player or make drop a spawner with the custom NBT that was stored on the loop-value
     
    Luxic likes this.

Share This Page

Loading...