Hello!
I would like to get only the slots of the player inventory that contain a specific ItemType and modify the data of that items.
My attempt(in Kotlin but you can definitly read it):
player.inventory.query<Inventory>(ItemTypes.SOME_ITEM_TYPE).slots<Slot>().forEach { slotWithItem ->
slotWithItem.peek().get().offer(Keys.SOME_KEY, someData)
}
The plugin crashes with a NotImplementedException
because iterating over slots seems not to be implemented yet. But that’s not my question. Instead I want to ask, is this the right way to do it once it is implemented?
I read the big PR but I am not smarter afterwards