Something like /sayas

Is any way to force a player to say something ?
I need to create that command : /sayas [player] [message]

With Bukkit we can write :

player.chat("MyBestMessage");

But with SpongeAPI, What I should use ?

Hmm doesn’t look that sponge has something like this yet. But I think you could accomplish the same thing if you call a new PlayerChatEvent and broadcast the output.

Here is an example how sponge does it (always useful to check the sponge implementation if you call events):
https://github.com/SpongePowered/Sponge/blob/172a74350cbe009103fcc31bb135bd75b1e888d0/src/main/java/org/spongepowered/mod/mixin/core/network/MixinNetHandlerPlayServer.java#L86-L89

1 Like

Thank, It’s a nice idea :slight_smile:

1 Like

There is an open issue for this