public static Object mlmpVehicleSpawn(int type, World world, double x, double y, double z, Entity thrower, Object currentEntity) throws Exception
    {
        Class mlmp = getClass("ModLoaderMp"); 
        if (!isMLMPInstalled() || mlmp == null)
        {
            return currentEntity;
        }
        
        Object entry = mlmp.getDeclaredMethod("handleNetClientHandlerEntities", int.class).invoke(null, type);
        if (entry == null)
        {
            return currentEntity;
        }
        
        Class entityClass = (Class)entry.getClass().getDeclaredField("entityClass").get(entry);
        Object ret = (Entity)entityClass.getConstructor(World.class, Double.TYPE, Double.TYPE, Double.TYPE).newInstance(world, x, y, z);

        if (entry.getClass().getDeclaredField("entityHasOwner").getBoolean(entry))
        {
            Field owner = entityClass.getField("owner");

            if (!Entity.class.isAssignableFrom(owner.getType()))
            {
                throw new Exception(String.format("Entity\'s owner field must be of type Entity, but it is of type %s.", owner.getType()));
            }

            if (thrower == null)
            {
                System.out.println("Received spawn packet for entity with owner, but owner was not found.");
                ModLoader.getLogger().fine("Received spawn packet for entity with owner, but owner was not found.");
            }
            else
            {
                if (!owner.getType().isAssignableFrom(thrower.getClass()))
                {
                    throw new Exception(String.format("Tried to assign an entity of type %s to entity owner, which is of type %s.", thrower.getClass(), owner.getType()));
                }

                owner.set(ret, thrower);
            }
        }
        return ret;
    }