rexlz
-
Posts
3 -
Joined
-
Last visited
Posts posted by rexlz
-
-
3 hours ago, IAmAFrenchFry said:
I’m not 100% sure if this is better or what you want, but I think it would be a better route to do this with a plugin, and players can run a command if they want to hear the sound when chatting. If you do this, I would suggest checking out SpigotMC.org.
Hope this helps!
Thanks man, I'll consider that. But I'd still like to figure out a way to do it in a forge mod, as I'm also learning to mod. In fact it's not only the sound won't play, but the event itself not fires when I connect to my server as a client, where I'd try adding some other functions later on. The event does fire and function normally when I play singleplayer.
-
I've started modding with forge recently, and I want to create a mod to play a custom sound upon player chatting on my server.
I used ServerChatEvent as the event to trigger the sound, however that event doesn't really fire when I chat on my server as a client(no sound heard, no debug info). Other events like ItemCraftedEvent fires normally on my server.
I also tried my mod in singleplayer, ServerChatEvent works properly there(when I chat I could hear the sound correctly).
So, what could be the problem?
ServerChatEvent doesn't work on my server
in Modder Support
Posted · Edited by rexlz
Yeah...I'm trying to understand the concept of two sides in Minecraft. As I see it, ServerChatEvent should fire when a player chat on server.
The code below is event loader.
And I initiate it in the main class.
public void preInit(FMLPreInitializationEvent event) { new EventLoader(); }
The result when I test it on my remote server was nothing happen.