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:
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?
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?