"So if i understand it correctly i need to use the animation of a single sprite and add frames for each sprite i want to spawn dynamically? So if i want to create i.e. sprite having ID 5 i need to spawn that generic sprite and switch to frame 5? So that could be a solution but would also prevent that those sprites can be animated, right? And also maintaining those sprites would get really nasty. Imagine hundreds of sprites and now you need to add, remove or update some of them."
yes, that's correct and it can get messy for larger programs. (be sure to set animation speed to 0)
yes, you can have different animation in a single sprite. if you double click on the sprite to open the sprite editor you will see an animation named default right click to add more animations. you can also use different sprites but if it isn't necessary then extra sprites just clutter things up.
the 2nd method is just a way to make it work without using arrays.
As for the 3rd example I'm just saying you can stick the animation's name into your array and then call it with the .at() method. The count value wouldn't affect the sprite in any way. in plain speak im saying to the pc, "switch the sprite's animation to the value at this spot in the array."
maybe array.at(itemType's x value, itemType's y value + 2) makes more sense?
the 3rd method is probably the best way to set up larger games.