thvardhan

handler

Jul 11th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.21 KB | None | 0 0
  1. package com.thvardhan.ytstuff;
  2.  
  3. import com.mojang.realmsclient.gui.ChatFormatting;
  4.  
  5. import net.minecraft.entity.player.EntityPlayer;
  6. import net.minecraft.event.ClickEvent;
  7. import net.minecraft.util.ChatComponentText;
  8. import net.minecraft.util.ChatStyle;
  9. import net.minecraftforge.fml.common.eventhandler.EventPriority;
  10. import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
  11. import net.minecraftforge.fml.common.gameevent.PlayerEvent;
  12.  
  13. public class YTEventHandler{
  14.    
  15.  
  16.     @SubscribeEvent(priority=EventPriority.NORMAL, receiveCanceled=true)
  17.         public void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent event) {
  18.            
  19.                if(event.player instanceof EntityPlayer){
  20.                
  21.                    ChatComponentText enter=new ChatComponentText(ChatFormatting.AQUA+"You Are Using "+ChatFormatting.GREEN+"YTStuff"+ChatFormatting.RED+" Mod V"+Main.VERSION+" By thvardhan / Serial Player"+ChatFormatting.GREEN);
  22.                    ChatComponentText enter1=new ChatComponentText(ChatFormatting.AQUA+"Press Me To Visit To "+ChatFormatting.GREEN+"thvardhan's / SerialPlayer"+ChatFormatting.YELLOW+" Website For More Cool Stuff"+ChatFormatting.GREEN);
  23.                    ChatComponentText enter2=new ChatComponentText(ChatFormatting.AQUA+"Press Me To Visit To "+ChatFormatting.GREEN+"thvardhan's / SerialPlayer"+ChatFormatting.YELLOW+" Youtube Channel For More Cool Stuff"+ChatFormatting.GREEN);
  24.                    
  25.                    ClickEvent site = new ClickEvent(ClickEvent.Action.OPEN_URL,"http://all-minecraft.weebly.com/");
  26.                    ClickEvent site1 = new ClickEvent(ClickEvent.Action.OPEN_URL,"https://www.youtube.com/channel/UCLCDATvGikpHpoC1LsSRm8w");
  27.                  
  28.                    ChatStyle s1=new ChatStyle();
  29.                    s1.setBold(true);
  30.                    s1.setChatClickEvent(site);
  31.                    
  32.                    ChatStyle s2=new ChatStyle();
  33.                    s2.setBold(true);
  34.                    s2.setChatClickEvent(site1);
  35.                    
  36.                    
  37.                    
  38.                    enter1.setChatStyle(s1);
  39.                    
  40.                    enter2.setChatStyle(s2);
  41.                    
  42.                    
  43.                    
  44.                    
  45.                    event.player.addChatMessage(enter);
  46.                    event.player.addChatMessage(enter1);
  47.                    event.player.addChatComponentMessage(enter2);
  48.             }
  49.                
  50.                
  51.         }
  52.    
  53.    
  54.    
  55.    
  56.  
  57. }
Add Comment
Please, Sign In to add comment