#Plugin Messaging Channel

1 messages · Page 1 of 1 (latest)

tawdry horizon
#

As in the Tutorial shown you have to implement PluginMessageListener to a class

#

then you can @Override and create the Method above

#

its like an EventHandler but changes construction

spice raft
#

okay

#

but for expampe when i need player.sendMessage(what here?);

tawdry horizon
#

if you want to send a message to a play who is at another server you cant use player.sendMessage

#

you need player.sendPluginMessage

spice raft
#

do i need a reciver or something?

tawdry horizon
#

the reciver is in the thread i send you and works like i wrote above

spice raft
#

okay thx i will try it

spice raft
#

does not work

tawdry horizon
#

This should work easy;
You could achieve this by creating a Plugin that implements the PluginMessageListener and the EventHandler for PlayerChatEvent or smth like this;

In the EventHandler you use: player.sendPluginMessage(....)
and in the onEnable you register the channel you use - for example: "ChatForwarding"

Now you can use the PluginMessageListener to check for the specific channel "ChatForwarding" and read the message it has

spice raft
#

can u show me an example ?