Created
March 20, 2016 17:16
-
-
Save shadowfacts/679f6e91d46f65f738bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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