Collection listener

Hey there,

I’m wondering if it’s possible to set up a listener for collections. Basically, I’d like to read data or trigger certain events whenever an item in a collection gets changed by someone. Or whenever a new item is added.

I’m trying to develop a game where players can pass and retrieve items from each other.

I’m very much new to Nakama and Godot so maybe I’m getting things completely wrong, but I appreciate your help.

Hey @treepumpkin, you should take a look at Nakama’s server-side runtime which lets you create functions that modify player storage collections: Function Reference - Nakama server

What I’d do is create a custom RPC function that gets called by your Godot client which modifies the collection and then performs any other custom logic you want.

1 Like

@treepumpkin If you still want to write storage directly through the client API rather than fully replacing that with an RPC, you could also use an after hook instead. Both an RPC and After hook should work based on your description. :+1: