API Usage
API Usage for MobStacker
Spawner Stack Size
// Default Bukkit way
Location location = new Location(Bukkit.getWorld("world"), 0, 0, 0);
// Returns the stack size of the spawner
MobStackerAPI.getInstance().getSpawnerStackAmount(location);
// Returns the stack size of the spawner
MobStackerAPI.getInstance().getSpawnerStackAmount(location.getBlock());
// More Optimized solution
BlockCoordinates coords = new BlockCoordinates(0, 0, 0, "world");
// Returns the stack size of the spawner
MobStackerAPI.getInstance().getSpawnerStackAmount(coords);
Mob Stack Information
// Grab the entity
Entity entity = event.getEntity();
// Grabt the stacked mob by using the entity UUID
StackedMob stackedMob = MobStackerAPI.MOBS.get(entity.getUniqueId());
// Deduct an amount from the stacked amount
stackedMob.removeCount(int amount);
// Add to the stacked amount
stackedMob.addCount(int amount);
// Returns the entity instance
stackedMob.getEntity();
// Returns the stack size
stackedMob.getCount();
Last updated