Send Class-Messages [solved]

Hello, I want to send player-Data as a class via a Message.
I tried to Override the getClass()-Function, I think I have to convert my class someway…

In the documention I found:
public final native Class<?> getClass()

This didn’t work:
public Player getClass() {
return player;

I think it’s the problem with native and class…
but how to convert?

I’m afraid I don’t really understand the question though I’ve tried. First you mention that you want to send a class but then your example is sending an object of type Player… which cannot possibly be a Class.

Explain what you are really trying to do because I suspect there is a Java-level misunderstanding somewhere.

yes, it was a misunderstanding. In fact I want to send an instance of a class. I just didn’t know the right vocabulary. My solution is now to make a player_message and access it functions via a cast from the abstract message to player_message.

Just for future reference, an instance of a class is called an object.