Skip to content

Instantly share code, notes, and snippets.

@shadowfacts
Created March 20, 2016 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shadowfacts/679f6e91d46f65f738bd to your computer and use it in GitHub Desktop.
Save shadowfacts/679f6e91d46f65f738bd to your computer and use it in GitHub Desktop.
package net.minecraftforge.test;
import net.minecraft.util.text.TextComponentString;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.ServerSendChatEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
/**
* @author shadowfacts
*/
@Mod(modid = "ServerSendChatTest")
public class ServerSendChatTest
{
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
MinecraftForge.EVENT_BUS.register(this);
}
@SubscribeEvent
public void onServerSendChat(ServerSendChatEvent event) {
event.setComponent(new TextComponentString("[From server] ").appendSibling(event.getComponent()));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment