I am trying to make a simple agility script for Faldor which has two consecutive "Jump Ledges" and the bot currently chooses the previous one as its the closest whern using
 
	 
 
private String[] names = {"Rough wall", "Tightrope", "Hand holds", "Gap", "Gap", "Tightrope","Tightrope","Gap","Ledge","Ledge","Ledge","Ledge","Edge"};
//    private int[] names = {14898, 14899, 14901, 14903, 14904, 14905,14911,14919,14920,14921,14923,14924,149251};
    Entity previous;
    @Override
    public void onStart() {
        getExperienceTracker().start(Skill.AGILITY);
    }
    @Override
    public int onLoop() throws InterruptedException {
        int starting = getExperienceTracker().getGainedXP(Skill.AGILITY);
        Entity nextObj = getObjects().closest(obj -> Arrays.asList(names).contains(obj.getName()) &&
                Arrays.asList(actions).contains(obj.getActions()[0]) &&
                (getMap().canReach(obj)) &&
                !obj.equals(previous));
        log(nextObj.getId());
	 
 
	I am trying to implement the array of ids and have tried 
 
	 
 
	Entity nextObj = getObjects().closest(obj -> Arrays.asList(names).contains(obj.getId()) && Arrays.asList(actions).contains(obj.getActions()[0]) && (getMap().canReach(obj)) && !obj.equals(previous)); However it just creates nulls and breaks the script i was wondering how can i overcome this / the best way to achieve this.