Socket Listener does not give callbacks

I’m currently working on a Match system, like Among Us, where you enter a code to join a lobby. To do this I wanted to use the onMatchPresence Event call. I used the code of this documentation, but I get an ‘onMatchPresence’ overrides nothing error, when I try to compile.

Here’s the java code of the documentation:

public void onMatchPresence(MatchPresenceEvent e) {
    if (e.getJoins() != null) {
        e.getJoins().forEach(presence -> {

    if (e.getLeaves() != null) {
        e.getLeaves().forEach(presence -> {
            if (players.containsKey(presence.getSessionId())) {

And I converted the code to Kotlin:

override fun onMatchPresence(e: MatchPresenceEvent) {
    if (e.joins != null) {
        e.joins.forEach { presence ->
            recview.addGuest(presence.userId, getDisplayName(presence.userId, presence.username))
    if (e.leaves != null) {
        e.leaves.forEach { presence ->

Should work the same but I get the error. Can anybody help me out here?

Nakama 3.13
Java SDK 2.1.4

I’ve now implemented them correctly, but still to not get callbacks when a user joins the lobby!
Does anybody know why this happens?

Hi Liam, maybe this could solve your problem:

" By default, Java void is mapped to Unit type in Kotlin . This means that any method that returns void in Java when called from Kotlin will return Unit."


Unfortunately this doesn’t solve my problem, as Kotlin automatically uses Unit return type when not specified

Has anybody else an idea why this is happening? I’m really stuck on this one

I solved it. I had to use the AbstractSocketListener, not the SocketListener

For detailed solution check my Stackoverflow post about this