Package org.bukkit.entity

Examples of org.bukkit.entity.EntityType


      if (type.equals("ANIMALS")) {
        this.spawnControl.setAnimals(true);
      } else if (type.equals("MONSTERS")) {
        this.spawnControl.setMonsters(true);
      } else {
        EntityType t = ParseUtil.parseEnum(EntityType.class, type, null);
        if (t != null) {
          this.spawnControl.deniedCreatures.add(t);
        }
      }
    }
View Full Code Here


  public void onPlayerInteractEntity(PlayerInteractEntityEvent event) {
    boolean cancelEvent = false;
    Player player = event.getPlayer();

    Entity entity = event.getRightClicked();
    EntityType entityType = entity.getType();

    if (entityType.equals(EntityType.VILLAGER)) {
      cancelEvent = interactWithVillager(player, entity);
    } else if (entityType.equals(EntityType.IRON_GOLEM)) {
      interactWithGolem(player, entity);
    }
    // If the event has previously been cancelled, cancel it.
    // (Prevent overwriting other plugin effects).
    boolean previouslyCancelled = event.isCancelled();
View Full Code Here

          radius);
      for (Entity i : entities) {
        if (i.isDead()) {
          continue; // Ignore dead stuff.
        }
        EntityType eType = i.getType();
        switch (eType) {
        case PLAYER:
        case VILLAGER:
        case IRON_GOLEM:
        case SNOWMAN:
View Full Code Here

        spawned = creatureType;
    }

    @Override
    public void setCreatureTypeByName(String creatureType) {
        EntityType type = EntityType.fromName(creatureType);
        if (type != null) {
            spawned = type;
        }
    }
View Full Code Here

        // Check if it's a world which we are meant to be managing.
        if (!(this.worldManager.isMVWorld(world.getName())))
            return;

        EntityType type = event.getEntityType();
        /**
         * Handle people with non-standard animals: ie a patched craftbukkit.
         */
        if (type == null || type.getName() == null) {
            this.plugin.log(Level.FINER, "Found a null typed creature.");
            return;
        }

        MultiverseWorld mvworld = this.worldManager.getMVWorld(world.getName());
View Full Code Here

            if (specifiedMonsters)
                specified = true;
            negate = negateMonsters;
        }
        for (String s : thingsToKill) {
            EntityType type = EntityType.fromName(s);
            if (type != null && type.equals(e.getType())) {
                specified = true;
                if (!negate) {
                    Logging.finest("Removing an entity because it WAS specified and we are NOT negating in world %s: %s", e.getWorld().getName(), e);
                    return true;
                }
View Full Code Here

    }

    // Start processing the elements
    creaturePreSpawnMobs.clear();
    for (BiomeMeta inputMeta : inputTypes) {
      final EntityType oldEntityType = CommonEntityType.byNMSEntityClass(inputMeta.b).entityType;

      // Set up the event
      creaturePreSpawnEvent.cancelled = false;
      creaturePreSpawnEvent.spawnLocation.setWorld(world);
      creaturePreSpawnEvent.spawnLocation.setX(x);
View Full Code Here

                } catch (IllegalArgumentException ex) {
                    return 0;
                }
            } else if (materialData instanceof SpawnEgg) {
                try {
                    EntityType entityType = EntityType.valueOf(type);

                    return (byte) entityType.getTypeId();
                } catch (IllegalArgumentException ex) {
                    return 0;
                }
            } else if (materialData instanceof Coal) {
                try {
View Full Code Here

            } else if (data instanceof Tree) {
                //TreeSpecies specie = TreeSpecies.getByData((byte) (data.getData() & 3)); //This works, but not as intended
                TreeSpecies specie = ((Tree) data).getSpecies();
                return (specie != null && specie != TreeSpecies.GENERIC ? specie.name() : null);
            } else if (data instanceof SpawnEgg) {
                EntityType type = ((SpawnEgg) data).getSpawnedType();
                return (type != null ? type.name() : null);
            } else if (data instanceof Coal) {
                CoalType coal = ((Coal) data).getType();
                return (coal != null && coal != CoalType.COAL ? coal.name() : null);
            } else {
                return null;
View Full Code Here

TOP

Related Classes of org.bukkit.entity.EntityType

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.