SpawnerSilk API

From version 2.2. SpawnerSilk provides an API for managing spawners. Here is a little tutorial on how to use it ! The API consists of two methods.


Get ItemStack from an Entity


public static ItemStack getSpawner(EntityType entity)

This method return a spawner of the entity entity. If the entity is not valid or not supported by SpawnerSilk, the method return a default spawner with displayName equals to "????".

To use it, you need to link the SpawnerSilk jar file to your project and call the method through the SpawnerAPI class.
Exemple: SpawnerAPI.getSpawner(EntityType.SKELETON_HORSE);

Get Entity from an ItemStack


public static EntityType getEntityType(ItemStack is)

This method return the corresponding EntityType of a spawner. If the entity is not valid or not supported by SpawnerSilk, the method return EntityType.UNKNOW.

To use it, you need to link the SpawnerSilk jar file to your project and call the method through the SpawnerAPI class.
Exemple: SpawnerAPI.getEntityType(myItemStackSpawner);