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!

  2. LOOKING FOR A VERSION OF SKRIPT??:

    You can always check our our Wiki for downloads and any other information about Skript!

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

add mob spawner with ID:AUX

Discussion in 'Skript' started by sOxTw, Oct 23, 2018.

Thread Status:
Not open for further replies.
  1. sOxTw

    sOxTw Active Member

    Joined:
    Jan 27, 2017
    Messages:
    35
    Likes Received:
    2
    Well I tell you my problem, when I try to give a spawner mob in the following way "mob spawner: 50" (it would be from creeper) it does not let me give me the following error
    Code (Skript):
    1. ':50 named "&c&lSpawner de Creeper" with lore "&aCanjeado por:||&e%player%||&aEl Dia: &e%now%||||&eEspecie: Creeper"' is not a valid item data (Canjes.sk, line 61: add 1 mob spawner:50 named "&c&lSpawner de Creeper" with lore "&aCanjeado por:||&e%player%||&aEl Dia: &e%now%||||&eEspecie: Creeper" to the player's inventory')
    How can I interpret what is an existing ID?
    Note: To get these spawners, I require Essentials with /i 52:50, I do not want to give /give so that it is more personalized, and without extra messages.


    Please someone help me, thank you very much.
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Skript doesn't really have the ability to give spawners. Spawners data is handled with NBT, so you would need an NBT addon such as jNBT to add NBT data to the spawner in hand. But it gets much more complicated. It's not as simple as just giving them an item with an ID.
    I have a resource with Spawners you can check out
    https://forums.skunity.com/resources/spawnerstack.643/
     
  3. sOxTw

    sOxTw Active Member

    Joined:
    Jan 27, 2017
    Messages:
    35
    Likes Received:
    2
    From what I see it is not possible to achieve without addons, and it will be possible to execute a give with metadata, for example

    Code:
    execute console command "give %player% 52:50 1 0 {display:{Name:"&c&lSpawner",Lore:["&a1","&e2"]}}"

    Error:
    Code (Skript):
    1. Can't understand this condition/effect: execute console command
    2. "give %player% 52:50 1 0 {display:{Name:"&c&lSpawner",Lore:["&a1","&e2"]}}"
    3. (Canjes.sk, line 58: execute console command "give %player% 52:50 1 0
    4. {display:{Name:"&c&lSpawner",Lore:["&a1","&e2"]}}"')
    I do not know if there is any way to execute these commands.
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    within quotes, ie your command, any quotes inside need to be double quoted, this way your execute doesn't think your command is being broken up
     
  5. sOxTw

    sOxTw Active Member

    Joined:
    Jan 27, 2017
    Messages:
    35
    Likes Received:
    2
    It worked, thank you very much
     
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    You are very welcome :emoji_slight_smile:
     
    • Agree Agree x 1
Thread Status:
Not open for further replies.
Loading...