This is what i want to do: void myFunction(items stuff) { foreach it in stuff { //do something here... } } myFunction($items[meat stack, turtle totem]);