public void tp() { if ((isTouching(Teleport.class ))) { //I got to randomly placed Teleports and i want to get the x, y values of them //somthing like setLocation(Teleport1X, Teleport1Y); } } public void tp1() { if ((isTouching(Teleport1.class ))) { //somthing like setLocation(TeleportX, TeleportY); } }