API
SpawnerSilk exposes a small API through the SpawnerAPI class.
Create a Spawner Item from an Entity Type
public static ItemStack getSpawner(EntityType entity)
Returns a spawner item for the given entity type.
If the entity type is invalid or unsupported, the method returns a fallback spawner item with a placeholder display name.
Example:
SpawnerAPI.getSpawner(EntityType.SKELETON_HORSE);
Read the Entity Type from a Spawner Item
public static EntityType getEntityType(ItemStack is)
Returns the EntityType represented by the given spawner item.
If the item is invalid or unsupported, the method returns EntityType.UNKNOWN.
Example:
SpawnerAPI.getEntityType(myItemStackSpawner);
Create a Spawner Item from an Entity Name
public static ItemStack stringToCustomItemStack(String mobName, int amount)
Returns a spawner item for the given mob name and amount.
Example:
SpawnerAPI.stringToCustomItemStack("cat", 1);
Notes
- Add the SpawnerSilk jar to your plugin project before calling the API.
- The exact item output depends on the entity type support available in SpawnerSilk.