I use this to send the player a message
p.addChatMessage(new ChatComponentText
(EnumChatFormatting.DARK_AQUA
+ "You were killed by "
+ EnumChatFormatting.DARK_RED
+ "IDK"
+ EnumChatFormatting.DARK_AQUA
+ "."));
This is my main class
@Mod(name = "LyghtSurvival",
version = "0.0.1",
modid = "ls")
public class Core
{
EntityDamageEvent ed = new EntityDamageEvent();
@Instance
public static Core idInst;
@EventHandler
public void init(FMLInitializationEvent e)
{
FMLCommonHandler.instance().bus().register(ed);
MinecraftForge.EVENT_BUS.register(ed);
}
}
This code only works for singleplayer. I'm new to this sorry.