Fabric API

Fabric API

106M Downloads

Chat API related thing

NikkyAI opened this issue ยท 4 comments

commented

I need the following chat related things:

  • player sent chat message (Mixin: Lnet/minecraft/server/network/ServerPlayNetworkHandler;onChatMessage(Lnet/minecraft/server/network/packet/ChatMessageServerPacket;)V)
  • a way to detect /say usage

sending chat messages works via getting a instance of MinecraftDedicatedServer which gives the DedicatedPlayerManager

but would it be possible to get that server instance from FabricAPI too ?
or maybe through the loader.. it is getting constructed before the mods are loaded
so it could be passed in onInitializeServer

commented

Wouldn't the last be best done by mixing CommandSay?

commented

i encountered mods replacing commands on forge..
one of them being conventional-chat
so i needed to listen to which commands were executed and if they were using /say

i can mixin to CommandSay, i just don't think it will be enough long term

commented

In that case, it would be best to Mixin to whatever method receives data to put into the chat.

commented

so, have you tried to add onchat event?

i need to override chat input and process it

what can i do now?