Jump to content

[1.9] display a chat message in the client side screen


perromercenary00

Recommended Posts

good days

 

1.9 has been realized so i set in the quest to update mi mod to 1.9

and then become the issues

first of all

i have to update the tools  i made to work whith blocks and items

for some reason they change the name of MovingObjectPosition to RayTraceResult

but thats not

 

to mod things  i made a class to show mesages in screen as i use items

 

public static void chatr(EntityPlayer playerIn, String mensaje){

playerIn.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + mensaje));
											  }	

 

this don't works anymore, from the bedBlock class i get this

 

    if (playerIn != null)
    {
    	//ITextComponent chatComponent
        playerIn.addChatComponentMessage(new TextComponentTranslation("tile.bed.occupied", new Object[0]));
    }	

 

but this dont directly prints on screen custom text, this take the text from some lang file somewhere in the code i been folowing the classes but i dont understand how to set to show the content of just a plain text string

 

#############

? first i need the pieze of code to print on player chat a custom string mesage , just like the block coordinates of the block im looking at  (things for i need to use the raytrace in several of mi items and entityes)

 

 

? the second is how i set in mi lang files  customs strings to later retrive it whith the

playerIn.addChatComponentMessage(new TextComponentTranslation("tile.bed.occupied", new Object[0]));

thing

 

i suppose something like "mercenarymod:mensaje001us"

 

well thanks for reading

 

 

 

 

Link to comment
Share on other sites

sip

but is it'n deliverated  just a recurrent accident, when came from google sometimes get bug mi mistake

 

in the other side i been used to set the color from thext using  EnumChatFormatting but dont find it

i guest it also changes name

can you help mi whith that ?

 

playerIn.addChatComponentMessage(new TextComponentString(EnumChatFormatting.RED + mensaje));

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.