Package org.bukkit.entity

Examples of org.bukkit.entity.EntityType


        if (player == null) {
          return;
        }

        // And the projectile must be one the following:
        EntityType type = event.getEntityType();
        switch (type) {
        case ENDER_PEARL:
            break;
        case ENDER_SIGNAL:
            break;
View Full Code Here


     */
    @EventHandler(
            ignoreCancelled = true, priority = EventPriority.MONITOR)
    public void onVehicleMove(final VehicleMoveEvent event) {
        final Vehicle vehicle = event.getVehicle();
        final EntityType entityType = vehicle.getType();
        if (!normalVehicles.contains(entityType)) {
            // A little extra sweep to check for debug flags.
            normalVehicles.add(entityType);
            if (MovingConfig.getConfig(vehicle.getWorld().getName()).debug) {
                System.out.println("[NoCheatPlus] VehicleMoveEvent fired for: " + entityType);
View Full Code Here

  @Override
  public boolean standsOnEntity(final Entity entity, final double minX, final double minY, final double minZ, final double maxX, final double maxY, final double maxZ){
    try{
      // TODO: Probably check other ids too before doing this ?
      for (final Entity other : entity.getNearbyEntities(2.0, 2.0, 2.0)){
        final EntityType type = other.getType();
        if (type != EntityType.BOAT){ //  && !(other instanceof Minecart))
          continue;
        }
        final double locY = entity.getLocation(useLoc).getY();
        useLoc.setWorld(null);
View Full Code Here

      final List list = world.getEntities(mcEntity, box);
      @SuppressWarnings("rawtypes")
      Iterator iterator = list.iterator();
      while (iterator.hasNext()) {
        final net.minecraft.server.v1_4_5.Entity other = (net.minecraft.server.v1_4_5.Entity) iterator.next();
        final EntityType type = other.getBukkitEntity().getType();
        if (type != EntityType.BOAT && type != EntityType.MINECART) continue;
        final AxisAlignedBB otherBox = other.boundingBox;
        if (box.a > otherBox.d || box.d < otherBox.a || box.b > otherBox.e || box.e < otherBox.b || box.c > otherBox.f || box.f < otherBox.c) continue;
        else {
          return true;
View Full Code Here

                            // END HACK
                           
                            type = material.toString();
                        } else if (actionType == ActionType.KILL) {
                            // check entities
                            EntityType entity = EntityType.fromName(key);
                            if (entity == null) {
                                try {
                                    entity = EntityType.valueOf(key.toUpperCase());
                                } catch (IllegalArgumentException e) {}
                            }
                           
                            if (entity != null && entity.isAlive())
                                type = entity.toString();
                        }
                       
                        if (type == null) {
                            Jobs.getPluginLogger().warning("Job " + jobKey + " has an invalid " + actionType.getName() + " type property: " + key + "!");
                            continue;
View Full Code Here

      final double spawnForce = getSpawnForce(info);

      //Get the cart types to spawn
      ArrayList<EntityType> types = new ArrayList<EntityType>();
      StringBuilder amountBuilder = new StringBuilder();
      EntityType type;
      for (char cart : (info.getLine(2) + info.getLine(3)).toCharArray()) {
        type = minecartTypes.get(Character.toString(cart));
        if (type != null) {
          if (amountBuilder.length() > 0) {
            int amount = ParseUtil.parseInt(amountBuilder.toString(), 1);
View Full Code Here

        cart.setVelocity(new Vector(0, 0, 0));
    }

    public static void teleport(final Minecart cart, Location destination) {

        EntityType type = cart.getType();
        final Minecart toCart;

        if(type == EntityType.MINECART_CHEST) {
            toCart = cart.getWorld().spawn(destination, StorageMinecart.class);
            ((StorageMinecart)toCart).getInventory().setContents(((StorageMinecart) cart).getInventory().getContents());
View Full Code Here

     *
     * @param event The event to run the combat checks on.
     */
    public static void processCombatAttack(EntityDamageByEntityEvent event, Entity attacker, LivingEntity target) {
        Entity damager = event.getDamager();
        EntityType entityType = damager.getType();

        if (attacker instanceof Player && entityType == EntityType.PLAYER) {
            Player player = (Player) attacker;

            if (!UserManager.hasPlayerDataKey(player)) {
View Full Code Here

            }
            else if (target instanceof Animals) {
                baseXP = ExperienceConfig.getInstance().getAnimalsXP();
            }
            else {
                EntityType type = target.getType();

                switch (type) {
                    case BAT:
                    case SQUID:
                        baseXP = ExperienceConfig.getInstance().getAnimalsXP();
View Full Code Here

            Command.broadcastCommandMessage(sender, String.format("Successfully given %s the stat %s", player.getName(), statisticString));
            return true;
        }

        if (statistic.getType() == Type.ENTITY) {
            EntityType entityType = EntityType.fromName(statisticString.substring(statisticString.lastIndexOf(".") + 1));

            if (entityType == null) {
                sender.sendMessage(String.format("Unknown achievement or statistic '%s'", statisticString));
                return true;
            }
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.