Package org.bukkit.block

Examples of org.bukkit.block.CreatureSpawner


        // Get the entity from the string
        EntityType entity = EntityType.fromName(entityType);
        // If the entity is not null and the list contains the entity
        // Then set the spawner to the entity type
        if (entity != null && list.contains(entity.getName())){
          CreatureSpawner spawner = (CreatureSpawner) block.getState();
          // Set the spawner type
          spawner.setSpawnedType(entity);
          LogHelper.showInfo("spawnerSuccess#####[" + Utils.userFriendlyNames(entity.getName()), sender, ChatColor.GREEN);
        } else {
          LogHelper.showInfo("spawnerInvalid", sender, ChatColor.RED);
        }
      } else {
View Full Code Here


  public final void setSpawner(int x, int y, int z, EntityType aType) {
    Block block = getActualBlock(x, y, z);
    if (BlackMagic.setBlockType(block, Material.MOB_SPAWNER)) {
      if (block.getType() == Material.MOB_SPAWNER) {
        CreatureSpawner spawner = (CreatureSpawner) block.getState();
        spawner.setSpawnedType(aType);
        spawner.update(true);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.bukkit.block.CreatureSpawner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.