Check what type of egg is in spawner?

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

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

sentrix

Member
Nov 11, 2019
1
0
0
28
Hi, I'm writing a script so that you can break spawners and get the type of spawner with the egg in your hand. I'm new to skript and there isn't anything inside of the documentation that seems to help with this problem:

Current Code:
Code:
on break of spawner:
  if player's held item isn't air:
    if tool of the player is enchanted with silk touch:
      remove 1 spawner from the player
    give player spawner

This only give the spawner but I want to give the player the attached egg to the spawner. For example, if you place down a spawner by default you get a pig spawn egg. When you break it, I want to make it that you get the spawn egg that you put in it, in this situation a pig spawn egg in your inventory with the spawner. Is there any possible way that you can do this?
 
Status
Not open for further replies.